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


Groups > linux.kernel > #1354147

Re: [PATCH 1/2] tracing: make tracer_flags use the right set_flag callback

From Steven Rostedt <rostedt@goodmis.org>
Newsgroups linux.kernel
Subject Re: [PATCH 1/2] tracing: make tracer_flags use the right set_flag callback
Date 2016-03-09 15:00 +0100
Message-ID <raMOC-cx-5@gated-at.bofh.it> (permalink)
References (1 earlier) <rarh9-2cP-21@gated-at.bofh.it> <rarAu-2yX-17@gated-at.bofh.it> <rasdc-2OP-7@gated-at.bofh.it> <rasGf-3hq-31@gated-at.bofh.it> <raMvg-5O-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, 9 Mar 2016 08:38:45 -0500 (EST)
Chunyu Hu <chuhu@redhat.com> wrote:

> ----- Original Message -----
> > From: "Steven Rostedt" <rostedt@goodmis.org>
> > To: "Chunyu Hu" <chuhu@redhat.com>
> > Cc: liwan@redhat.com, linux-kernel@vger.kernel.org
> > Sent: Wednesday, March 9, 2016 12:23:12 AM
> > Subject: Re: [PATCH 1/2] tracing: make tracer_flags use the right set_flag callback
> > 
> > On Tue, 8 Mar 2016 10:55:30 -0500 (EST)
> > Chunyu Hu <chuhu@redhat.com> wrote:
> > 
> >   
> > > Sure! But my patch/build work are all manual, so I guess I can't keep with
> > > your speed, but i will do. Thx.  
> > 
> > Here's the latest version of your patch ;-)  
> 
> Thanks. It's amazing, all the call trace  in ftrace.c are gone. I did
> the ltp ftrace stress tests and some regression tests on it. I didn't hit 
> any call trace. Thanks for the modification of the code. Just hit several
> dmesg like: kernel: failed to start wakeup tracer. 
> 
>  
> BTW, may I ask the question that what's the difference of func_stack_trace
> and stacktrace? And Is there a case that the tracing_on can't be setup? I
> haven't touch many parts of the code. Thanks ;)


stacktrace works with events, func_stack_trace works with the function
tracer. They are separate for two reasons. One, they have completely
different infrastructures. Two, function tracing is far more invasive,
and enabling func_stack_trace without function filtering will pretty
much bring your system to a screaming halt.

I'm not sure what you mean about the tracing_on question. The
tracing_on file only connects to the tracing_on functionality in the
kernel, which when clear will stop the ring buffers from recording data.

-- Steve

> >  	for (i = 0; i < tr->nr_topts; i++) {
> > -		/*
> > -		 * Check if these flags have already been added.
> > -		 * Some tracers share flags.
> > -		 */
> > -		if (tr->topts[i].tracer->flags == tracer->flags)
> > +		/* Make sure there's no duplicate flags. */
> > +		if (WARN_ON_ONCE(tr->topts[i].tracer->flags == tracer->flags))  
> 
> Thanks! It's really a safer way to throw out this warn if there is duplicate.
> 
> >  			return;
> >  	}
> >  
> > diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
> > index 8414fa40bf27..b4cae47f283e 100644
> > --- a/kernel/trace/trace.h
> > +++ b/kernel/trace/trace.h
> > @@ -345,6 +345,7 @@ struct tracer_opt {
> >  struct tracer_flags {
> >  	u32			val;
> >  	struct tracer_opt	*opts;
> > +	struct tracer		*trace;
> >  };
> >  
> >  /* Makes more easy to define a tracer opt */
> > diff --git a/kernel/trace/trace_functions.c b/kernel/trace/trace_functions.c
> > index fcd41a166405..5a095c2e4b69 100644
> > --- a/kernel/trace/trace_functions.c
> > +++ b/kernel/trace/trace_functions.c
> > @@ -219,6 +219,8 @@ static void tracing_stop_function_trace(struct
> > trace_array *tr)
> >  	unregister_ftrace_function(tr->ops);
> >  }
> >  
> > +static struct tracer function_trace;
> > +
> >  static int
> >  func_set_flag(struct trace_array *tr, u32 old_flags, u32 bit, int set)
> >  {
> > @@ -228,6 +230,10 @@ func_set_flag(struct trace_array *tr, u32 old_flags, u32
> > bit, int set)
> >  		if (!!set == !!(func_flags.val & TRACE_FUNC_OPT_STACK))
> >  			break;
> >  
> > +		/* We can change this flag when not running. */
> > +		if (tr->current_trace != &function_trace)
> > +			break;
> > +  
> 
> At first I thought it should have some relation with the funcgraph trace. so i 
> guessed was wrong. Thx.
> 
> >  		unregister_ftrace_function(tr->ops);
> >  
> >  		if (set) {
> > --
> > 1.8.3.1
> > 
> >   
> 

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 1/2] tracing: make tracer_flags use the right set_flag callback Chunyu Hu <chuhu@redhat.com> - 2016-03-08 14:40 +0100
  [PATCH 2/2] tracing: fix typoes in code comment and printk in trace_nop.c Chunyu Hu <chuhu@redhat.com> - 2016-03-08 14:40 +0100
  Re: [PATCH 1/2] tracing: make tracer_flags use the right set_flag  callback kbuild test robot <lkp@intel.com> - 2016-03-08 15:00 +0100
  Re: [PATCH 1/2] tracing: make tracer_flags use the right set_flag  callback Steven Rostedt <rostedt@goodmis.org> - 2016-03-08 15:20 +0100
  Re: [PATCH 1/2] tracing: make tracer_flags use the right set_flag  callback Steven Rostedt <rostedt@goodmis.org> - 2016-03-08 15:40 +0100
    Re: [PATCH 1/2] tracing: make tracer_flags use the right set_flag  callback Chunyu Hu <chuhu@redhat.com> - 2016-03-08 16:30 +0100
      Re: [PATCH 1/2] tracing: make tracer_flags use the right set_flag  callback Steven Rostedt <rostedt@goodmis.org> - 2016-03-08 16:40 +0100
        Re: [PATCH 1/2] tracing: make tracer_flags use the right set_flag  callback Steven Rostedt <rostedt@goodmis.org> - 2016-03-08 16:40 +0100
      Re: [PATCH 1/2] tracing: make tracer_flags use the right set_flag  callback Steven Rostedt <rostedt@goodmis.org> - 2016-03-08 16:40 +0100
  Re: [PATCH 1/2] tracing: make tracer_flags use the right set_flag  callback Steven Rostedt <rostedt@goodmis.org> - 2016-03-08 16:00 +0100
    Re: [PATCH 1/2] tracing: make tracer_flags use the right set_flag  callback Steven Rostedt <rostedt@goodmis.org> - 2016-03-08 16:20 +0100
      Re: [PATCH 1/2] tracing: make tracer_flags use the right set_flag  callback Chunyu Hu <chuhu@redhat.com> - 2016-03-08 17:00 +0100
        Re: [PATCH 1/2] tracing: make tracer_flags use the right set_flag  callback Steven Rostedt <rostedt@goodmis.org> - 2016-03-08 17:30 +0100
          Re: [PATCH 1/2] tracing: make tracer_flags use the right set_flag  callback Chunyu Hu <chuhu@redhat.com> - 2016-03-09 14:40 +0100
            Re: [PATCH 1/2] tracing: make tracer_flags use the right set_flag  callback Steven Rostedt <rostedt@goodmis.org> - 2016-03-09 15:00 +0100

csiph-web