Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1230219 > unrolled thread

[PATCH 1/2] kernel/trace: call helper function to check global_trace

Started byYaowei Bai <bywxiaobai@163.com>
First post2015-09-22 15:50 +0200
Last post2015-09-23 16:00 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 1/2] kernel/trace: call helper function to check global_trace Yaowei Bai <bywxiaobai@163.com> - 2015-09-22 15:50 +0200
    Re: [PATCH 1/2] kernel/trace: call helper function to check  global_trace Steven Rostedt <rostedt@goodmis.org> - 2015-09-22 16:00 +0200
      Re: [PATCH 1/2] kernel/trace: call helper function to check  global_trace Yaowei Bai <bywxiaobai@163.com> - 2015-09-23 16:00 +0200

#1230219 — [PATCH 1/2] kernel/trace: call helper function to check global_trace

FromYaowei Bai <bywxiaobai@163.com>
Date2015-09-22 15:50 +0200
Subject[PATCH 1/2] kernel/trace: call helper function to check global_trace
Message-ID<qbw7g-6Xg-11@gated-at.bofh.it>
Use helper function tracing_is_enabled() to check if global_trace
has been disabled.

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())
 		tracing_off();
 
 	if (trace_boot_clock) {
-- 
1.9.1


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1230229 — Re: [PATCH 1/2] kernel/trace: call helper function to check global_trace

FromSteven Rostedt <rostedt@goodmis.org>
Date2015-09-22 16:00 +0200
SubjectRe: [PATCH 1/2] kernel/trace: call helper function to check global_trace
Message-ID<qbwgW-78r-5@gated-at.bofh.it>
In reply to#1230219
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.

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) {

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1231457 — Re: [PATCH 1/2] kernel/trace: call helper function to check global_trace

FromYaowei Bai <bywxiaobai@163.com>
Date2015-09-23 16:00 +0200
SubjectRe: [PATCH 1/2] kernel/trace: call helper function to check global_trace
Message-ID<qbSKv-5XZ-29@gated-at.bofh.it>
In reply to#1230229
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) {

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web