summaryrefslogtreecommitdiff
path: root/usr/src/common/ctf/ctf_hash.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/common/ctf/ctf_hash.c')
-rw-r--r--usr/src/common/ctf/ctf_hash.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/usr/src/common/ctf/ctf_hash.c b/usr/src/common/ctf/ctf_hash.c
index 0c5a71a5ac..f97115a791 100644
--- a/usr/src/common/ctf/ctf_hash.c
+++ b/usr/src/common/ctf/ctf_hash.c
@@ -23,6 +23,8 @@
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ *
+ * Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
*/
#include <ctf_impl.h>
@@ -175,3 +177,25 @@ ctf_hash_destroy(ctf_hash_t *hp)
hp->h_chains = NULL;
}
}
+
+void
+ctf_hash_dump(const char *tag, ctf_hash_t *hp, ctf_file_t *fp)
+{
+ ctf_dprintf("---------------\nHash dump - %s\n", tag);
+
+ for (ushort_t h = 0; h < hp->h_nbuckets; h++) {
+ ctf_helem_t *hep;
+
+ for (ushort_t i = hp->h_buckets[h]; i != 0; i = hep->h_next) {
+ ctf_strs_t *ctsp;
+ const char *str;
+
+ hep = &hp->h_chains[i];
+ ctsp = &fp->ctf_str[CTF_NAME_STID(hep->h_name)];
+ str = ctsp->cts_strs + CTF_NAME_OFFSET(hep->h_name);
+
+ ctf_dprintf(" - %3u/%3u - '%s' type %u\n", h, i, str,
+ hep->h_type);
+ }
+ }
+}