diff options
author | Robb Matzke <matzke@llnl.gov> | 1998-06-17 20:46:29 (GMT) |
---|---|---|
committer | Robb Matzke <matzke@llnl.gov> | 1998-06-17 20:46:29 (GMT) |
commit | 22538a0c799bcb82b40346849776e354fbc18fee (patch) | |
tree | dcefb55f7e1a6632c89fdd8592588747f16fa9e1 /src/H5G.c | |
parent | 53916f4e5935ae7c36d7dd6e04d1c5e51b7e78ea (diff) | |
download | hdf5-22538a0c799bcb82b40346849776e354fbc18fee.zip hdf5-22538a0c799bcb82b40346849776e354fbc18fee.tar.gz hdf5-22538a0c799bcb82b40346849776e354fbc18fee.tar.bz2 |
[svn-r429] Changes since 19980616
----------------------
./html/tracing.html NEW
This entire update is to make it possible for the library to
print the name, arguments, and return value of every API call
without requiring any extra work from developers or app
programmers. This file describes how this all works.
./configure.in
Added the `--enable-tracing' switch. If you use it then the
library will include code to print API function names,
argument names and values, and function return values.
However, you must then turn on the tracing by setting the
HDF5_TRACE environment variable to a file descriptor number.
The default is `--disable-tracing' since enabling it causes a
slight increase in library size and a slowdown resulting from
an extra function call for each API function call (I couldn't
even measure the slowdown :-)
./bin/trace NEW
A perl script that synchronizes the H5TRACE() macro calls in
the *.c files with the function return type and formal
argument names and types. If you use GNU make and gcc then
this will be done automatically, otherwise just invoke this
script with the names of one or more .c files. You could do
it by hand to, but encoding argument types is a little tricky
at first.
./config/commence.in
Added the $(TRACE) macro, which defaults to the no-op.
Added -D_POSIX_SOURCE to the compiler command line.
./src/Makefile.in
Override the default for $(TRACE).
./config/depend.in
Automatically calls $(TRACE) to synchronize the H5TRACE()
macros in any source file that changed. As with makefile
dependencies, one way to force synchronization of all files is
to remove the `.depend' file.
./MANIFEST
Added new files.
./src/H5Eprivate.h
Modified HRETURN_ERROR() and HRETURN() for tracing.
./src/H5.c
./src/H5private.h
This is where the real tracing work really happens, in
H5_trace().
./src/H5A.c
./src/H5D.c
./src/H5G.c
./src/H5P.c
./src/H5S.c
./src/H5Z.c
Added H5TRACE() calls to all API functions. You don't really
need these changes if you don't want to merge your stuff
because they can be generated automatically by going to the
hdf5/src directory and saying ../bin/trace *.c
./src/H5T.c
Added H5TRACE() calls. Other stuff below.
./src/H5E.c
./src/H5Epublic.h
Added H5TRACE() calls. Created a type H5E_auto_t for the
`func' argument of H5Eset_auto() and H5Eget_auto() to make
those arguments easier to parse for tracing. It should also
make it clearer for users that don't know how to read
complicated ANSI data types.
./src/H5F.c
Added H5TRACE() calls. Changed a couple `uintn' argument
types in API functions to `unsigned int' since `uintn' part of
the API. Changed a few "can't" and "cant" error messages to
"unable to".
./src/H5Ipublic.h
Removed H5_DIRECTORY from the H5I_group_t enum. It wasn't
used anywhere.
./src/H5Tconv.c
Removed an unused label.
./src/H5Fistore.c
./src/H5Oattr.c
./src/H5Odtype.c
./src/H5T.c
./test/dsets.c
./test/dtypes.c
Fixed a warning about a variable possibly used before it's
initialized. Added __unused__ to turn off some unused
argument warnings that pop up when debugging is turned off and
optimizations are turned on.
Diffstat (limited to 'src/H5G.c')
-rw-r--r-- | src/H5G.c | 24 |
1 files changed, 18 insertions, 6 deletions
@@ -125,13 +125,14 @@ static void H5G_term_interface(void); *------------------------------------------------------------------------- */ hid_t -H5Gcreate(hid_t loc_id, const char *name, size_t size_hint) +H5Gcreate (hid_t loc_id, const char *name, size_t size_hint) { H5G_t *loc = NULL; H5G_t *grp = NULL; hid_t ret_value = FAIL; FUNC_ENTER(H5Gcreate, FAIL); + H5TRACE3("i","isz",loc_id,name,size_hint); /* Check arguments */ if (NULL==(loc=H5G_loc (loc_id))) { @@ -174,13 +175,14 @@ H5Gcreate(hid_t loc_id, const char *name, size_t size_hint) *------------------------------------------------------------------------- */ hid_t -H5Gopen(hid_t loc_id, const char *name) +H5Gopen (hid_t loc_id, const char *name) { hid_t ret_value = FAIL; H5G_t *grp = NULL; H5G_t *loc = NULL; FUNC_ENTER(H5Gopen, FAIL); + H5TRACE2("i","is",loc_id,name); /* Check args */ if (NULL==(loc=H5G_loc(loc_id))) { @@ -222,9 +224,10 @@ H5Gopen(hid_t loc_id, const char *name) *------------------------------------------------------------------------- */ herr_t -H5Gclose(hid_t grp_id) +H5Gclose (hid_t grp_id) { FUNC_ENTER(H5Gclose, FAIL); + H5TRACE1("e","i",grp_id); /* Check args */ if (H5_GROUP != H5I_group(grp_id) || @@ -272,12 +275,13 @@ H5Gclose(hid_t grp_id) *------------------------------------------------------------------------- */ herr_t -H5Gset(hid_t loc_id, const char *name) +H5Gset (hid_t loc_id, const char *name) { H5G_t *grp = NULL; H5G_t *loc = NULL; FUNC_ENTER(H5Gset, FAIL); + H5TRACE2("e","is",loc_id,name); /* Check/fix arguments */ if (NULL==(loc=H5G_loc(loc_id))) { @@ -332,12 +336,13 @@ H5Gset(hid_t loc_id, const char *name) *------------------------------------------------------------------------- */ herr_t -H5Gpush(hid_t loc_id, const char *name) +H5Gpush (hid_t loc_id, const char *name) { H5G_t *grp = NULL; H5G_t *loc = NULL; FUNC_ENTER(H5Gpush, FAIL); + H5TRACE2("e","is",loc_id,name); /* Check arguments */ if (NULL == (loc = H5G_loc(loc_id))) { @@ -396,11 +401,12 @@ H5Gpush(hid_t loc_id, const char *name) *------------------------------------------------------------------------- */ herr_t -H5Gpop(hid_t loc_id) +H5Gpop (hid_t loc_id) { H5G_t *loc = NULL; FUNC_ENTER(H5Gpop, FAIL); + H5TRACE1("e","i",loc_id); /* Check arguments */ if (NULL == (loc = H5G_loc(loc_id))) { @@ -452,6 +458,7 @@ H5Giterate (hid_t loc_id, const char *name, int *idx, H5G_t *loc = NULL; FUNC_ENTER (H5Giterate, FAIL); + H5TRACE5("e","is*Isxx",loc_id,name,idx,op,op_data); /* Check args */ if (NULL==(loc=H5G_loc (loc_id))) { @@ -518,6 +525,7 @@ H5Gmove (hid_t __unused__ loc_id, const char __unused__ *src, const char __unused__ *dst) { FUNC_ENTER (H5Gmove, FAIL); + H5TRACE3("e","iss",loc_id,src,dst); HRETURN_ERROR (H5E_SYM, H5E_UNSUPPORTED, FAIL, "unable to rename object (not implemented yet)"); @@ -561,6 +569,7 @@ H5Glink (hid_t loc_id, H5G_link_t type, const char *cur_name, H5G_t *loc = NULL; FUNC_ENTER (H5Glink, FAIL); + H5TRACE4("e","iGlss",loc_id,type,cur_name,new_name); /* Check arguments */ if (NULL==(loc=H5G_loc (loc_id))) { @@ -610,6 +619,7 @@ herr_t H5Gunlink (hid_t __unused__ loc_id, const char __unused__ *name) { FUNC_ENTER (H5Gunlink, FAIL); + H5TRACE2("e","is",loc_id,name); HRETURN_ERROR (H5E_SYM, H5E_UNSUPPORTED, FAIL, "unable to unlink name (not implemented yet)"); @@ -644,6 +654,7 @@ H5Gstat (hid_t loc_id, const char *name, hbool_t follow_link, H5G_t *loc = NULL; FUNC_ENTER (H5Gstat, FAIL); + H5TRACE3("e","isb",loc_id,name,follow_link); /* Check arguments */ if (NULL==(loc=H5G_loc (loc_id))) { @@ -686,6 +697,7 @@ H5Gget_linkval (hid_t loc_id, const char *name, size_t size, char *buf/*out*/) H5G_t *loc = NULL; FUNC_ENTER (H5Gget_linkval, FAIL); + H5TRACE3("e","isz",loc_id,name,size); /* Check arguments */ if (NULL==(loc=H5G_loc (loc_id))) { |