sbin/hammer - Hex data dump for misc & data records
authorAntonio Huete Jimenez <tuxillo@quantumachine.net>
Mon, 2 Mar 2015 15:46:30 +0000 (16:46 +0100)
committerAntonio Huete Jimenez <tuxillo@quantumachine.net>
Mon, 2 Mar 2015 15:46:30 +0000 (16:46 +0100)
- Under request of very verbose output, provide an hex
  dump for data, db and ext records.
- This is very useful for debugging.

sbin/hammer/cmd_show.c

index 04f2186..e2fda8e 100644 (file)
@@ -33,6 +33,7 @@
  */
 
 #include "hammer.h"
+#include <libutil.h>
 
 #define FLAG_TOOFARLEFT                0x0001
 #define FLAG_TOOFARRIGHT       0x0002
@@ -577,6 +578,13 @@ print_record(hammer_btree_elm_t elm)
                        print_config(data->config.text);
                }
                break;
+       case HAMMER_RECTYPE_DATA:
+       case HAMMER_RECTYPE_EXT:
+       case HAMMER_RECTYPE_DB:
+               if (VerboseOpt > 2)
+                       printf("\n");
+                       hexdump(data, data_len, "\t\t  ", 0);
+               break;
        default:
                break;
        }