On Fri, 2008-08-15 at 10:43 +0200, Jens Axboe wrote: > On Sun, Aug 10 2008, David Woodhouse wrote: > > Add support for discard requests to blktrace userspace tools. > > Please remember to document the 'D' value for data direction, there's > plenty of documentation in blktrace/parse. Otherwise people have no idea > what it means. Added to the documentation of the RWBS field in blktrace.tex and blkparse.1. 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 */ }; diff --git a/doc/blkparse.1 b/doc/blkparse.1 index 825ca36..e97581c 100644 --- a/doc/blkparse.1 +++ b/doc/blkparse.1 @@ -391,9 +391,9 @@ Split .SH "RWBS DESCRIPTION" -This is a small string containing at least one character ('R' for read, 'W' for -write operation), and optionally either a 'B' (for barrier operations) or 'S' (for -synchronous operations). +This is a small string containing at least one character ('R' for read, 'W' +for write, or 'D' for block discard operation), and optionally either +a 'B' (for barrier operations) or 'S' (for synchronous operations). .SH "DEFAULT OUTPUT" diff --git a/doc/blktrace.tex b/doc/blktrace.tex index 82c35e8..1e69240 100644 --- a/doc/blktrace.tex +++ b/doc/blktrace.tex @@ -645,8 +645,8 @@ X & Split \\ \hline \subsubsection{\label{sec:act-table}RWBS Description} This is a small string containing at least one character ('R' for read, -'W' for write operation), and optionally either a 'B' (for barrier -operations) or 'S' (for synchronous operations). +'W' for write, or 'D' for block discard operation), and optionally either +a 'B' (for barrier operations) or 'S' (for synchronous operations). \subsubsection{\label{sec:default-output}Default output} -- 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