Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934852Ab3DJD1S (ORCPT ); Tue, 9 Apr 2013 23:27:18 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:28014 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752289Ab3DJD1P (ORCPT ); Tue, 9 Apr 2013 23:27:15 -0400 From: "zhangwei(Jovi)" To: , , , CC: "zhangwei(Jovi)" Subject: [PATCH v3 11/12] tracing: guard tracing_selftest_disabled by CONFIG_FTRACE_STARTUP_TEST Date: Wed, 10 Apr 2013 11:26:32 +0800 Message-ID: <1365564393-10972-12-git-send-email-jovi.zhangwei@huawei.com> X-Mailer: git-send-email 1.8.1.msysgit.1 In-Reply-To: <1365564393-10972-1-git-send-email-jovi.zhangwei@huawei.com> References: <1365564393-10972-1-git-send-email-jovi.zhangwei@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.66.58.241] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2738 Lines: 82 From: "zhangwei(Jovi)" 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. Signed-off-by: zhangwei(Jovi) --- 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; } -- 1.7.9.7 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/