Skip to content

Commit

Permalink
blktrace: make classic output more classic
Browse files Browse the repository at this point in the history
Impact: fix ftrace plugin timestamp output

In the classic user-space blktrace, the output timestamp is sec.nsec
not sec.usec.

Signed-off-by: Li Zefan <[email protected]>
Acked-by: Jens Axboe <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Steven Rostedt <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
  • Loading branch information
Li Zefan authored and Ingo Molnar committed Mar 31, 2009
1 parent eb08f8e commit 35ac51b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions kernel/trace/blktrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -994,18 +994,18 @@ static void get_pdu_remap(const struct trace_entry *ent,
static int blk_log_action_iter(struct trace_iterator *iter, const char *act)
{
char rwbs[6];
unsigned long long ts = ns2usecs(iter->ts);
unsigned long usec_rem = do_div(ts, USEC_PER_SEC);
unsigned long long ts = iter->ts;
unsigned long nsec_rem = do_div(ts, NSEC_PER_SEC);
unsigned secs = (unsigned long)ts;
const struct trace_entry *ent = iter->ent;
const struct blk_io_trace *t = (const struct blk_io_trace *)ent;

fill_rwbs(rwbs, t);

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,
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,
Expand Down

0 comments on commit 35ac51b

Please sign in to comment.