Branch: Tag:

2001-05-16

2001-05-16 12:57:49 by Per Hedbor <ph@opera.com>

Count RXML overhead and entities when using AVERAGE_PROFILING

Rev: server/base_server/configuration.pike:1.432
Rev: server/base_server/rxml.pike:1.300
Rev: server/etc/modules/RXML.pmod/module.pmod:1.154

1:   // A vitual server's main configuration   // Copyright © 1996 - 2000, Roxen IS. - constant cvs_version = "$Id: configuration.pike,v 1.431 2001/05/16 01:15:41 nilsson Exp $"; + constant cvs_version = "$Id: configuration.pike,v 1.432 2001/05/16 12:56:39 per Exp $";   #include <module.h>   #include <module_constants.h>   #include <roxen.h>
50: Inside #if defined(AVERAGE_PROFILING)
      if( !sizeof(current_stack ) )    { -  report_error("Popping out of profiling stack\n"); + // report_error("Popping out of profiling stack\n");    return;    }   
59: Inside #if defined(AVERAGE_PROFILING)
      if(i < 0 )    { -  report_error("Popping out of profiling stack, cannot find %O in %O\n", -  k, current_stack); +     return;    } -  +  void low_leave( int i ) +  {    int tt = t0-current_stack[i][1];    int ttv = t1-current_stack[i][2];   
74: Inside #if defined(AVERAGE_PROFILING)
   }    current_stack = current_stack[..i-1];    add_prof_entry( id, k, tt, ttv ); +  }; +  +  if( i != sizeof( current_stack )-1 ) +  { +  for( int j = sizeof( current_stack )-1; j>=i; j-- ) +  low_leave( j ); +  return;    } -  +  low_leave( i );    } -  + }      class ProfInfo( string url )   {
131: Inside #if defined(AVERAGE_PROFILING)
  void add_prof_entry( RequestID id, string k, int hr, int hrv )   {    string l = id->not_query; -  if( has_prefix( k, "find_internal" ) ) l = dirname(l); -  if( !profiling_info[l] ) profiling_info[l] = ProfInfo(l); + // if( has_prefix( k, "find_internal" ) ) l = dirname(l); +  if( has_prefix( l, query_internal_location() ) ) +  l = dirname( l ); // enough, really. +  +  if( !profiling_info[l] ) +  profiling_info[l] = ProfInfo(l); +     profiling_info[l]->add( k, hr, hrv );   }   
1407: Inside #if defined(MODULE_LEVEL_SECURITY)
   return tmp2;    }   #endif -  PROF_ENTER(Roxen.get_owning_module(tmp[1])->module_name,"location module"); +  PROF_ENTER(Roxen.get_owning_module(tmp[1])->module_name,"location");    TRACE_ENTER("Calling find_file()...", 0);    LOCK(tmp[1]);    fid=tmp[1]( file[ strlen(loc) .. ] + id->extra_extension, id);    UNLOCK();    TRACE_LEAVE(""); -  PROF_LEAVE(Roxen.get_owning_module(tmp[1])->module_name,"location module"); +  PROF_LEAVE(Roxen.get_owning_module(tmp[1])->module_name,"location");    if(fid)    {    id->virtfile = loc;
1483:    TIMER_START(directory_module);    if(dir_module)    { -  PROF_ENTER(dir_module->module_name,"directory module"); +  PROF_ENTER(dir_module->module_name,"directory");    LOCK(dir_module);    TRACE_ENTER("Directory module", dir_module);    fid = dir_module->parse_directory(id);    UNLOCK(); -  PROF_LEAVE(dir_module->module_name,"directory module"); +  PROF_LEAVE(dir_module->module_name,"directory");    }    else    {
1526: Inside #if defined(MODULE_LEVEL_SECURITY)
   return tmp;    }   #endif -  PROF_ENTER(Roxen.get_owning_module(funp)->module_name,"ext module"); +  PROF_ENTER(Roxen.get_owning_module(funp)->module_name,"ext");    LOCK(funp);    tmp=funp(fid, loc, id);    UNLOCK(); -  PROF_LEAVE(Roxen.get_owning_module(funp)->module_name,"ext module"); +  PROF_LEAVE(Roxen.get_owning_module(funp)->module_name,"ext");    if(tmp)    {    if(!objectp(tmp))