ppw_profiler.c File Reference

Non-inline measurement functions. More...

#include <ppw_stdinc.h>

Functions

void ppw_prof_tostat (ppw_profiler prof, ppw_timer timer, ppw_stat *stat, int32_t parent)
 Copies data from a ppw_timer into a ppw_stat.
void ppw_prof_dumpcp (ppw_profiler prof, int32_t depth, ppw_timer t, FILE *fp)
 Recursively dump callpaths from timer lists.
ppw_profiler ppw_prof_create (int32_t thread_id, char convert_ticks)
 Create a profiler.
void ppw_prof_free (ppw_profiler prof)
 Frees a profiler.
void ppw_prof_dump (ppw_profiler prof, FILE *fp, int32_t showtimers)
 Dumps out all timers in this profile.
void ppw_prof_toprofile (ppw_profiler prof, ppw_profile p)
 For more information on this algorithm, see the notes on the prototype implementation of this in the ppw/misc/profconv directory.


Detailed Description

Non-inline measurement functions.

Non-inline profiler functions.

Author:
Adam Leko

Function Documentation

void ppw_prof_dumpcp ( ppw_profiler  prof,
int32_t  depth,
ppw_timer  t,
FILE *  fp 
)

Recursively dump callpaths from timer lists.

This is asilly debug function but serves as fairly decent documentation of how iteration on the callpath data structure works.

References ppw_timer_s.children, ppw_timer_s.cnt, ppw_timer_s.ex_sum, ppw_timer_s.in_sum, ppw_profiler_s.lis, ppw_timer_s.next, ppw_timer_s.parent, ppw_list_at(), PPW_PROF_HASHFACT, ppw_timer_s.srcId, and ppw_timer_s.sub_cnt.

Referenced by ppw_prof_dump().

void ppw_prof_toprofile ( ppw_profiler  prof,
ppw_profile  p 
)

For more information on this algorithm, see the notes on the prototype implementation of this in the ppw/misc/profconv directory.

Transfers all timers to profile data object.

It's not as pretty as a recursive implementation, but is much safer wrt stack size and not overflowing stack boundaries.

We could avoid using the stacks here by keeping track of "previous" node pointers. This doesn't seem worth the extra online/disk storage space, so unless the stack sizes grow out of hand for large profiles (they only will for the "deepest" path in the tree that has a high depth or a high number of siblings), we shouldn't bother with them.

References ppw_timer_s.children, ppw_profiler_s.lis, ppw_profiler_s.newstack, ppw_timer_s.next, ppw_profiler_s.oldstack, ppw_list_at(), ppw_list_size(), PPW_PROF_HASHFACT, ppw_prof_tostat(), ppw_profile_add_stat(), ppw_profile_get_stat(), ppw_stack_haselems(), ppw_stack_pop(), and ppw_stack_push().

Referenced by ppw_meas_finish().


Generated on Sat Sep 29 08:46:41 2012 for PPW by  doxygen 1.5.8