Skip to contentSkip to conversation

driver data: add support to blktrace user space code

PATCH In review Martin Peschke 3 participants 5 messages Jul 16, 2008 – Oct 16, 2008 s390

lore
Share & tools
lore
#0 lore raw

PATCH 3/3 driver data: add support to blktrace user space code

Adds a new type of action 'drv_data' for blktrace to handle binary driver-specific data. Since the data is binary, blkparse will only put it in a binary file, not in the regular human-readable output.

---
 act_mask.c     |    1 +
 blkparse.c     |    3 +++
 blktrace_api.h |    5 ++++-
 3 files changed, 8 insertions(+), 1 deletion(-)
act_mask.c +1 -0
@@ -25,6 +25,7 @@ static struct mask_map mask_maps[] = {
 	DECLARE_MASK_MAP(PC),
 	DECLARE_MASK_MAP(AHEAD),
 	DECLARE_MASK_MAP(META),
+	DECLARE_MASK_MAP(DRV_DATA),
 };
 
 int find_mask_map(char *string)
blktrace_api.h +4 -1
@@ -7,7 +7,7 @@
  * Trace categories
  */
 enum {
-	BLK_TC_READ	= 1 << 0,	/* reads */
+	BLK_TC_READ 	= 1 << 0,	/* reads */
 	BLK_TC_WRITE	= 1 << 1,	/* writes */
 	BLK_TC_BARRIER	= 1 << 2,	/* barrier */
 	BLK_TC_SYNC	= 1 << 3,	/* sync */
@@ -20,6 +20,7 @@ enum {
 	BLK_TC_NOTIFY	= 1 << 10,	/* special message */
 	BLK_TC_AHEAD	= 1 << 11,	/* readahead */
 	BLK_TC_META	= 1 << 12,	/* metadata */
+	BLK_TC_DRV_DATA	= 1 << 13,	/* binary driver data */
 
 	BLK_TC_END	= 1 << 15,	/* only 16-bits, reminder */
 };
@@ -46,6 +47,7 @@ enum {
 	__BLK_TA_SPLIT,			/* bio was split */
 	__BLK_TA_BOUNCE,		/* bio was bounced */
 	__BLK_TA_REMAP,			/* bio was remapped */
+	__BLK_TA_DRV_DATA,		/* binary driver data */
 };
 
 /*
@@ -75,6 +77,7 @@ enum blktrace_notify {
 #define BLK_TA_SPLIT		(__BLK_TA_SPLIT)
 #define BLK_TA_BOUNCE		(__BLK_TA_BOUNCE)
 #define BLK_TA_REMAP		(__BLK_TA_REMAP | BLK_TC_ACT(BLK_TC_QUEUE))
+#define BLK_TA_DRV_DATA	(__BLK_TA_DRV_DATA | BLK_TC_ACT(BLK_TC_DRV_DATA))
 
 #define BLK_TN_PROCESS		(__BLK_TN_PROCESS | BLK_TC_ACT(BLK_TC_NOTIFY))
 #define BLK_TN_TIMESTAMP	(__BLK_TN_TIMESTAMP | BLK_TC_ACT(BLK_TC_NOTIFY))
blkparse.c +3 -0
@@ -1583,6 +1583,9 @@ static void dump_trace_fs(struct blk_io_
 		case __BLK_TA_REMAP:
 			log_generic(pci, t, "A");
 			break;
+		case __BLK_TA_DRV_DATA:
+			// dump to binary file only
+			break;
 		default:
 			fprintf(stderr, "Bad fs action %x\n", t->action);
 			break;
#1 lore raw

PATCH 3/3 driver data: add support to blktrace user space code

From: Stefan Raspl <[email protected]>

Adds a new type of action 'drv_data' for blktrace to handle binary driver-specific data. Since the data is binary, blkparse will only put it in a binary file, not in the regular human-readable output.

---
 act_mask.c     |    1 +
 blkparse.c     |    3 +++
 blktrace_api.h |    3 +++
 3 files changed, 7 insertions(+)
act_mask.c +1 -0
@@ -25,6 +25,7 @@ static struct mask_map mask_maps[] = {
 	DECLARE_MASK_MAP(PC),
 	DECLARE_MASK_MAP(AHEAD),
 	DECLARE_MASK_MAP(META),
+	DECLARE_MASK_MAP(DRV_DATA),
 };
 
 int find_mask_map(char *string)
blktrace_api.h +3 -0
@@ -20,6 +20,7 @@ enum {
 	BLK_TC_NOTIFY	= 1 << 10,	/* special message */
 	BLK_TC_AHEAD	= 1 << 11,	/* readahead */
 	BLK_TC_META	= 1 << 12,	/* metadata */
+	BLK_TC_DRV_DATA	= 1 << 13,	/* binary driver data */
 
 	BLK_TC_END	= 1 << 15,	/* only 16-bits, reminder */
 };
@@ -46,6 +47,7 @@ enum {
 	__BLK_TA_SPLIT,			/* bio was split */
 	__BLK_TA_BOUNCE,		/* bio was bounced */
 	__BLK_TA_REMAP,			/* bio was remapped */
+	__BLK_TA_DRV_DATA,		/* binary driver data */
 };
 
 /*
@@ -75,6 +77,7 @@ enum blktrace_notify {
 #define BLK_TA_SPLIT		(__BLK_TA_SPLIT)
 #define BLK_TA_BOUNCE		(__BLK_TA_BOUNCE)
 #define BLK_TA_REMAP		(__BLK_TA_REMAP | BLK_TC_ACT(BLK_TC_QUEUE))
+#define BLK_TA_DRV_DATA	(__BLK_TA_DRV_DATA | BLK_TC_ACT(BLK_TC_DRV_DATA))
 
 #define BLK_TN_PROCESS		(__BLK_TN_PROCESS | BLK_TC_ACT(BLK_TC_NOTIFY))
 #define BLK_TN_TIMESTAMP	(__BLK_TN_TIMESTAMP | BLK_TC_ACT(BLK_TC_NOTIFY))
blkparse.c +3 -0
@@ -1583,6 +1583,9 @@ static void dump_trace_fs(struct blk_io_
 		case __BLK_TA_REMAP:
 			log_generic(pci, t, "A");
 			break;
+		case __BLK_TA_DRV_DATA:
+			/* dump to binary file only */
+			break;
 		default:
 			fprintf(stderr, "Bad fs action %x\n", t->action);
 			break;
#2 lore raw
In reply to Martin Peschke
Quoted 5 lines · Martin Peschke

From: Stefan Raspl <[email protected]>

Adds a new type of action 'drv_data' for blktrace to handle binary driver-specific data. Since the data is binary, blkparse will only put it in a binary file, not in the regular human-readable output.

I wonder if that should display some kind of informational message on blkparse exit, if you are not dumping binary? Just to notify the user that there was extra data available, but that it wasn't dumped.

Otherwise looks fine, I've applied 1-3.

Signature · 1 line
Jens Axboe
#3 lore raw

Re: [Patch 3/3] driver data: add support to blktrace user space

In reply to Martin Peschke
Quoted 10 lines · Jens Axboe
Quoted 5 lines · Martin Peschke

From: Stefan Raspl <[email protected]>

Adds a new type of action 'drv_data' for blktrace to handle binary driver-specific data. Since the data is binary, blkparse will only put it in a binary file, not in the regular human-readable output.

I wonder if that should display some kind of informational message on blkparse exit, if you are not dumping binary? Just to notify the user that there was extra data available, but that it wasn't dumped.

Don't know.

But I can volunteer to send a patch if you think so.

Quoted 1 line

Otherwise looks fine, I've applied 1-3.

Great.

#4 lore raw
Quoted 9 lines · Martin Peschke
Quoted 7 lines · Jens Axboe
Quoted 5 lines · Martin Peschke

From: Stefan Raspl <[email protected]>

Adds a new type of action 'drv_data' for blktrace to handle binary driver-specific data. Since the data is binary, blkparse will only put it in a binary file, not in the regular human-readable output.

Quoted 7 lines
Quoted 3 lines

I wonder if that should display some kind of informational message on blkparse exit, if you are not dumping binary? Just to notify the user that there was extra data available, but that it wasn't dumped.

Don't know.

But I can volunteer to send a patch if you think so.

I think it would be beneficial, so if you could that would be great ;)

Signature · 1 line
Jens Axboe