summaryrefslogtreecommitdiffstats
path: root/src/H5Cdbg.c
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2016-11-28 01:50:13 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2016-11-28 01:50:13 (GMT)
commit1a0de8ebd8f82f41b0fa0cb3d172c85a3a24bc3a (patch)
tree9975017f67fb0494b0ba607f54f61cedeab4f883 /src/H5Cdbg.c
parent61e0a035bcc96b4fa38e443332bcbb6041e56b5d (diff)
downloadhdf5-1a0de8ebd8f82f41b0fa0cb3d172c85a3a24bc3a.zip
hdf5-1a0de8ebd8f82f41b0fa0cb3d172c85a3a24bc3a.tar.gz
hdf5-1a0de8ebd8f82f41b0fa0cb3d172c85a3a24bc3a.tar.bz2
Updated the format of H5AC/C_dump_cache() to include
more information and be easier to read.
Diffstat (limited to 'src/H5Cdbg.c')
-rw-r--r--src/H5Cdbg.c73
1 files changed, 61 insertions, 12 deletions
diff --git a/src/H5Cdbg.c b/src/H5Cdbg.c
index 3961aa4..10c1384 100644
--- a/src/H5Cdbg.c
+++ b/src/H5Cdbg.c
@@ -72,6 +72,40 @@ herr_t H5C_dump_cache_skip_list(H5C_t *cache_ptr, char *calling_fcn);
/* Local Variables */
/*******************/
+/* Constant names for the dump cache function.
+ * Needs to be kept in sync with the H5AC_type_t enum in H5ACprivate.h!
+ */
+static const char *type_names_g[] = {
+ "(H5AC_BT_ID)", /* 0 */
+ "(H5AC_SNODE_ID)", /* 1 */
+ "(H5AC_LHEAP_PRFX_ID)", /* 2 */
+ "(H5AC_LHEAP_DBLK_ID)", /* 3 */
+ "(H5AC_GHEAP_ID)", /* 4 */
+ "(H5AC_OHDR_ID)", /* 5 */
+ "(H5AC_OHDR_CHK_ID)", /* 6 */
+ "(H5AC_BT2_HDR_ID)", /* 7 */
+ "(H5AC_BT2_INT_ID)", /* 8 */
+ "(H5AC_BT2_LEAF_ID)", /* 9 */
+ "(H5AC_FHEAP_HDR_ID)", /* 10 */
+ "(H5AC_FHEAP_DBLOCK_ID)", /* 11 */
+ "(H5AC_FHEAP_IBLOCK_ID)", /* 12 */
+ "(H5AC_FSPACE_HDR_ID)", /* 13 */
+ "(H5AC_FSPACE_SINFO_ID)", /* 14 */
+ "(H5AC_SOHM_TABLE_ID)", /* 15 */
+ "(H5AC_SOHM_LIST_ID)", /* 16 */
+ "(H5AC_EARRAY_HDR_ID)", /* 17 */
+ "(H5AC_EARRAY_IBLOCK_ID)", /* 18 */
+ "(H5AC_EARRAY_SBLOCK_ID)", /* 19 */
+ "(H5AC_EARRAY_DBLOCK_ID)", /* 20 */
+ "(H5AC_EARRAY_DBLK_PAGE_ID)", /* 21 */
+ "(H5AC_FARRAY_HDR_ID)", /* 22 */
+ "(H5AC_FARRAY_DBLOCK_ID)", /* 23 */
+ "(H5AC_FARRAY_DBLK_PAGE_ID)", /* 24 */
+ "(H5AC_SUPERBLOCK_ID)", /* 25 */
+ "(H5AC_DRVRINFO_ID)", /* 26 */
+ "(H5AC_TEST_ID (BADNESS!))", /* 27 */
+ "(H5AC_NTYPES (BADNESS!))" /* 28 */
+};
/*-------------------------------------------------------------------------
@@ -126,24 +160,39 @@ H5C_dump_cache(H5C_t * cache_ptr, const char * cache_name)
* skip list -- scan the skip list generating the desired output.
*/
- HDfprintf(stdout, "\n\nDump of metadata cache \"%s\".\n", cache_name);
- HDfprintf(stdout,
- "Num: Addr: Len: Type: Prot: Pinned: Dirty:\n");
+ HDfprintf(stdout, "\n\nDump of metadata cache \"%s\"\n", cache_name);
+
+ /* Print header */
+ HDfprintf(stdout, "Entry ");
+ HDfprintf(stdout, "| Address ");
+ HDfprintf(stdout, "| Tag ");
+ HDfprintf(stdout, "| Len ");
+ HDfprintf(stdout, "| Ring ");
+ HDfprintf(stdout, "| Type ");
+ HDfprintf(stdout, "| Prot/Pin/Dirty");
+ HDfprintf(stdout, "\n");
+
+ HDfprintf(stdout, "----------------------------------------------------------------------------------------------------------\n");
i = 0;
entry_ptr = (H5C_cache_entry_t *)H5SL_remove_first(slist_ptr);
while(entry_ptr != NULL) {
HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC);
- HDfprintf(stdout,
- "%s%d 0x%16llx 0x%3llx %2d %d %d %d\n",
- cache_ptr->prefix, i,
- (long long)(entry_ptr->addr),
- (long long)(entry_ptr->size),
- (int)(entry_ptr->type->id),
- (int)(entry_ptr->is_protected),
- (int)(entry_ptr->is_pinned),
- (int)(entry_ptr->is_dirty));
+ /* Print entry */
+ HDfprintf(stdout, "%s%5d ", cache_ptr->prefix, i);
+ HDfprintf(stdout, " 0x%16llx ", (long long)(entry_ptr->addr));
+ if(NULL == entry_ptr->tag_info)
+ HDfprintf(stdout, " %16s ", "N/A");
+ else
+ HDfprintf(stdout, " 0x%16llx ", (long long)(entry_ptr->tag_info->tag));
+ HDfprintf(stdout, " %5lld ", (long long)(entry_ptr->size));
+ HDfprintf(stdout, " %d ", (int)(entry_ptr->ring));
+ HDfprintf(stdout, " %2d %-26s ", (int)(entry_ptr->type->id), type_names_g[(int)(entry_ptr->type->id)]);
+ HDfprintf(stdout, " %d", (int)(entry_ptr->is_protected));
+ HDfprintf(stdout, " %d", (int)(entry_ptr->is_pinned));
+ HDfprintf(stdout, " %d", (int)(entry_ptr->is_dirty));
+ HDfprintf(stdout, "\n");
/* remove the next (first) item in the skip list */
entry_ptr = (H5C_cache_entry_t *)H5SL_remove_first(slist_ptr);