diff options
Diffstat (limited to 'src/H5trace.c')
-rw-r--r-- | src/H5trace.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/H5trace.c b/src/H5trace.c index 1565a86..6eff40c 100644 --- a/src/H5trace.c +++ b/src/H5trace.c @@ -117,8 +117,8 @@ H5_trace(const double *returning, const char *func, const char *type, ...) void * vp = NULL; FILE * out = H5_debug_g.trace; static hbool_t is_first_invocation = TRUE; - H5_timer_t function_timer = {{0}, {0}, {0}, FALSE}; - H5_timevals_t function_times; + H5_timer_t function_timer; + H5_timevals_t function_times = {0.0, 0.0, 0.0}; static H5_timer_t running_timer; H5_timevals_t running_times; static int current_depth = 0; @@ -130,6 +130,10 @@ H5_trace(const double *returning, const char *func, const char *type, ...) return 0.0F; /*tracing is off*/ HDva_start(ap, type); + /* Initialize the timer for this function */ + if (H5_debug_g.ttimes) + H5_timer_init(&function_timer); + if (H5_debug_g.ttop) { if (returning) { if (current_depth > 1) { @@ -153,11 +157,10 @@ H5_trace(const double *returning, const char *func, const char *type, ...) H5_timer_init(&running_timer); H5_timer_start(&running_timer); } /* end if */ - if (H5_debug_g.ttimes) { - /* start the timer for this function */ - H5_timer_init(&function_timer); + + /* Start the timer for this function */ + if (H5_debug_g.ttimes) H5_timer_start(&function_timer); - } /* end if */ /* Print the first part of the line. This is the indication of the * nesting depth followed by the function name and either start of |