Add support for discard requests to blktrace userspace tools. Signed-off-by: David Woodhouse <David.Woodhouse@xxxxxxxxx> diff --git a/act_mask.c b/act_mask.c index 40a4050..6632320 100644 --- a/act_mask.c +++ b/act_mask.c @@ -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(DISCARD), }; int find_mask_map(char *string) diff --git a/blkparse_fmt.c b/blkparse_fmt.c index 364f27c..83a8504 100644 --- a/blkparse_fmt.c +++ b/blkparse_fmt.c @@ -57,9 +57,12 @@ static inline void fill_rwbs(char *rwbs, struct blk_io_trace *t) int b = t->action & BLK_TC_ACT(BLK_TC_BARRIER); int s = t->action & BLK_TC_ACT(BLK_TC_SYNC); int m = t->action & BLK_TC_ACT(BLK_TC_META); + int d = t->action & BLK_TC_ACT(BLK_TC_DISCARD); int i = 0; - if (w) + if (d) + rwbs[i++] = 'D'; + else if (w) rwbs[i++] = 'W'; else if (t->bytes) rwbs[i++] = 'R'; diff --git a/blkrawverify.c b/blkrawverify.c index 82a435e..984dbff 100644 --- a/blkrawverify.c +++ b/blkrawverify.c @@ -49,6 +49,7 @@ static struct trace_info traces[] = { TRACE_TO_STRING( BLK_TC_PC ), TRACE_TO_STRING( BLK_TC_AHEAD ), TRACE_TO_STRING( BLK_TC_META ), + TRACE_TO_STRING( BLK_TC_DISCARD ), }; #define N_TRACES (sizeof(traces) / sizeof(struct trace_info)) diff --git a/blktrace_api.h b/blktrace_api.h index 67720de..992850c 100644 --- a/blktrace_api.h +++ b/blktrace_api.h @@ -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_DISCARD = 1 << 13, /* discard requests */ BLK_TC_END = 1 << 15, /* only 16-bits, reminder */ }; -- David Woodhouse Open Source Technology Centre David.Woodhouse@xxxxxxxxx Intel Corporation -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html