[RFC,blktrace-tools,08/10] blkiomon: add extension support
diff mbox series

Message ID 20190501043317.5507-9-chaitanya.kulkarni@wdc.com
State New
Headers show
Series
  • blktrace: add blktrace extension support
Related show

Commit Message

Chaitanya Kulkarni May 1, 2019, 4:33 a.m. UTC
Update blkiomon to support the blktrace extension.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
---
 blkiomon.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

Patch
diff mbox series

diff --git a/blkiomon.c b/blkiomon.c
index f8b0c9d..67ef4ac 100644
--- a/blkiomon.c
+++ b/blkiomon.c
@@ -36,6 +36,10 @@ 
 #include <pthread.h>
 #include <time.h>
 
+#ifdef CONFIG_BLKTRACE_EXT
+#include <inttypes.h>
+#endif /* CONFIG_BLKTRACE_EXT */
+
 #include "blktrace.h"
 #include "rbtree.h"
 #include "jhash.h"
@@ -116,7 +120,11 @@  static void dump_bit(struct trace *t, const char *descr)
 	fprintf(debug.fp, "time     %16ld\n", (unsigned long)bit->time);
 	fprintf(debug.fp, "sector   %16ld\n", (unsigned long)bit->sector);
 	fprintf(debug.fp, "bytes    %16d\n", bit->bytes);
+#ifdef CONFIG_BLKTRACE_EXT
+	fprintf(debug.fp, "action   %"PRIx64"\n", (unsigned long)bit->action);
+#else
 	fprintf(debug.fp, "action   %16x\n", bit->action);
+#endif /* CONFIG_BLKTRACE_EXT */
 	fprintf(debug.fp, "pid      %16d\n", bit->pid);
 	fprintf(debug.fp, "device   %16d\n", bit->device);
 	fprintf(debug.fp, "cpu      %16d\n", bit->cpu);
@@ -142,8 +150,16 @@  static void dump_bits(struct trace *t1, struct trace *t2, const char *descr)
 		(unsigned long)bit1->time, (unsigned long)bit2->time);
 	fprintf(debug.fp, "sector   %16ld %16ld\n",
 		(unsigned long)bit1->sector, (unsigned long)bit2->sector);
+
+#ifdef CONFIG_BLKTRACE_EXT
 	fprintf(debug.fp, "bytes    %16d %16d\n", bit1->bytes, bit2->bytes);
+	fprintf(debug.fp, "action   %"PRIx64" %"PRIx64"\n",
+			(unsigned long) bit1->action,
+			(unsigned long) bit2->action);
+#else
 	fprintf(debug.fp, "action   %16x %16x\n", bit1->action, bit2->action);
+#endif /* CONFIG_BLKTRACE_EXT */
+
 	fprintf(debug.fp, "pid      %16d %16d\n", bit1->pid, bit2->pid);
 	fprintf(debug.fp, "device   %16d %16d\n", bit1->device, bit2->device);
 	fprintf(debug.fp, "cpu      %16d %16d\n", bit1->cpu, bit2->cpu);