| 81 | |
| 82 | |
| 83 | void profile_exit( profile_frame * frame ) |
| 84 | { |
| 85 | if ( DEBUG_PROFILE ) |
| 86 | { |
| 87 | /* Cumulative time for this call. */ |
| 88 | clock_t const t = clock() - frame->entry_time - frame->overhead; |
| 89 | /* If this rule is already present on the stack, do not add the time for |
| 90 | * this instance. |
| 91 | */ |
| 92 | if ( frame->info->stack_count == 1 ) |
| 93 | frame->info->cumulative += t; |
| 94 | /* Net time does not depend on presense of the same rule in call stack. |
| 95 | */ |
| 96 | frame->info->net += t - frame->subrules; |
| 97 | |
| 98 | if ( frame->caller ) |
| 99 | { |
| 100 | /* Caller's cumulative time must account for this overhead. */ |
| 101 | frame->caller->overhead += frame->overhead; |
| 102 | frame->caller->subrules += t; |
| 103 | } |
| 104 | /* Pop this stack frame. */ |
| 105 | --frame->info->stack_count; |
| 106 | profile_stack = frame->caller; |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | |
| 111 | static void dump_profile_entry( void * p_, void * ignored ) |
no outgoing calls
no test coverage detected