From: Steven Rostedt <rostedt@goodmis.org>
To: "zhangwei(Jovi)" <jovi.zhangwei@huawei.com>
Cc: fweisbec@gmail.com, mingo@redhat.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 11/12] tracing: guard tracing_selftest_disabled by CONFIG_FTRACE_STARTUP_TEST
Date: Tue, 02 Jul 2013 19:56:43 -0400 [thread overview]
Message-ID: <1372809403.22688.90.camel@gandalf.local.home> (raw)
In-Reply-To: <1365564393-10972-12-git-send-email-jovi.zhangwei@huawei.com>
On Wed, 2013-04-10 at 11:26 +0800, zhangwei(Jovi) wrote:
> From: "zhangwei(Jovi)" <jovi.zhangwei@huawei.com>
>
> Variable tracing_selftest_disabled have not any sense when
> CONFIG_FTRACE_STARTUP_TEST is disabled.
>
> This patch also remove __read_mostly attribute, since variable
> tracing_selftest_disabled really not read mostly.
Yes it is mostly read only. Sure, it's not read much, but it is also
only written to once. That makes it, "read mostly".
-- Steve
>
> Signed-off-by: zhangwei(Jovi) <jovi.zhangwei@huawei.com>
> ---
> kernel/trace/trace.c | 6 ++++--
> kernel/trace/trace.h | 2 +-
> kernel/trace/trace_events.c | 2 ++
> 3 files changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
> index ee4e110..09a3aa8 100644
> --- a/kernel/trace/trace.c
> +++ b/kernel/trace/trace.c
> @@ -58,10 +58,12 @@ bool ring_buffer_expanded;
> */
> static bool __read_mostly tracing_selftest_running;
>
> +#ifdef CONFIG_FTRACE_STARTUP_TEST
> /*
> * If a tracer is running, we do not want to run SELFTEST.
> */
> -bool __read_mostly tracing_selftest_disabled;
> +bool tracing_selftest_disabled;
> +#endif
>
> /* For tracers that don't implement custom flags */
> static struct tracer_opt dummy_tracer_opt[] = {
> @@ -1069,8 +1071,8 @@ int register_tracer(struct tracer *type)
> tracing_set_tracer(type->name);
> default_bootup_tracer = NULL;
> /* disable other selftests, since this will break it. */
> - tracing_selftest_disabled = true;
> #ifdef CONFIG_FTRACE_STARTUP_TEST
> + tracing_selftest_disabled = true;
> printk(KERN_INFO "Disabling FTRACE selftests due to running tracer '%s'\n",
> type->name);
> #endif
> diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
> index 9b8afa7..e9ef8b7 100644
> --- a/kernel/trace/trace.h
> +++ b/kernel/trace/trace.h
> @@ -546,10 +546,10 @@ extern int DYN_FTRACE_TEST_NAME(void);
> extern int DYN_FTRACE_TEST_NAME2(void);
>
> extern bool ring_buffer_expanded;
> -extern bool tracing_selftest_disabled;
> DECLARE_PER_CPU(int, ftrace_cpu_disabled);
>
> #ifdef CONFIG_FTRACE_STARTUP_TEST
> +extern bool tracing_selftest_disabled;
> extern int trace_selftest_startup_function(struct tracer *trace,
> struct trace_array *tr);
> extern int trace_selftest_startup_function_graph(struct tracer *trace,
> diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
> index 7c52a51..7c4a16b 100644
> --- a/kernel/trace/trace_events.c
> +++ b/kernel/trace/trace_events.c
> @@ -2251,7 +2251,9 @@ static __init int setup_trace_event(char *str)
> {
> strlcpy(bootup_event_buf, str, COMMAND_LINE_SIZE);
> ring_buffer_expanded = true;
> +#ifdef CONFIG_FTRACE_STARTUP_TEST
> tracing_selftest_disabled = true;
> +#endif
>
> return 1;
> }
next prev parent reply other threads:[~2013-07-02 23:56 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-10 3:26 [PATCH v3 00/12] event tracing expose change and bugfix/cleanup zhangwei(Jovi)
2013-04-10 3:26 ` [PATCH v3 01/12] tracing: move trace_array definition into include/linux/trace_array.h zhangwei(Jovi)
2013-07-02 23:19 ` Steven Rostedt
2013-07-03 4:02 ` zhangwei(Jovi)
2013-04-10 3:26 ` [PATCH v3 02/12] tracing: fix irqs-off tag display in syscall tracing zhangwei(Jovi)
2013-07-02 23:25 ` Steven Rostedt
2013-04-10 3:26 ` [PATCH v3 03/12] tracing: expose event tracing infrastructure zhangwei(Jovi)
2013-07-02 23:35 ` Steven Rostedt
2013-07-03 3:59 ` zhangwei(Jovi)
2013-04-10 3:26 ` [PATCH v3 04/12] tracing: export ftrace_events zhangwei(Jovi)
2013-04-10 3:26 ` [PATCH v3 05/12] tracing: switch syscall tracing to use event_trace_ops backend zhangwei(Jovi)
2013-04-10 3:26 ` [PATCH v3 06/12] tracing: expose structure ftrace_event_field zhangwei(Jovi)
2013-04-10 3:26 ` [PATCH v3 07/12] tracing: remove TRACE_EVENT_TYPE enum definition zhangwei(Jovi)
2013-07-02 23:39 ` Steven Rostedt
2013-04-10 3:26 ` [PATCH v3 08/12] tracing: remove obsolete macro guard _TRACE_PROFILE_INIT zhangwei(Jovi)
2013-04-10 3:26 ` [PATCH v3 09/12] tracing: remove ftrace(...) function zhangwei(Jovi)
2013-07-02 23:45 ` Steven Rostedt
2013-04-10 3:26 ` [PATCH v3 10/12] tracing: use per trace_array clock_id instead of global trace_clock_id zhangwei(Jovi)
2013-04-10 3:26 ` [PATCH v3 11/12] tracing: guard tracing_selftest_disabled by CONFIG_FTRACE_STARTUP_TEST zhangwei(Jovi)
2013-07-02 23:56 ` Steven Rostedt [this message]
2013-07-03 4:12 ` zhangwei(Jovi)
2013-07-03 11:39 ` Steven Rostedt
2013-04-10 3:26 ` [PATCH v3 12/12] libtraceevent: add libtraceevent prefix in warning message zhangwei(Jovi)
2013-04-10 15:08 ` [PATCH v3 00/12] event tracing expose change and bugfix/cleanup Steven Rostedt
2013-04-11 3:31 ` zhangwei(Jovi)
2013-07-02 23:16 ` Steven Rostedt
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=1372809403.22688.90.camel@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=fweisbec@gmail.com \
--cc=jovi.zhangwei@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.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®