From: Yoshihiro YUNOMAE <yoshihiro.yunomae.ez@hitachi.com>
To: Steven Rostedt <rostedt@goodmis.org>, David Sharp <dhsharp@google.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>,
Ingo Molnar <mingo@redhat.com>,
Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
Vaibhav Nagarnaik <vnagarnaik@google.com>,
linux-kernel@vger.kernel.org, yrl.pp-manager.tt@hitachi.com,
Yoshihiro YUNOMAE <yoshihiro.yunomae.ez@hitachi.com>,
Steven Rostedt <rostedt@goodmis.org>,
Frederic Weisbecker <fweisbec@gmail.com>,
Ingo Molnar <mingo@redhat.com>
Subject: [PATCH 2/2] ftrace: Show raw time stamp on stats per cpu using counter or tsc mode for trace_clock
Date: Tue, 09 Oct 2012 11:08:43 +0900 [thread overview]
Message-ID: <20121009020843.12110.63163.stgit@localhost.localdomain> (raw)
In-Reply-To: <20121009020838.12110.90016.stgit@localhost.localdomain>
Show raw time stamp values for stats per cpu if you choose counter or tsc mode
for trace_clock. Although a unit of tracing time stamp is nsec in local or global mode,
the units in counter and TSC mode are tracing counter and cycles respectively.
Signed-off-by: Yoshihiro YUNOMAE <yoshihiro.yunomae.ez@hitachi.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>
---
kernel/trace/trace.c | 23 +++++++++++++++++------
1 files changed, 17 insertions(+), 6 deletions(-)
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 3068374..83e5c6a 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -4396,13 +4396,24 @@ tracing_stats_read(struct file *filp, char __user *ubuf,
cnt = ring_buffer_bytes_cpu(tr->buffer, cpu);
trace_seq_printf(s, "bytes: %ld\n", cnt);
- t = ns2usecs(ring_buffer_oldest_event_ts(tr->buffer, cpu));
- usec_rem = do_div(t, USEC_PER_SEC);
- trace_seq_printf(s, "oldest event ts: %5llu.%06lu\n", t, usec_rem);
+ if (trace_clocks[trace_clock_id].in_ns) {
+ /* local or global for trace_clock */
+ t = ns2usecs(ring_buffer_oldest_event_ts(tr->buffer, cpu));
+ usec_rem = do_div(t, USEC_PER_SEC);
+ trace_seq_printf(s, "oldest event ts: %5llu.%06lu\n",
+ t, usec_rem);
+
+ t = ns2usecs(ring_buffer_time_stamp(tr->buffer, cpu));
+ usec_rem = do_div(t, USEC_PER_SEC);
+ trace_seq_printf(s, "now ts: %5llu.%06lu\n", t, usec_rem);
+ } else {
+ /* counter or tsc mode for trace_clock */
+ trace_seq_printf(s, "oldest event ts: %llu\n",
+ ring_buffer_oldest_event_ts(tr->buffer, cpu));
- t = ns2usecs(ring_buffer_time_stamp(tr->buffer, cpu));
- usec_rem = do_div(t, USEC_PER_SEC);
- trace_seq_printf(s, "now ts: %5llu.%06lu\n", t, usec_rem);
+ trace_seq_printf(s, "now ts: %llu\n",
+ ring_buffer_time_stamp(tr->buffer, cpu));
+ }
count = simple_read_from_buffer(ubuf, count, ppos, s->buffer, s->len);
prev parent reply other threads:[~2012-10-09 2:08 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-02 3:31 [PATCH v5 1/3] tracing,x86: Add a TSC trace_clock David Sharp
2012-10-02 3:31 ` [PATCH v5 2/3] tracing: Reset ring buffer when changing trace_clocks David Sharp
2012-10-02 3:31 ` [PATCH v5 3/3] tracing: Format non-nanosec times from tsc clock without a decimal point David Sharp
2012-10-11 20:43 ` Steven Rostedt
2012-10-11 22:58 ` David Sharp
2012-10-09 2:08 ` [PATCH v5 1/3] tracing,x86: Add a TSC trace_clock Yoshihiro YUNOMAE
2012-10-11 23:30 ` David Sharp
2012-10-09 2:08 ` [PATCH 0/2] ftrace: [BUGFIX] type of ring_buffer_oldest_event_ts() and showing of stats per cpu directory Yoshihiro YUNOMAE
2012-10-09 2:08 ` [PATCH 1/2] ftrace: Change unsigned long type of ring_buffer_oldest_event_ts() to u64 Yoshihiro YUNOMAE
2012-10-09 2:08 ` Yoshihiro YUNOMAE [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20121009020843.12110.63163.stgit@localhost.localdomain \
--to=yoshihiro.yunomae.ez@hitachi.com \
--cc=dhsharp@google.com \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=masami.hiramatsu.pt@hitachi.com \
--cc=mingo@redhat.com \
--cc=rostedt@goodmis.org \
--cc=vnagarnaik@google.com \
--cc=yrl.pp-manager.tt@hitachi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®