2003-07-10 02:00:43 +08:00
|
|
|
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
2007-02-07 22:56:24 +08:00
|
|
|
|
* Copyright by The HDF Group. *
|
2003-07-10 02:00:43 +08:00
|
|
|
|
* Copyright by the Board of Trustees of the University of Illinois. *
|
|
|
|
|
* All rights reserved. *
|
|
|
|
|
* *
|
|
|
|
|
* This file is part of HDF5. The full HDF5 copyright notice, including *
|
|
|
|
|
* terms governing use, modification, and redistribution, is contained in *
|
|
|
|
|
* the files COPYING and Copyright.html. COPYING can be found at the root *
|
|
|
|
|
* of the source code distribution tree; Copyright.html can be found at the *
|
|
|
|
|
* root level of an installed copy of the electronic HDF5 document set and *
|
|
|
|
|
* is linked from the top-level documents page. It can also be found at *
|
2007-02-07 22:56:24 +08:00
|
|
|
|
* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
|
|
|
|
|
* access to either file, you may request a copy from help@hdfgroup.org. *
|
2003-07-10 02:00:43 +08:00
|
|
|
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
|
|
|
|
|
|
|
|
|
/* Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
|
|
|
|
|
* Wednesday, July 9, 2003
|
|
|
|
|
*
|
|
|
|
|
* Purpose: File object debugging functions.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#define H5F_PACKAGE /*suppress error about including H5Fpkg */
|
2005-11-15 10:55:39 +08:00
|
|
|
|
#define H5G_PACKAGE /*suppress error about including H5Gpkg */
|
2003-07-10 02:00:43 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "H5private.h" /* Generic Functions */
|
|
|
|
|
#include "H5Eprivate.h" /* Error handling */
|
|
|
|
|
#include "H5Fpkg.h" /* File access */
|
2005-11-15 10:55:39 +08:00
|
|
|
|
#include "H5Gpkg.h" /* Groups */
|
2003-07-10 02:00:43 +08:00
|
|
|
|
#include "H5Iprivate.h" /* ID Functions */
|
|
|
|
|
#include "H5Pprivate.h" /* Property lists */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
|
* Function: H5F_debug
|
|
|
|
|
*
|
|
|
|
|
* Purpose: Prints a file header to the specified stream. Each line
|
|
|
|
|
* is indented and the field name occupies the specified width
|
|
|
|
|
* number of characters.
|
|
|
|
|
*
|
|
|
|
|
* Return: Non-negative on success/Negative on failure
|
|
|
|
|
*
|
|
|
|
|
* Programmer: Robb Matzke
|
|
|
|
|
* matzke@llnl.gov
|
|
|
|
|
* Aug 1 1997
|
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
herr_t
|
2007-05-11 04:35:35 +08:00
|
|
|
|
H5F_debug(H5F_t *f, FILE *stream, int indent, int fwidth)
|
2003-07-10 02:00:43 +08:00
|
|
|
|
{
|
2007-02-28 06:12:29 +08:00
|
|
|
|
H5P_genplist_t *plist; /* File creation property list */
|
|
|
|
|
hsize_t userblock_size; /* Userblock size */
|
|
|
|
|
herr_t ret_value = SUCCEED; /* Return value */
|
2003-07-10 02:00:43 +08:00
|
|
|
|
|
2012-02-09 11:13:27 +08:00
|
|
|
|
FUNC_ENTER_NOAPI(FAIL)
|
2003-07-10 02:00:43 +08:00
|
|
|
|
|
|
|
|
|
/* check args */
|
2007-02-28 06:12:29 +08:00
|
|
|
|
HDassert(f);
|
|
|
|
|
HDassert(stream);
|
|
|
|
|
HDassert(indent >= 0);
|
|
|
|
|
HDassert(fwidth >= 0);
|
2003-07-10 02:00:43 +08:00
|
|
|
|
|
|
|
|
|
/* Get property list */
|
2008-08-22 04:30:19 +08:00
|
|
|
|
if(NULL == (plist = (H5P_genplist_t *)H5I_object(f->shared->fcpl_id)))
|
2004-12-29 22:26:20 +08:00
|
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list")
|
2003-07-10 02:00:43 +08:00
|
|
|
|
|
2007-02-28 06:12:29 +08:00
|
|
|
|
/* Retrieve file creation properties */
|
|
|
|
|
if(H5P_get(plist, H5F_CRT_USER_BLOCK_NAME, &userblock_size) < 0)
|
|
|
|
|
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get userblock size")
|
2003-07-10 02:00:43 +08:00
|
|
|
|
|
|
|
|
|
/* debug */
|
|
|
|
|
HDfprintf(stream, "%*sFile Super Block...\n", indent, "");
|
|
|
|
|
|
|
|
|
|
HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
|
[svn-r17939] Description:
Handle external links from symlinked files by adding another check to
look for "child" files for links from the actual location of the "parent" file,
instead of from the location of the symlink.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.6.2 (amazon) in debug mode
Mac OS X/32 10.6.2 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-12-01 21:39:05 +08:00
|
|
|
|
"File name (as opened):", H5F_OPEN_NAME(f));
|
|
|
|
|
HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
|
|
|
|
|
"File name (after resolving symlinks):", H5F_ACTUAL_NAME(f));
|
2003-07-10 02:00:43 +08:00
|
|
|
|
HDfprintf(stream, "%*s%-*s 0x%08x\n", indent, "", fwidth,
|
2007-02-28 06:12:29 +08:00
|
|
|
|
"File access flags", f->shared->flags);
|
2003-07-10 02:00:43 +08:00
|
|
|
|
HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth,
|
2007-02-28 06:12:29 +08:00
|
|
|
|
"File open reference count:", f->shared->nrefs);
|
2003-07-10 02:00:43 +08:00
|
|
|
|
HDfprintf(stream, "%*s%-*s %a (abs)\n", indent, "", fwidth,
|
[svn-r17365] Description:
Final merge of changes from sblock_mdc branch back to trunk. The superblock is now managed by the metadata cache.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-08-15 14:26:08 +08:00
|
|
|
|
"Address of super block:", f->shared->sblock->base_addr);
|
2007-02-28 06:12:29 +08:00
|
|
|
|
HDfprintf(stream, "%*s%-*s %Hu bytes\n", indent, "", fwidth,
|
|
|
|
|
"Size of userblock:", userblock_size);
|
2003-07-10 02:00:43 +08:00
|
|
|
|
|
|
|
|
|
HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth,
|
[svn-r17365] Description:
Final merge of changes from sblock_mdc branch back to trunk. The superblock is now managed by the metadata cache.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-08-15 14:26:08 +08:00
|
|
|
|
"Superblock version number:", f->shared->sblock->super_vers);
|
2007-02-28 06:12:29 +08:00
|
|
|
|
|
|
|
|
|
/* Hard-wired versions */
|
2003-07-10 02:00:43 +08:00
|
|
|
|
HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth,
|
2007-02-28 06:12:29 +08:00
|
|
|
|
"Free list version number:", (unsigned)HDF5_FREESPACE_VERSION);
|
2003-07-10 02:00:43 +08:00
|
|
|
|
HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth,
|
2007-02-28 06:12:29 +08:00
|
|
|
|
"Root group symbol table entry version number:", (unsigned)HDF5_OBJECTDIR_VERSION);
|
2003-07-10 02:00:43 +08:00
|
|
|
|
HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth,
|
2007-02-28 06:12:29 +08:00
|
|
|
|
"Shared header version number:", (unsigned)HDF5_SHAREDHEADER_VERSION);
|
|
|
|
|
|
2003-07-10 02:00:43 +08:00
|
|
|
|
HDfprintf(stream, "%*s%-*s %u bytes\n", indent, "", fwidth,
|
|
|
|
|
"Size of file offsets (haddr_t type):", (unsigned) f->shared->sizeof_addr);
|
|
|
|
|
HDfprintf(stream, "%*s%-*s %u bytes\n", indent, "", fwidth,
|
|
|
|
|
"Size of file lengths (hsize_t type):", (unsigned) f->shared->sizeof_size);
|
|
|
|
|
HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth,
|
[svn-r17365] Description:
Final merge of changes from sblock_mdc branch back to trunk. The superblock is now managed by the metadata cache.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-08-15 14:26:08 +08:00
|
|
|
|
"Symbol table leaf node 1/2 rank:", f->shared->sblock->sym_leaf_k);
|
2003-07-10 02:00:43 +08:00
|
|
|
|
HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth,
|
[svn-r17365] Description:
Final merge of changes from sblock_mdc branch back to trunk. The superblock is now managed by the metadata cache.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-08-15 14:26:08 +08:00
|
|
|
|
"Symbol table internal node 1/2 rank:", f->shared->sblock->btree_k[H5B_SNODE_ID]);
|
2007-03-02 05:26:31 +08:00
|
|
|
|
HDfprintf(stream, "%*s%-*s 0x%02x\n", indent, "", fwidth,
|
[svn-r17365] Description:
Final merge of changes from sblock_mdc branch back to trunk. The superblock is now managed by the metadata cache.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-08-15 14:26:08 +08:00
|
|
|
|
"File status flags:", (unsigned)(f->shared->sblock->status_flags));
|
2003-07-10 02:00:43 +08:00
|
|
|
|
HDfprintf(stream, "%*s%-*s %a (rel)\n", indent, "", fwidth,
|
[svn-r17365] Description:
Final merge of changes from sblock_mdc branch back to trunk. The superblock is now managed by the metadata cache.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-08-15 14:26:08 +08:00
|
|
|
|
"Superblock extension address:", f->shared->sblock->ext_addr);
|
2006-11-14 04:41:36 +08:00
|
|
|
|
HDfprintf(stream, "%*s%-*s %a (rel)\n", indent, "", fwidth,
|
2006-11-18 03:39:14 +08:00
|
|
|
|
"Shared object header message table address:", f->shared->sohm_addr);
|
|
|
|
|
HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth,
|
|
|
|
|
"Shared object header message version number:", (unsigned) f->shared->sohm_vers);
|
|
|
|
|
HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth,
|
|
|
|
|
"Number of shared object header message indexes:", (unsigned) f->shared->sohm_nindexes);
|
2003-07-10 02:00:43 +08:00
|
|
|
|
|
|
|
|
|
HDfprintf(stream, "%*s%-*s %a (rel)\n", indent, "", fwidth,
|
[svn-r17365] Description:
Final merge of changes from sblock_mdc branch back to trunk. The superblock is now managed by the metadata cache.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-08-15 14:26:08 +08:00
|
|
|
|
"Address of driver information block:", f->shared->sblock->driver_addr);
|
2003-07-10 02:00:43 +08:00
|
|
|
|
|
|
|
|
|
HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
|
|
|
|
|
"Root group symbol table entry:",
|
|
|
|
|
f->shared->root_grp ? "" : "(none)");
|
2007-02-28 06:12:29 +08:00
|
|
|
|
if(f->shared->root_grp) {
|
[svn-r17365] Description:
Final merge of changes from sblock_mdc branch back to trunk. The superblock is now managed by the metadata cache.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-08-15 14:26:08 +08:00
|
|
|
|
if(f->shared->sblock->root_ent) /* Use real root group symbol table entry */
|
2012-02-10 10:16:52 +08:00
|
|
|
|
H5G__ent_debug(f->shared->sblock->root_ent, stream, indent + 3, MAX(0, fwidth - 3), NULL);
|
2009-03-24 02:51:29 +08:00
|
|
|
|
else {
|
|
|
|
|
H5O_loc_t *root_oloc; /* Root object location */
|
|
|
|
|
H5G_entry_t root_ent; /* Constructed root symbol table entry */
|
|
|
|
|
|
|
|
|
|
/* Reset the root group entry */
|
2012-02-10 10:16:52 +08:00
|
|
|
|
H5G__ent_reset(&root_ent);
|
2009-03-24 02:51:29 +08:00
|
|
|
|
|
|
|
|
|
/* Build up a simulated root group symbol table entry */
|
|
|
|
|
root_oloc = H5G_oloc(f->shared->root_grp);
|
|
|
|
|
HDassert(root_oloc);
|
|
|
|
|
root_ent.type = H5G_NOTHING_CACHED;
|
|
|
|
|
root_ent.header = root_oloc->addr;
|
|
|
|
|
|
|
|
|
|
/* Display root group symbol table entry info */
|
2012-02-10 10:16:52 +08:00
|
|
|
|
H5G__ent_debug(&root_ent, stream, indent + 3, MAX(0, fwidth - 3), NULL);
|
[svn-r17351] Description:
Clean up code (to align w/future sblock_mdc branch changes), tweak
tests for [slightly] easier debugging, fix memory leak when copying chunked
datasets with I/O filters, fix memory leak of free space section when it was
exactly the right size to use for extending an existing block in the file.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
2009-08-14 01:09:55 +08:00
|
|
|
|
} /* end else */
|
2007-02-28 06:12:29 +08:00
|
|
|
|
} /* end if */
|
2003-07-10 02:00:43 +08:00
|
|
|
|
|
|
|
|
|
done:
|
2004-12-29 22:26:20 +08:00
|
|
|
|
FUNC_LEAVE_NOAPI(ret_value)
|
2007-02-28 06:12:29 +08:00
|
|
|
|
} /* end H5F_debug() */
|
2003-07-10 02:00:43 +08:00
|
|
|
|
|