From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933196AbcCIQFw (ORCPT ); Wed, 9 Mar 2016 11:05:52 -0500 Received: from smtprelay0067.hostedemail.com ([216.40.44.67]:56233 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753702AbcCIQFo (ORCPT ); Wed, 9 Mar 2016 11:05:44 -0500 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:1437:1515:1516:1518:1534:1542:1593:1594:1711:1730:1747:1777:1792:1801:2194:2199:2393:2553:2559:2562:3138:3139:3140:3141:3142:3353:3622:3865:3866:3870:3871:3872:3873:3874:4605:5007:6119:6261:7875:7903:10004:10400:10848:10967:11026:11232:11473:11658:11914:12043:12296:12438:12517:12519:12555:12740:13439:14659:14721:21060:21080:30029:30054:30070:30090:30091,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,LFtime:1,LUA_SUMMARY:none X-HE-Tag: skirt78_4eb8caf654607 X-Filterd-Recvd-Size: 3054 Date: Wed, 9 Mar 2016 11:05:39 -0500 From: Steven Rostedt To: Sudeep Holla Cc: linux-kernel@vger.kernel.org, Ingo Molnar Subject: Re: [PATCH -next] tracepoint: ipi: don't trace IPI on offline CPUs Message-ID: <20160309110539.603293db@gandalf.local.home> In-Reply-To: <1457526142-31923-1-git-send-email-sudeep.holla@arm.com> References: <1457526142-31923-1-git-send-email-sudeep.holla@arm.com> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.29; 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 On Wed, 9 Mar 2016 12:22:22 +0000 Sudeep Holla wrote: > Hi Steven, > > I observed that in "include/linux/tracepoint.h", we have > #define __DO_TRACE(tp, proto, args, cond, prercu, postrcu) > ... > if (!cpu_online(raw_smp_processor_id())) > return; > > if (!(cond)) > return; > ... > > where !cond check seems reduntant if it's cpu_online check. > So, does this patch handle the warning correctly or is there any better > way ? I did see few traces with same condition, just thought of checking > with you. > Bah, I forgot that we have lockdep checks for when the event isn't enabled. Can you try this patch: -- Steve diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h index acfdbf353a0b..be586c632a0c 100644 --- a/include/linux/tracepoint.h +++ b/include/linux/tracepoint.h @@ -134,9 +134,6 @@ extern void syscall_unregfunc(void); void *it_func; \ void *__data; \ \ - if (!cpu_online(raw_smp_processor_id())) \ - return; \ - \ if (!(cond)) \ return; \ prercu; \ @@ -343,15 +340,19 @@ extern void syscall_unregfunc(void); * "void *__data, proto" as the callback prototype. */ #define DECLARE_TRACE_NOARGS(name) \ - __DECLARE_TRACE(name, void, , 1, void *__data, __data) + __DECLARE_TRACE(name, void, , \ + cpu_online(raw_smp_processor_id()), \ + void *__data, __data) #define DECLARE_TRACE(name, proto, args) \ - __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args), 1, \ - PARAMS(void *__data, proto), \ - PARAMS(__data, args)) + __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args), \ + cpu_online(raw_smp_processor_id()), \ + PARAMS(void *__data, proto), \ + PARAMS(__data, args)) #define DECLARE_TRACE_CONDITION(name, proto, args, cond) \ - __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args), PARAMS(cond), \ + __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args), \ + cpu_online(raw_smp_processor_id()) && (PARAMS(cond)), \ PARAMS(void *__data, proto), \ PARAMS(__data, args))