From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752706AbbIVN6v (ORCPT ); Tue, 22 Sep 2015 09:58:51 -0400 Received: from smtprelay0174.hostedemail.com ([216.40.44.174]:54532 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751118AbbIVN6u (ORCPT ); Tue, 22 Sep 2015 09:58:50 -0400 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::,RULES_HIT:41:355:379:541:599:800:960:966:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2196:2199:2393:2553:2559:2562:2693:3138:3139:3140:3141:3142:3151:3352:3622:3865:3866:3867:3870:3871:3872:3874:4385:5007:6261:7875:10004:10400:10848:10967:11026:11232:11658:11914:12043:12296:12438:12517:12519:12555:12740:13069:13149:13161:13229:13230:13311:13357:14096:14097:21080:21212,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: plane16_2fddde1dfc106 X-Filterd-Recvd-Size: 2000 Date: Tue, 22 Sep 2015 09:58:47 -0400 From: Steven Rostedt To: Yaowei Bai Cc: mingo@redhat.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] kernel/trace: call helper function to check global_trace Message-ID: <20150922095847.0f24fd0e@gandalf.local.home> In-Reply-To: <1442929393-4753-1-git-send-email-bywxiaobai@163.com> References: <1442929393-4753-1-git-send-email-bywxiaobai@163.com> X-Mailer: Claws Mail 3.12.0 (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 On Tue, 22 Sep 2015 21:43:12 +0800 Yaowei Bai wrote: > Use helper function tracing_is_enabled() to check if global_trace > has been disabled. Actually, I prefer not to. > > No functional change. > > Signed-off-by: Yaowei Bai > --- > kernel/trace/trace.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c > index 6e79408..b0bd322a 100644 > --- a/kernel/trace/trace.c > +++ b/kernel/trace/trace.c > @@ -7111,7 +7111,7 @@ __init static int tracer_alloc_buffers(void) > goto out_free_savedcmd; > } > > - if (global_trace.buffer_disabled) > + if (!tracing_is_enabled()) Yes, the above is functionally equivalent. But tracing_is_enabled() is not a "helper function" but actually an external interface for other parts of the tracing system. The above code is the actual setup of the tracing infrastructure, that is used to allocate the tracing buffers. They may now use the same logic, but there's no guarantee that it will in the future. -- Steve > tracing_off(); > > if (trace_boot_clock) {