2 Copyright Rene Rivera 2005.
3 Distributed under the Boost Software License, Version 1.0.
4 (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
15 /* name of rule being called */
17 /* cumulative time spent in rule */
19 /* time spent in rule proper */
21 /* number of time rule was entered */
22 unsigned long num_entries;
23 /* number of the times this function is present in stack */
24 unsigned long stack_count;
25 /* bytes of memory allocated by the call */
28 typedef struct profile_info profile_info;
32 /* permanent storage where data accumulates */
34 /* overhead for profiling in this call */
36 /* time of last entry to rule */
38 /* stack frame of caller */
39 struct profile_frame* caller;
40 /* time spent in subrules */
43 typedef struct profile_frame profile_frame;
45 profile_frame * profile_init( char * rulename, profile_frame * frame );
46 void profile_enter( char* rulename, profile_frame * frame );
47 void profile_memory( long mem );
48 void profile_exit( profile_frame * frame );
51 #define PROFILE_ENTER( scope ) profile_frame PROF_ ## scope, *PROF_ ## scope ## _p = profile_init( #scope, &PROF_ ## scope )
52 #define PROFILE_EXIT( scope ) profile_exit( PROF_ ## scope ## _p )