From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754951AbbIWNua (ORCPT ); Wed, 23 Sep 2015 09:50:30 -0400 Received: from m12-17.163.com ([220.181.12.17]:59466 "EHLO m12-17.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754234AbbIWNu1 (ORCPT ); Wed, 23 Sep 2015 09:50:27 -0400 Date: Wed, 23 Sep 2015 21:49:43 +0800 From: Yaowei Bai To: Steven Rostedt 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: <20150923134943.GA5150@bbox> References: <1442929393-4753-1-git-send-email-bywxiaobai@163.com> <20150922095847.0f24fd0e@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150922095847.0f24fd0e@gandalf.local.home> User-Agent: Mutt/1.5.21 (2010-09-15) X-CM-TRANSID: EcCowADn4uT4rQJW2aeLCg--.39993S3 X-Coremail-Antispam: 1Uf129KBjvJXoW7Cw17Gw4rGFWxCF4DWr1ftFb_yoW8JFy7pw 1xGF4kKw18tF4jyFyjvrySkr1jqw4ktrWxG3Wkt3yrXry2yrnag3s2vr1Yga1UAr98A34S yFyjvryq93yUZFUanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07j6NtcUUUUU= X-Originating-IP: [58.208.66.158] X-CM-SenderInfo: xe1z5x5dretxi6rwjhhfrp/1tbisBp+T1UL3Sa4rAAAsq Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 22, 2015 at 09:58:47AM -0400, Steven Rostedt wrote: > 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. Got it. > > 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. Appreciate you wonderful explanation. > > -- Steve > > > > tracing_off(); > > > > if (trace_boot_clock) {