Branch: Tag:

2004-05-20

2004-05-20 20:13:38 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Various --with-profiling fixes:
* Now uses get_cpu_time() instead of gethrtime().
* Added PROFILING_DEBUG and corresponding DO_IF_PROFILING_DEBUG() (verbose).
* Renamed Pike_interpreter.time_base to Pike_interpreter.unlocked_time.
* Removed unused macro low_return_profiling().
* Profiling information is now updated by POP_PIKE_FRAME().
* Fixed various bugs causing negative self_time accounting.
* Added PIKE_DEBUG checks verifying positive profiling accounting.
* Removed unused field time_base from struct thread_state.

Rev: src/apply_low.h:1.28
Rev: src/builtin_functions.c:1.558
Rev: src/global.h:1.99
Rev: src/interpret.c:1.349
Rev: src/interpret.h:1.152
Rev: src/interpret_functions.h:1.168
Rev: src/pike_threadlib.h:1.54
Rev: src/program.h:1.203
Rev: src/threads.h:1.128

2:   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: interpret_functions.h,v 1.167 2004/04/03 21:53:49 mast Exp $ + || $Id: interpret_functions.h,v 1.168 2004/05/20 20:13:38 grubba Exp $   */      /*
2250:    add_ref(new_frame->context.prog); \    if(new_frame->context.parent) \    add_ref(new_frame->context.parent); \ +  \ +  DO_IF_PROFILING({ \ +  new_frame->start_time = \ +  get_cpu_time() - Pike_interpreter.unlocked_time; \ +  new_frame->ident = Pike_fp->ident; \ +  new_frame->children_base = Pike_interpreter.accounted_time; \ +  new_frame->context.prog->identifiers[new_frame->ident].num_calls++; \ +  DO_IF_PROFILING_DEBUG({ \ +  fprintf(stderr, "%p{: Push at %" PRINT_CPU_TIME \ +  " %" PRINT_CPU_TIME "\n", \ +  Pike_interpreter.thread_state, new_frame->start_time, \ +  new_frame->children_base); \ +  }); \ +  }); \ +  \    Pike_fp=new_frame; \    new_frame->flags=PIKE_FRAME_RETURN_INTERNAL | XFLAGS; \    \