MCPcopy Create free account
hub / github.com/boostorg/build / profile_enter

Function profile_enter

src/engine/debug.cpp:28–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26
27
28void profile_enter( OBJECT * rulename, profile_frame * frame )
29{
30 if ( DEBUG_PROFILE )
31 {
32 double start = profile_clock();
33 profile_info * p;
34
35 if ( !profile_hash && rulename )
36 profile_hash = hashinit( sizeof( profile_info ), "profile" );
37
38 if ( rulename )
39 {
40 int found;
41 p = (profile_info *)hash_insert( profile_hash, rulename, &found );
42 if ( !found )
43 {
44 p->name = rulename;
45 p->cumulative = 0;
46 p->net = 0;
47 p->num_entries = 0;
48 p->stack_count = 0;
49 p->memory = 0;
50 }
51 }
52 else
53 {
54 p = &profile_other;
55 }
56
57 p->num_entries += 1;
58 p->stack_count += 1;
59
60 frame->info = p;
61
62 frame->caller = profile_stack;
63 profile_stack = frame;
64
65 frame->entry_time = profile_clock();
66 frame->overhead = 0;
67 frame->subrules = 0;
68
69 /* caller pays for the time it takes to play with the hash table */
70 if ( frame->caller )
71 frame->caller->overhead += frame->entry_time - start;
72 }
73}
74
75
76void profile_memory( size_t mem )

Callers 4

hash_insertFunction · 0.85
hash_findFunction · 0.85
profile_initFunction · 0.85
evaluate_ruleFunction · 0.85

Calls 3

profile_clockFunction · 0.85
hashinitFunction · 0.85
hash_insertFunction · 0.85

Tested by

no test coverage detected