Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752043AbbGMSfE (ORCPT ); Mon, 13 Jul 2015 14:35:04 -0400 Received: from smtprelay0103.hostedemail.com ([216.40.44.103]:36903 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751451AbbGMSfD (ORCPT ); Mon, 13 Jul 2015 14:35:03 -0400 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::,RULES_HIT:41:355:379:541:599:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1434:1437:1515:1516:1518:1534:1542:1593:1594:1711:1730:1747:1777:1792:2393:2553:2559:2562:2693:3138:3139:3140:3141:3142:3354:3622:3865:3866:3867:3868:3870:3871:3872:4250:4321:5007:6120:6261:7514:7875:7901:7903:10004:10400:10848:10967:11026:11232:11473:11658:11914:12043:12295:12296:12438:12517:12519:12555:12740:13161:13229:13255:21080,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0 X-HE-Tag: quilt05_48d741f0a2a44 X-Filterd-Recvd-Size: 3669 Date: Mon, 13 Jul 2015 14:34:59 -0400 From: Steven Rostedt To: Tal Shorer Cc: mingo@redhat.com, linux-kernel@vger.kernel.org Subject: Re: [Patch RFC 1/2] tracing: allow disabling compilation of specific trace systems Message-ID: <20150713143459.09582cb9@gandalf.local.home> In-Reply-To: <1434831679-3852-2-git-send-email-tal.shorer@gmail.com> References: <1434831679-3852-1-git-send-email-tal.shorer@gmail.com> <1434831679-3852-2-git-send-email-tal.shorer@gmail.com> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.28; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2923 Lines: 86 On Sat, 20 Jun 2015 23:21:18 +0300 Tal Shorer wrote: > Allow a trace events header file to disable compilation of its > trace events by defining the preprocessor macro NOTRACE. > > This could be done, for example, according to a Kconfig option. > > Signed-off-by: Tal Shorer > --- > include/linux/tracepoint.h | 6 +++--- > include/trace/define_trace.h | 2 +- > 2 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h > index a5f7f3e..c869f84 100644 > --- a/include/linux/tracepoint.h > +++ b/include/linux/tracepoint.h > @@ -111,7 +111,7 @@ extern void syscall_unregfunc(void); > #define TP_ARGS(args...) args > #define TP_CONDITION(args...) args > > -#ifdef CONFIG_TRACEPOINTS > +#if defined(CONFIG_TRACEPOINTS) && !defined(NOTRACE) Instead of the duplicate condition above, it would be better to make a new macro at the top. And we can add a nice comment to it as well. /* * Individual subsystem my have a separate configuration to * enable their tracepoints. By default, this file will create * the tracepoints if CONFIG_TRACEPOINT is defined. If a subsystem * wants to be able to disable its tracepoints from being created * it can define NOTRACE before including the tracepoint headers. */ #if defined(CONFIG_TRACEPOINTS) && !defined(NOTRACE) # define TRACEPOINTS_ENABLED #endif Then switch all the conditions below to: #ifdef TRACEPOINTS_ENABLED -- Steve > > /* > * it_func[0] is never NULL because there is at least one element in the array > @@ -234,7 +234,7 @@ extern void syscall_unregfunc(void); > #define EXPORT_TRACEPOINT_SYMBOL(name) \ > EXPORT_SYMBOL(__tracepoint_##name) > > -#else /* !CONFIG_TRACEPOINTS */ > +#else /* !(defined(CONFIG_TRACEPOINTS) && !defined(NOTRACE)) */ > #define __DECLARE_TRACE(name, proto, args, cond, data_proto, data_args) \ > static inline void trace_##name(proto) \ > { } \ > @@ -266,7 +266,7 @@ extern void syscall_unregfunc(void); > #define EXPORT_TRACEPOINT_SYMBOL_GPL(name) > #define EXPORT_TRACEPOINT_SYMBOL(name) > > -#endif /* CONFIG_TRACEPOINTS */ > +#endif /* defined(CONFIG_TRACEPOINTS) && !defined(NOTRACE) */ > > #ifdef CONFIG_TRACING > /** > diff --git a/include/trace/define_trace.h b/include/trace/define_trace.h > index 02e1003..e847fd7 100644 > --- a/include/trace/define_trace.h > +++ b/include/trace/define_trace.h > @@ -86,7 +86,7 @@ > #undef DECLARE_TRACE > #define DECLARE_TRACE(name, proto, args) > > -#ifdef CONFIG_EVENT_TRACING > +#if defined(CONFIG_EVENT_TRACING) && !defined(NOTRACE) > #include > #endif > -- 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/