summaryrefslogtreecommitdiffstats
path: root/tools/misc/h5debug.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2005-03-11 00:44:03 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2005-03-11 00:44:03 (GMT)
commit5b7ebc2ff95e1dea0bd9517e360b7af98dbd0a4d (patch)
tree14e1c52be4efa2294208450fb6fe778cafddf6cd /tools/misc/h5debug.c
parent134d7ed4f0de170ab361a6a88622cead5a49dd84 (diff)
downloadhdf5-5b7ebc2ff95e1dea0bd9517e360b7af98dbd0a4d.zip
hdf5-5b7ebc2ff95e1dea0bd9517e360b7af98dbd0a4d.tar.gz
hdf5-5b7ebc2ff95e1dea0bd9517e360b7af98dbd0a4d.tar.bz2
[svn-r10184] Purpose:
New feature Description: Add new "block tracker" data structure to library, for tracking blocks of bytes in a file. Block trackers will be used to keep track of the blocks belonging to the soon-to-be-implemented "segmented heap" which is designed to replace the current local & global heaps (starting with the local heap). Block trackers will also keep track of the free space in the segmented heap and someday could be used to track the free space in the entire HDF5 file. They are implemented as a small header of information to cache the state of the blocks (max & min sizes of blocks tracked, etc.) and the records of the blocks themselves are stored in a v2 B-tree. Platforms tested: FreeBSD 4.11 (sleipnir) Solaris 2.9 (shanti) h5committest
Diffstat (limited to 'tools/misc/h5debug.c')
-rw-r--r--tools/misc/h5debug.c68
1 files changed, 24 insertions, 44 deletions
diff --git a/tools/misc/h5debug.c b/tools/misc/h5debug.c
index 04e2b22..dca6216 100644
--- a/tools/misc/h5debug.c
+++ b/tools/misc/h5debug.c
@@ -28,10 +28,12 @@
#define H5O_PACKAGE /*suppress error about including H5Opkg */
#define H5B2_PACKAGE /*suppress error about including H5B2pkg */
#define H5B2_TESTING /*suppress warning about H5B2 testing funcs*/
+#define H5BT_PACKAGE /*suppress error about including H5BTpkg */
#include "H5private.h" /* Generic Functions */
#include "H5Bprivate.h"
#include "H5B2pkg.h" /* B-trees */
+#include "H5BTpkg.h" /* Block tracker */
#include "H5Dprivate.h"
#include "H5Fpkg.h"
#include "H5Gprivate.h"
@@ -114,7 +116,7 @@ main(int argc, char *argv[])
* Parse command arguments.
*/
if (argc > 2) {
- printf("New address: %s\n", argv[2]);
+/* printf("New address: %s\n", argv[2]); */
addr = HDstrtoll(argv[2], NULL, 0);
}
if (argc > 3) {
@@ -187,27 +189,19 @@ main(int argc, char *argv[])
*/
H5B2_subid_t subtype = (H5B_subid_t)sig[H5B2_SIZEOF_MAGIC+1];
-#ifdef NOT_YET
- unsigned ndims;
-
switch (subtype) {
- case H5B_SNODE_ID:
- status = H5G_node_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, extra);
+ case H5B2_TEST_ID:
+ status = H5B2_hdr_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, H5B2_TEST);
break;
- case H5B_ISTORE_ID:
- ndims = (unsigned)extra;
- status = H5D_istore_debug (f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, ndims);
+ case H5B2_BLK_TRK_ID:
+ status = H5B2_hdr_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, H5B2_BLKTRK);
break;
default:
fprintf(stderr, "Unknown B-tree subtype %u\n", (unsigned)(subtype));
HDexit(4);
- }
-#else /* NOT_YET */
-fprintf(stderr,"B-tree subtype=%u\n",(unsigned)subtype);
- status = H5B2_hdr_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, H5B2_TEST);
-#endif /* NOT_YET */
+ } /* end switch */
} else if (!HDmemcmp(sig, H5B2_INT_MAGIC, H5B2_SIZEOF_MAGIC)) {
/*
@@ -216,30 +210,20 @@ fprintf(stderr,"B-tree subtype=%u\n",(unsigned)subtype);
* B-tree signature.
*/
H5B2_subid_t subtype = (H5B_subid_t)sig[H5B2_SIZEOF_MAGIC+1];
- unsigned nrecs;
-#ifdef NOT_YET
- unsigned ndims;
-
switch (subtype) {
- case H5B_SNODE_ID:
- status = H5G_node_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, extra);
+ case H5B2_TEST_ID:
+ status = H5B2_int_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, H5B2_TEST, extra, (unsigned)extra2);
break;
- case H5B_ISTORE_ID:
- ndims = (unsigned)extra;
- status = H5D_istore_debug (f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, ndims);
+ case H5B2_BLK_TRK_ID:
+ status = H5B2_int_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, H5B2_BLKTRK, extra, (unsigned)extra2);
break;
default:
fprintf(stderr, "Unknown B-tree subtype %u\n", (unsigned)(subtype));
HDexit(4);
- }
-#else /* NOT_YET */
-fprintf(stderr,"B-tree subtype=%u\n",(unsigned)subtype);
- nrecs = (unsigned)extra2;
- status = H5B2_int_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, H5B2_TEST, extra, nrecs);
-#endif /* NOT_YET */
+ } /* end switch */
} else if (!HDmemcmp(sig, H5B2_LEAF_MAGIC, H5B2_SIZEOF_MAGIC)) {
/*
@@ -248,30 +232,26 @@ fprintf(stderr,"B-tree subtype=%u\n",(unsigned)subtype);
* B-tree signature.
*/
H5B2_subid_t subtype = (H5B_subid_t)sig[H5B2_SIZEOF_MAGIC+1];
- unsigned nrecs;
-#ifdef NOT_YET
- unsigned ndims;
-
switch (subtype) {
- case H5B_SNODE_ID:
- status = H5G_node_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, extra);
+ case H5B2_TEST_ID:
+ status = H5B2_leaf_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, H5B2_TEST, extra, (unsigned)extra2);
break;
- case H5B_ISTORE_ID:
- ndims = (unsigned)extra;
- status = H5D_istore_debug (f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, ndims);
+ case H5B2_BLK_TRK_ID:
+ status = H5B2_leaf_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, H5B2_BLKTRK, extra, (unsigned)extra2);
break;
default:
fprintf(stderr, "Unknown B-tree subtype %u\n", (unsigned)(subtype));
HDexit(4);
- }
-#else /* NOT_YET */
-fprintf(stderr,"B-tree subtype=%u\n",(unsigned)subtype);
- nrecs = (unsigned)extra2;
- status = H5B2_leaf_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, H5B2_TEST, extra, nrecs);
-#endif /* NOT_YET */
+ } /* end switch */
+
+ } else if (!HDmemcmp(sig, H5BT_MAGIC, H5BT_SIZEOF_MAGIC)) {
+ /*
+ * Debug a block tracker info
+ */
+ status = H5BT_hdr_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL);
} else if (sig[0] == H5O_VERSION) {
/*