From: tip-bot for Yoshihiro YUNOMAE <yoshihiro.yunomae.ez@hitachi.com>
To: linux-tip-commits@vger.kernel.org
Cc: mingo@redhat.com, linux-kernel@vger.kernel.org, hpa@zytor.com,
mingo@kernel.org, fweisbec@gmail.com,
yoshihiro.yunomae.ez@hitachi.com, rostedt@goodmis.org,
dhsharp@google.com, tglx@linutronix.de
Subject: [tip:perf/core] tracing: Show raw time stamp on stats per cpu using counter or tsc mode for trace_clock
Date: Sun, 9 Dec 2012 03:27:37 -0800 [thread overview]
Message-ID: <tip-11043d8b125671a32253cddb0b05177be0e976f6@git.kernel.org> (raw)
In-Reply-To: <1352837903-32191-3-git-send-email-dhsharp@google.com>
Commit-ID: 11043d8b125671a32253cddb0b05177be0e976f6
Gitweb: http://git.kernel.org/tip/11043d8b125671a32253cddb0b05177be0e976f6
Author: Yoshihiro YUNOMAE <yoshihiro.yunomae.ez@hitachi.com>
AuthorDate: Tue, 13 Nov 2012 12:18:23 -0800
Committer: Steven Rostedt <rostedt@goodmis.org>
CommitDate: Tue, 13 Nov 2012 15:49:11 -0500
tracing: Show raw time stamp on stats per cpu using counter or tsc mode for trace_clock
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.
Link: http://lkml.kernel.org/r/1352837903-32191-3-git-send-email-dhsharp@google.com
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>
Signed-off-by: Yoshihiro YUNOMAE <yoshihiro.yunomae.ez@hitachi.com>
Signed-off-by: David Sharp <dhsharp@google.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
kernel/trace/trace.c | 23 +++++++++++++++++------
1 file changed, 17 insertions(+), 6 deletions(-)
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index d943e69..b69cc38 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -4388,13 +4388,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));
+ }
cnt = ring_buffer_dropped_events_cpu(tr->buffer, cpu);
trace_seq_printf(s, "dropped events: %ld\n", cnt);
next prev parent reply other threads:[~2012-12-09 11:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-13 20:18 [PATCH v9 1/3] tracing,x86: Add a TSC trace_clock David Sharp
2012-11-13 20:18 ` [PATCH v9 2/3] tracing: Format non-nanosec times from tsc clock without a decimal point David Sharp
2012-12-09 11:26 ` [tip:perf/core] " tip-bot for David Sharp
2012-11-13 20:18 ` [PATCH v9 3/3] ftrace: Show raw time stamp on stats per cpu using counter or tsc mode for trace_clock David Sharp
2012-12-09 11:27 ` tip-bot for Yoshihiro YUNOMAE [this message]
2012-12-09 11:25 ` [tip:perf/core] tracing,x86: Add a TSC trace_clock tip-bot for David Sharp
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=tip-11043d8b125671a32253cddb0b05177be0e976f6@git.kernel.org \
--to=yoshihiro.yunomae.ez@hitachi.com \
--cc=dhsharp@google.com \
--cc=fweisbec@gmail.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=mingo@redhat.com \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
/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
Powered by JetHome