From patchwork Wed Sep 5 06:23:06 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josh Triplett X-Patchwork-Id: 11182 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id DB5CA23FA6 for ; Wed, 5 Sep 2012 06:23:26 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id 216A1A1938B for ; Wed, 5 Sep 2012 06:22:34 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id k11so335407iea.11 for ; Tue, 04 Sep 2012 23:23:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf :x-originating-ip:x-virus-scanned:x-originating-ip:date:from:to:cc :subject:message-id:references:mime-version:content-type :content-disposition:in-reply-to:user-agent:x-gm-message-state; bh=MyNZRBmTAwKmlTjXxi8ht0Ccj3s9P4xlgi+gDFUtHyI=; b=j+Dlvzzwzr8nmQPPI1as38DYDCQnTBFttC2MVKlFVodlnc6Xtlduo7WFukxasmn9gf GommJoVxusH5KW7lG9x1jGpmZj+sTnOm/d9+uzwZsq3VijAHmGpU0bjD48jN2OyqxhE9 Z8Kw9qgu6kumOmSXPECDw9Aj9umTQFSOy6vfgt9XvK/hUzlMc5PfFo/9fbDuAXY9m0F/ CdBsbPP7gl3jvPUcgfHncdG0AXYWyj/XltlCoaJK/jRau0+x+g9TZ0GVIiji9ZNIJi0K J8dSfMoQzHfgn+tkt+4THtTpD2t8ntboRhB9VGc6WMJSIKUQEGGi3151yU4WUzPS7NwU 5Q7w== Received: by 10.50.45.162 with SMTP id o2mr16920355igm.0.1346826206158; Tue, 04 Sep 2012 23:23:26 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.184.232 with SMTP id ex8csp235060igc; Tue, 4 Sep 2012 23:23:25 -0700 (PDT) Received: by 10.52.240.225 with SMTP id wd1mr15080018vdc.31.1346826204392; Tue, 04 Sep 2012 23:23:24 -0700 (PDT) Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net. [217.70.183.196]) by mx.google.com with ESMTP id w3si447402veb.9.2012.09.04.23.23.23; Tue, 04 Sep 2012 23:23:24 -0700 (PDT) Received-SPF: neutral (google.com: 217.70.183.196 is neither permitted nor denied by best guess record for domain of josh@joshtriplett.org) client-ip=217.70.183.196; Authentication-Results: mx.google.com; spf=neutral (google.com: 217.70.183.196 is neither permitted nor denied by best guess record for domain of josh@joshtriplett.org) smtp.mail=josh@joshtriplett.org X-Originating-IP: 217.70.178.139 Received: from mfilter10-d.gandi.net (mfilter10-d.gandi.net [217.70.178.139]) by relay4-d.mail.gandi.net (Postfix) with ESMTP id 599521720B1; Wed, 5 Sep 2012 08:23:13 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mfilter10-d.gandi.net Received: from relay4-d.mail.gandi.net ([217.70.183.196]) by mfilter10-d.gandi.net (mfilter10-d.gandi.net [10.0.15.180]) (amavisd-new, port 10024) with ESMTP id SszTQngWIpMy; Wed, 5 Sep 2012 08:23:11 +0200 (CEST) X-Originating-IP: 50.43.46.74 Received: from leaf (static-50-43-46-74.bvtn.or.frontiernet.net [50.43.46.74]) (Authenticated sender: josh@joshtriplett.org) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 2D9D41720A5; Wed, 5 Sep 2012 08:23:08 +0200 (CEST) Date: Tue, 4 Sep 2012 23:23:06 -0700 From: Josh Triplett To: Steven Rostedt Cc: paulmck@linux.vnet.ibm.com, linux-kernel@vger.kernel.org, mingo@elte.hu, laijs@cn.fujitsu.com, dipankar@in.ibm.com, akpm@linux-foundation.org, mathieu.desnoyers@polymtl.ca, niv@us.ibm.com, tglx@linutronix.de, peterz@infradead.org, Valdis.Kletnieks@vt.edu, dhowells@redhat.com, eric.dumazet@gmail.com, darren@dvhart.com, fweisbec@gmail.com, sbw@mit.edu, patches@linaro.org, "Paul E. McKenney" Subject: [PATCH] trace: Don't declare trace_*_rcuidle functions in modules Message-ID: <20120905062306.GA14756@leaf> References: <20120830185607.GA32148@linux.vnet.ibm.com> <1346352988-32444-1-git-send-email-paulmck@linux.vnet.ibm.com> <1346352988-32444-4-git-send-email-paulmck@linux.vnet.ibm.com> <20120831180052.GB4259@jtriplet-mobl1> <20120904223350.GQ2593@linux.vnet.ibm.com> <1346799082.27919.31.camel@gandalf.local.home> <20120904230834.GB11494@jtriplet-mobl1> <1346801031.27919.39.camel@gandalf.local.home> <20120904233344.GB11855@jtriplet-mobl1> <1346802402.27919.44.camel@gandalf.local.home> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1346802402.27919.44.camel@gandalf.local.home> User-Agent: Mutt/1.5.21 (2010-09-15) X-Gm-Message-State: ALoCoQly+U8Jh6wDc0jmEA1k9pAdbIO8nRFKD4PXOXnynnMBRnE3KlxMxD5+ZmgnsGSIrPp3klsP Tracepoints declare a static inline trace_*_rcuidle variant of the trace function, to support safely generating trace events from the idle loop. Module code never actually uses that variant of trace functions, because modules don't run code that needs tracing with RCU idled. However, the declaration of those otherwise unused functions causes the module to reference rcu_idle_exit and rcu_idle_enter, which RCU does not export to modules. To avoid this, don't generate trace_*_rcuidle functions for tracepoints declared in module code. Reported-by: Steven Rostedt Signed-off-by: Josh Triplett Acked-by: Mathieu Desnoyers Acked-by: Paul E. McKenney Acked-by: Steven Rostedt --- On Tue, Sep 04, 2012 at 07:46:42PM -0400, Steven Rostedt wrote: > We could add either. Probably keep the ugliness of tracepoints inside > the tracepoint code than to start spreading it around to rcu. RCU has > its own ugliness features ;-) > > Hence, I would be OK if you send me a patch that does what you proposed > and removes the EXPORT from RCU. include/linux/tracepoint.h | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h index 802de56..2f322c3 100644 --- a/include/linux/tracepoint.h +++ b/include/linux/tracepoint.h @@ -136,6 +136,22 @@ static inline void tracepoint_synchronize_unregister(void) postrcu; \ } while (0) +#ifndef MODULE +#define __DECLARE_TRACE_RCU(name, proto, args, cond, data_proto, data_args) \ + static inline void trace_##name##_rcuidle(proto) \ + { \ + if (static_key_false(&__tracepoint_##name.key)) \ + __DO_TRACE(&__tracepoint_##name, \ + TP_PROTO(data_proto), \ + TP_ARGS(data_args), \ + TP_CONDITION(cond), \ + rcu_idle_exit(), \ + rcu_idle_enter()); \ + } +#else +#define __DECLARE_TRACE_RCU(name, proto, args, cond, data_proto, data_args) +#endif + /* * Make sure the alignment of the structure in the __tracepoints section will * not add unwanted padding between the beginning of the section and the @@ -151,16 +167,8 @@ static inline void tracepoint_synchronize_unregister(void) TP_ARGS(data_args), \ TP_CONDITION(cond),,); \ } \ - static inline void trace_##name##_rcuidle(proto) \ - { \ - if (static_key_false(&__tracepoint_##name.key)) \ - __DO_TRACE(&__tracepoint_##name, \ - TP_PROTO(data_proto), \ - TP_ARGS(data_args), \ - TP_CONDITION(cond), \ - rcu_idle_exit(), \ - rcu_idle_enter()); \ - } \ + __DECLARE_TRACE_RCU(name, PARAMS(proto), PARAMS(args), \ + PARAMS(cond), PARAMS(data_proto), PARAMS(data_args)) \ static inline int \ register_trace_##name(void (*probe)(data_proto), void *data) \ { \