The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Yaowei Bai <bywxiaobai@163.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: mingo@redhat.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] kernel/trace: call helper function to check global_trace
Date: Wed, 23 Sep 2015 21:49:43 +0800	[thread overview]
Message-ID: <20150923134943.GA5150@bbox> (raw)
In-Reply-To: <20150922095847.0f24fd0e@gandalf.local.home>

On Tue, Sep 22, 2015 at 09:58:47AM -0400, Steven Rostedt wrote:
> On Tue, 22 Sep 2015 21:43:12 +0800
> Yaowei Bai <bywxiaobai@163.com> 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 <bywxiaobai@163.com>
> > ---
> >  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) {


      reply	other threads:[~2015-09-23 13:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-22 13:43 [PATCH 1/2] kernel/trace: call helper function to check global_trace Yaowei Bai
2015-09-22 13:43 ` [PATCH 2/2] kernel/trace_probe: is_good_name can be boolean Yaowei Bai
2015-09-22 13:59   ` Steven Rostedt
2015-09-22 13:58 ` [PATCH 1/2] kernel/trace: call helper function to check global_trace Steven Rostedt
2015-09-23 13:49   ` Yaowei Bai [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150923134943.GA5150@bbox \
    --to=bywxiaobai@163.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox