From f72170ddf7e42802ca4572d72bba8a8fc39b2307 Mon Sep 17 00:00:00 2001 From: Robb Matzke Date: Fri, 9 Aug 2002 09:55:34 -0500 Subject: [svn-r5860] ./hdf5-devel/src/H5.c Purpose: Merged from 1.4 branch Description: API tracing improvements Platforms tested: Linux (--disable-hsizet didn't work before my changes and still doesn't work, but --enable-hsizet is fine). Note: This checkin includes temporary code in H5FDmpiposix.c to turn off GPFS byte range token prefetches on ASCI/Blue. Once the HDF5 API supports the necessary prerequisite functionality this temporary code can be migraged up above HDF5. --- src/H5.c | 103 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 89 insertions(+), 14 deletions(-) diff --git a/src/H5.c b/src/H5.c index 3f7f34a..4a9abdc 100644 --- a/src/H5.c +++ b/src/H5.c @@ -251,16 +251,13 @@ H5dont_atexit(void) FUNC_ENTER_API_NOINIT(H5dont_atexit); - H5_trace(FALSE, "H5dont_atexit", ""); - if (dont_atexit_g) HGOTO_DONE(FAIL); dont_atexit_g = TRUE; done: - FUNC_LEAVE(ret_value); -} + FUNC_LEAVE(ret_value);} /*------------------------------------------------------------------------- @@ -364,7 +361,10 @@ H5set_free_list_limits(int reg_global_lim, int reg_list_lim, int arr_global_lim, * Wednesday, August 19, 1998 * * Modifications: - * + * Robb Matzke, 2002-08-08 + * Accepts the `ttop' word. If enabled then show only the + * top level API calls, otherwise show all API calls. Also + * turns on tracing as if the `trace' word was present. *------------------------------------------------------------------------- */ static void @@ -397,6 +397,12 @@ H5_debug_mask(const char *s) /* Trace, all, or one? */ if (!HDstrcmp(pkg_name, "trace")) { H5_debug_g.trace = clear?NULL:stream; + } else if (!HDstrcmp(pkg_name, "ttop")) { + H5_debug_g.trace = stream; + H5_debug_g.ttop = !clear; + } else if (!HDstrcmp(pkg_name, "ttimes")) { + H5_debug_g.trace = stream; + H5_debug_g.ttimes = !clear; } else if (!HDstrcmp(pkg_name, "all")) { for (i=0; i1) { + --current_depth; + return 0.0; + } + } else { + if (current_depth>0) { + /*do not update last_call_depth*/ + current_depth++; + return 0.0; + } + } + } + + /* Get tim for event */ + if (!first_time.etime) + H5_timer_begin(&first_time); + if (H5_debug_g.ttimes) { + H5_timer_begin(&event_time); + } else { + memset(&event_time, 0, sizeof event_time); + } + + /* Print the first part of the line. This is the indication of the + * nesting depth followed by the function name and either start of + * argument list or start of return value. If this call is for a + * function return and no other calls have been made to H5_trace() + * since the one for the function call, then we're continuing + * the same line. */ if (returning) { - fprintf (out, " = "); + assert(current_depth>0); + --current_depth; + if (current_depthlast_call_depth) + fputs(" = \n", out); + if (H5_debug_g.ttimes) + fprintf(out, "@%.6f ", event_time.etime-first_time.etime); + for (i=0; i