Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932775AbcCINxJ (ORCPT ); Wed, 9 Mar 2016 08:53:09 -0500 Received: from smtprelay0087.hostedemail.com ([216.40.44.87]:37022 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932587AbcCINw4 (ORCPT ); Wed, 9 Mar 2016 08:52:56 -0500 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::,RULES_HIT:41:355:379:541:599:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1543:1593:1594:1605:1711:1730:1747:1777:1792:2194:2198:2199:2200:2393:2551:2553:2559:2562:2693:2987:3138:3139:3140:3141:3142:3622:3865:3866:3867:3868:3870:3871:3872:3873:3874:4321:5007:6119:6261:7576:7875:7903:8531:8660:9040:9545:10004:10400:10848:10967:11026:11232:11473:11658:11914:12043:12050:12294:12296:12438:12517:12519:12555:12663:12740:13095:13148:13230:13436:13439:13972:14096:14097:14659:14721:21080:21212:21222:30012:30041:30054:30063:30070:30090:30091,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,LFtime:2,LUA_SUMMARY:none X-HE-Tag: sun66_533e8cf21100d X-Filterd-Recvd-Size: 4770 Date: Wed, 9 Mar 2016 08:52:50 -0500 From: Steven Rostedt To: Chunyu Hu Cc: liwan@redhat.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] tracing: make tracer_flags use the right set_flag callback Message-ID: <20160309085250.6dcba5e9@gandalf.local.home> In-Reply-To: <304748287.27041685.1457530725205.JavaMail.zimbra@redhat.com> References: <1457444222-8654-1-git-send-email-chuhu@redhat.com> <20160308095443.409de468@gandalf.local.home> <20160308101451.69f9bc18@gandalf.local.home> <587988151.26798768.1457452530893.JavaMail.zimbra@redhat.com> <20160308112312.2fdc0dd2@gandalf.local.home> <304748287.27041685.1457530725205.JavaMail.zimbra@redhat.com> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.29; 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 Content-Length: 3556 Lines: 103 On Wed, 9 Mar 2016 08:38:45 -0500 (EST) Chunyu Hu wrote: > ----- Original Message ----- > > From: "Steven Rostedt" > > To: "Chunyu Hu" > > 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 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 > > > > >