diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2008-10-14 13:16:25 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2008-10-14 13:16:25 (GMT) |
commit | 22cd1b61cc33d61a705b369f81649b7180ec27a5 (patch) | |
tree | a3146c86c11cd99e13e3855e8157fdbeb62fa3d6 /src/H5MFdbg.c | |
parent | c9d37a8e3f4fe142f6beee0a1117d9904659456d (diff) | |
download | hdf5-22cd1b61cc33d61a705b369f81649b7180ec27a5.zip hdf5-22cd1b61cc33d61a705b369f81649b7180ec27a5.tar.gz hdf5-22cd1b61cc33d61a705b369f81649b7180ec27a5.tar.bz2 |
[svn-r15861] Description:
Various bug fixes & cleanups with VFDs and file free space changes,
along with cleaning up compiler warnings.
Enable more VFDs (for 'make check-vfd' testing) for many tests.
Tested on:
Mac OS X/32 10.5.5 (amazon) in debug mode
Mac OS X/32 10.5.5 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
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
Diffstat (limited to 'src/H5MFdbg.c')
-rw-r--r-- | src/H5MFdbg.c | 71 |
1 files changed, 50 insertions, 21 deletions
diff --git a/src/H5MFdbg.c b/src/H5MFdbg.c index ca83b5a..ca87c83 100644 --- a/src/H5MFdbg.c +++ b/src/H5MFdbg.c @@ -41,6 +41,7 @@ #include "H5Fpkg.h" /* File access */ #include "H5MFpkg.h" /* File memory management */ +#ifdef H5MF_ALLOC_DEBUG_DUMP /****************/ /* Local Macros */ @@ -161,10 +162,14 @@ H5MF_sects_dump(H5F_t *f, hid_t dxpl_id, FILE *stream) haddr_t sda_addr = HADDR_UNDEF; /* Base "small data aggregator" address */ hsize_t sda_size = 0; /* Size of "small data aggregator" */ H5FD_mem_t type; /* Memory type for iteration */ + int indent = 0; /* Amount to indent */ + int fwidth = 50; /* Field width */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5MF_sects_dump, FAIL) +#ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: Dumping file free space sections\n", FUNC); +#endif /* H5MF_ALLOC_DEBUG */ /* * Check arguments. @@ -175,43 +180,67 @@ HDfprintf(stderr, "%s: Dumping file free space sections\n", FUNC); /* Retrieve the 'eoa' for the file */ if(HADDR_UNDEF == (eoa = H5FD_get_eoa(f->shared->lf, H5FD_MEM_DEFAULT))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "driver get_eoa request failed") -HDfprintf(stderr, "%s: eoa = %a\n", FUNC, eoa); +#ifdef H5MF_ALLOC_DEBUG +HDfprintf(stderr, "%s: for type = H5FD_MEM_DEFAULT, eoa = %a\n", FUNC, eoa); +#endif /* H5MF_ALLOC_DEBUG */ /* Retrieve metadata aggregator info, if available */ H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); +#ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: ma_addr = %a, ma_size = %Hu, end of ma = %a\n", FUNC, ma_addr, ma_size, (haddr_t)((ma_addr + ma_size) - 1)); +#endif /* H5MF_ALLOC_DEBUG */ /* Retrieve 'small data' aggregator info, if available */ H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sda_addr, &sda_size); +#ifdef H5MF_ALLOC_DEBUG HDfprintf(stderr, "%s: sda_addr = %a, sda_size = %Hu, end of sda = %a\n", FUNC, sda_addr, sda_size, (haddr_t)((sda_addr + sda_size) - 1)); +#endif /* H5MF_ALLOC_DEBUG */ /* Iterate over all the free space types that have managers and dump each free list's space */ for(type = H5FD_MEM_DEFAULT; type < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, type)) { -#ifdef QAK - /* Check if the free space for the file has been initialized */ - if(!f->shared->fs_man[type]) - if(H5MF_alloc_start(f, dxpl_id, type, FALSE) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't initialize file free space") -#endif /* QAK */ - - /* If there is a free space manager for this type, iterate over them */ - if(f->shared->fs_man[type]) { - H5MF_debug_iter_ud_t udata; /* User data for callbacks */ - - /* Prepare user data for section iteration callback */ - udata.fspace = f->shared->fs_man[type]; - udata.stream = stream; - udata.indent = 0; - udata.fwidth = 3; - - /* Iterate over all the free space sections */ - if(H5FS_sect_iterate(f, dxpl_id, f->shared->fs_man[type], H5MF_sects_debug_cb, &udata) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_BADITER, FAIL, "can't iterate over heap's free space") + /* Print header for type */ + HDfprintf(stream, "%*sFile Free Space Info for type = %u:\n", indent, "", (unsigned)type); + + /* Check for this type being mapped to another type */ + if(H5FD_MEM_DEFAULT == f->shared->fs_type_map[type] || + type == f->shared->fs_type_map[type]) { + /* Retrieve the 'eoa' for this file memory type */ + if(HADDR_UNDEF == (eoa = H5FD_get_eoa(f->shared->lf, type))) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "driver get_eoa request failed") + HDfprintf(stream, "%*s%-*s %a\n", indent + 3, "", MAX(0, fwidth - 3), + "eoa:", + eoa); + + /* Print header for sections */ + HDfprintf(stream, "%*sSections:\n", indent + 3, ""); + + /* If there is a free space manager for this type, iterate over them */ + if(f->shared->fs_man[type]) { + H5MF_debug_iter_ud_t udata; /* User data for callbacks */ + + /* Prepare user data for section iteration callback */ + udata.fspace = f->shared->fs_man[type]; + udata.stream = stream; + udata.indent = indent + 6; + udata.fwidth = MAX(0, fwidth - 6); + + /* Iterate over all the free space sections */ + if(H5FS_sect_iterate(f, dxpl_id, f->shared->fs_man[type], H5MF_sects_debug_cb, &udata) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_BADITER, FAIL, "can't iterate over heap's free space") + } /* end if */ + else { + /* No sections of this type */ + HDfprintf(stream, "%*s<none>\n", indent + 6, ""); + } /* end else */ } /* end if */ + else { + HDfprintf(stream, "%*sMapped to type = %u\n", indent, "", (unsigned)f->shared->fs_type_map[type]); + } /* end else */ } /* end for */ done: HDfprintf(stderr, "%s: Done dumping file free space sections\n", FUNC); FUNC_LEAVE_NOAPI(ret_value) } /* end H5MF_sects_dump() */ +#endif /* H5MF_ALLOC_DEBUG_DUMP */ |