Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/tools/jam/src/debug.h @ 29

Last change on this file since 29 was 29, checked in by landauf, 17 years ago

updated boost from 1_33_1 to 1_34_1

File size: 1.5 KB
RevLine 
[29]1/*
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)
5*/
6#ifndef BJAM_DEBUG_H
7#define BJAM_DEBUG_H
8
9# include "jam.h"
10# include <time.h>
11
12struct profile_info
13{
14    /* name of rule being called */
15    char* name;
16    /* cumulative time spent in rule */
17    clock_t cumulative;
18    /* time spent in rule proper */
19    clock_t net;
20    /* number of time rule was entered */
21    unsigned long num_entries;
22    /* number of the times this function is present in stack */
23    unsigned long stack_count;
24    /* bytes of memory allocated by the call */
25    unsigned long memory;
26};
27typedef struct profile_info profile_info;
28
29struct profile_frame
30{
31    /* permanent storage where data accumulates */
32    profile_info* info;
33    /* overhead for profiling in this call */
34    clock_t overhead;
35    /* time of last entry to rule */
36    clock_t entry_time;
37    /* stack frame of caller */
38    struct profile_frame* caller;
39    /* time spent in subrules */
40    clock_t subrules;
41};
42typedef struct profile_frame profile_frame;
43
44profile_frame * profile_init( char* rulename, profile_frame* frame );
45void profile_enter( char* rulename, profile_frame* frame );
46void profile_memory( long mem );
47void profile_exit(profile_frame* frame);
48void profile_dump();
49
50#define PROFILE_ENTER(scope) profile_frame PROF_ ## scope, *PROF_ ## scope ## _p = profile_init(#scope,&PROF_ ## scope)
51#define PROFILE_EXIT(scope) profile_exit(PROF_ ## scope ## _p)
52
53#endif
Note: See TracBrowser for help on using the repository browser.