Commit 35ac51bf authored by Li Zefan's avatar Li Zefan Committed by Ingo Molnar

blktrace: make classic output more classic

Impact: fix ftrace plugin timestamp output

In the classic user-space blktrace, the output timestamp is sec.nsec
not sec.usec.
Signed-off-by: default avatarLi Zefan <lizf@cn.fujitsu.com>
Acked-by: default avatarJens Axboe <jens.axboe@oracle.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent eb08f8eb
...@@ -994,8 +994,8 @@ static void get_pdu_remap(const struct trace_entry *ent, ...@@ -994,8 +994,8 @@ static void get_pdu_remap(const struct trace_entry *ent,
static int blk_log_action_iter(struct trace_iterator *iter, const char *act) static int blk_log_action_iter(struct trace_iterator *iter, const char *act)
{ {
char rwbs[6]; char rwbs[6];
unsigned long long ts = ns2usecs(iter->ts); unsigned long long ts = iter->ts;
unsigned long usec_rem = do_div(ts, USEC_PER_SEC); unsigned long nsec_rem = do_div(ts, NSEC_PER_SEC);
unsigned secs = (unsigned long)ts; unsigned secs = (unsigned long)ts;
const struct trace_entry *ent = iter->ent; const struct trace_entry *ent = iter->ent;
const struct blk_io_trace *t = (const struct blk_io_trace *)ent; const struct blk_io_trace *t = (const struct blk_io_trace *)ent;
...@@ -1003,9 +1003,9 @@ static int blk_log_action_iter(struct trace_iterator *iter, const char *act) ...@@ -1003,9 +1003,9 @@ static int blk_log_action_iter(struct trace_iterator *iter, const char *act)
fill_rwbs(rwbs, t); fill_rwbs(rwbs, t);
return trace_seq_printf(&iter->seq, return trace_seq_printf(&iter->seq,
"%3d,%-3d %2d %5d.%06lu %5u %2s %3s ", "%3d,%-3d %2d %5d.%09lu %5u %2s %3s ",
MAJOR(t->device), MINOR(t->device), iter->cpu, MAJOR(t->device), MINOR(t->device), iter->cpu,
secs, usec_rem, ent->pid, act, rwbs); secs, nsec_rem, ent->pid, act, rwbs);
} }
static int blk_log_action_seq(struct trace_seq *s, const struct blk_io_trace *t, static int blk_log_action_seq(struct trace_seq *s, const struct blk_io_trace *t,
......
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