void turn_tracing_off (mval *gvn) { DCL_THREADGBL_ACCESS; SETUP_THREADGBL_ACCESS; if (FALSE == is_tracing_on) return; assert(TREF(mprof_ptr)); TIMES(&(TREF(mprof_ptr))->tcurr); /* update the time of previous M line, if there was one */ if (NULL != (TREF(mprof_ptr))->curr_tblnd) { UPDATE_TIME((TREF(mprof_ptr))->curr_tblnd); } if (NULL != gvn) parse_gvn(gvn); is_tracing_on = (TREF(mprof_ptr))->is_tracing_ini = FALSE; assert(0 != (TREF(mprof_ptr))->gbl_to_fill.str.addr); free((TREF(mprof_ptr))->gbl_to_fill.str.addr); (TREF(mprof_ptr))->gbl_to_fill.str.addr = NULL; mprof_tree_walk((TREF(mprof_ptr))->head_tblnd); mprof_stack_free(); (TREF(mprof_ptr))->pcavailptr = (TREF(mprof_ptr))->pcavailbase; (TREF(mprof_ptr))->pcavail = PROFCALLOC_DSBLKSIZE - SIZEOF(char *); CLEAR_PROFILING_TABLE(); return; }
/* Traverses the tree and saves every value in the global */ void mprof_tree_walk(mprof_tree *node) { mprof_tree *loop_link; while (TRUE) { if (NULL != node->link[LEFT]) mprof_tree_walk(node->link[LEFT]); crt_gbl(node, FALSE); loop_link = node->loop_link; while (NULL != loop_link) { crt_gbl(loop_link, TRUE); loop_link = loop_link->loop_link; } if (NULL != node->link[RIGHT]) node = node->link[RIGHT]; else break; } return; }