linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "zhangwei(Jovi)" <jovi.zhangwei@huawei.com>
To: Steven Rostedt <rostedt@goodmis.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Ingo Molnar <mingo@redhat.com>,
	LKML <linux-kernel@vger.kernel.org>
Cc: "zhangwei(Jovi)" <jovi.zhangwei@huawei.com>
Subject: [PATCH 11/14] tracing: use per trace_array clock_id instead of global trace_clock_id
Date: Wed, 27 Mar 2013 17:48:53 +0800	[thread overview]
Message-ID: <1364377737-10540-13-git-send-email-jovi.zhangwei@huawei.com> (raw)
In-Reply-To: <1364377737-10540-1-git-send-email-jovi.zhangwei@huawei.com>

From: "zhangwei(Jovi)" <jovi.zhangwei@huawei.com>

tracing clock id already changed into per trace_array variable,
but there still use global trace_clock_id, which value always is 0 now.

Signed-off-by: zhangwei(Jovi) <jovi.zhangwei@huawei.com>
---
 kernel/trace/trace.c |    8 +++-----
 kernel/trace/trace.h |    2 --
 2 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index dd0c122..ee4e110 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -652,8 +652,6 @@ static struct {
 	ARCH_TRACE_CLOCKS
 };
 
-int trace_clock_id;
-
 /*
  * trace_parser_get_init - gets the buffer for trace parser
  */
@@ -2806,7 +2804,7 @@ __tracing_open(struct inode *inode, struct file *file, bool snapshot)
 		iter->iter_flags |= TRACE_FILE_ANNOTATE;
 
 	/* Output in nanoseconds only if we are using a clock in nanoseconds. */
-	if (trace_clocks[trace_clock_id].in_ns)
+	if (trace_clocks[tr->clock_id].in_ns)
 		iter->iter_flags |= TRACE_FILE_TIME_IN_NS;
 
 	/* stop the trace while dumping if we are not opening "snapshot" */
@@ -3805,7 +3803,7 @@ static int tracing_open_pipe(struct inode *inode, struct file *filp)
 		iter->iter_flags |= TRACE_FILE_LAT_FMT;
 
 	/* Output in nanoseconds only if we are using a clock in nanoseconds. */
-	if (trace_clocks[trace_clock_id].in_ns)
+	if (trace_clocks[tr->clock_id].in_ns)
 		iter->iter_flags |= TRACE_FILE_TIME_IN_NS;
 
 	iter->cpu_file = tc->cpu;
@@ -5075,7 +5073,7 @@ tracing_stats_read(struct file *filp, char __user *ubuf,
 	cnt = ring_buffer_bytes_cpu(trace_buf->buffer, cpu);
 	trace_seq_printf(s, "bytes: %ld\n", cnt);
 
-	if (trace_clocks[trace_clock_id].in_ns) {
+	if (trace_clocks[tr->clock_id].in_ns) {
 		/* local or global for trace_clock */
 		t = ns2usecs(ring_buffer_oldest_event_ts(trace_buf->buffer, cpu));
 		usec_rem = do_div(t, USEC_PER_SEC);
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index a244fbc..19e3da2 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -588,8 +588,6 @@ enum print_line_t print_trace_line(struct trace_iterator *iter);
 
 extern unsigned long trace_flags;
 
-extern int trace_clock_id;
-
 /* Standard output formatting function used for function return traces */
 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
 
-- 
1.7.9.7



  parent reply	other threads:[~2013-03-27  9:49 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-27  9:48 [PATCH 00/14] event tracing expose change and bugfix/cleanup zhangwei(Jovi)
2013-03-27  9:48 ` zhangwei(Jovi)
2013-03-27  9:48 ` [PATCH 01/14] tracing: move trace_array definition into include/linux/trace_array.h zhangwei(Jovi)
2013-03-27  9:48 ` [PATCH 02/14] tracing: fix irqs-off tag display in syscall tracing zhangwei(Jovi)
2013-03-27  9:48 ` [PATCH 03/14] tracing: expose event tracing infrastructure zhangwei(Jovi)
2013-03-27  9:48 ` [PATCH 04/14] tracing: add private data field into struct ftrace_event_file zhangwei(Jovi)
2013-03-27  9:48 ` [PATCH 05/14] tracing: switch syscall tracing to use event_trace_ops backend zhangwei(Jovi)
2013-03-27  9:48 ` [PATCH 06/14] tracing: export syscall metadata zhangwei(Jovi)
2013-03-27  9:48 ` [PATCH 07/14] tracing: expose structure ftrace_event_field zhangwei(Jovi)
2013-03-27  9:48 ` [PATCH 08/14] tracing: remove TRACE_EVENT_TYPE enum definition zhangwei(Jovi)
2013-03-27  9:48 ` [PATCH 09/14] tracing: remove obsolete macro guard _TRACE_PROFILE_INIT zhangwei(Jovi)
2013-03-27  9:48 ` [PATCH 10/14] tracing: remove ftrace(...) function zhangwei(Jovi)
2013-03-27  9:48 ` zhangwei(Jovi) [this message]
2013-03-27  9:48 ` [PATCH 12/14] tracing: guard tracing_selftest_disabled by CONFIG_FTRACE_STARTUP_TEST zhangwei(Jovi)
2013-03-27  9:48 ` [PATCH 13/14] libtraceevent: add libtraceevent prefix in warning message zhangwei(Jovi)
2013-03-27  9:48 ` [PATCH 14/14] tracing: fix regression of perf function tracing zhangwei(Jovi)
2013-03-27  9:48 ` zhangwei(Jovi)

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=1364377737-10540-13-git-send-email-jovi.zhangwei@huawei.com \
    --to=jovi.zhangwei@huawei.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.org \
    /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;
as well as URLs for NNTP newsgroup(s).