Commit 65796348 authored by Li Zefan's avatar Li Zefan Committed by Ingo Molnar

blktrace: fix wrong calculation of RWBS

Impact: fix the output of IO type category characters

Trace categories are the upper 16 bits, not the lower 16 bits.
Signed-off-by: default avatarLi Zefan <lizf@cn.fujitsu.com>
Acked-by: default avatarJens Axboe <jens.axboe@oracle.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
LKML-Reference: <49C89432.8010805@cn.fujitsu.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent e4955c99
......@@ -922,23 +922,24 @@ static void blk_unregister_tracepoints(void)
static void fill_rwbs(char *rwbs, const struct blk_io_trace *t)
{
int i = 0;
int tc = t->action >> BLK_TC_SHIFT;
if (t->action & BLK_TC_DISCARD)
if (tc & BLK_TC_DISCARD)
rwbs[i++] = 'D';
else if (t->action & BLK_TC_WRITE)
else if (tc & BLK_TC_WRITE)
rwbs[i++] = 'W';
else if (t->bytes)
rwbs[i++] = 'R';
else
rwbs[i++] = 'N';
if (t->action & BLK_TC_AHEAD)
if (tc & BLK_TC_AHEAD)
rwbs[i++] = 'A';
if (t->action & BLK_TC_BARRIER)
if (tc & BLK_TC_BARRIER)
rwbs[i++] = 'B';
if (t->action & BLK_TC_SYNC)
if (tc & BLK_TC_SYNC)
rwbs[i++] = 'S';
if (t->action & BLK_TC_META)
if (tc & BLK_TC_META)
rwbs[i++] = 'M';
rwbs[i] = '\0';
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment