Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751481AbdIKLX1 (ORCPT ); Mon, 11 Sep 2017 07:23:27 -0400 Received: from smtprelay0046.hostedemail.com ([216.40.44.46]:50908 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751013AbdIKLX0 (ORCPT ); Mon, 11 Sep 2017 07:23:26 -0400 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::::::,RULES_HIT:41:355:379:541:599:800:960:966:968:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2196:2199:2393:2551:2553:2559:2562:2693:2898:3138:3139:3140:3141:3142:3354:3622:3865:3866:3867:3868:3870:3871:3872:3873:3874:4250:4385:4605:5007:6261:7576:7875:7903:9010:10004:10400:10450:10455:10848:10904:10967:11026:11232:11658:11914:12043:12050:12296:12555:12663:12740:12760:12895:13069:13073:13095:13311:13357:13439:14181:14659:14721:19904:19999:21080:21324:21433:21451:21611:21627:30029:30054:30056:30070:30083:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: offer51_a263af1df07 X-Filterd-Recvd-Size: 2927 Date: Mon, 11 Sep 2017 07:23:21 -0400 From: Steven Rostedt To: "Ziqian SUN (Zamir)" Cc: linux-kernel@vger.kernel.org, mingo@redhat.com, karolherbst@gmail.com, ppaalanen@gmail.com, akpm@linux-foundation.org Subject: Re: [PATCH v3] tracing: Ignore mmiotrace from kernel commandline Message-ID: <20170911072321.0085db2c@vmware.local.home> In-Reply-To: <3cec495b-89a5-b8c6-e319-af9f969582e0@redhat.com> References: <1505111195-31942-1-git-send-email-zsun@redhat.com> <3cec495b-89a5-b8c6-e319-af9f969582e0@redhat.com> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; 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: 1950 Lines: 47 On Mon, 11 Sep 2017 14:31:34 +0800 "Ziqian SUN (Zamir)" wrote: > On 09/11/2017 02:26 PM, Ziqian SUN (Zamir) wrote: > > From: "Ziqian SUN (Zamir)" > > > > The mmiotrace tracer cannot be enabled with ftrace=mmiotrace in kernel > > commandline. With this patch, noboot is added to the tracer struct, > > and when system boot with a tracer that has noboot=true, it will print > > out a warning message and continue booting. > > > > Signed-off-by: Ziqian SUN (Zamir) > > -- > > v1 -> v2 : remove unessential comment > > v2 -> v3 : Use tracer struct instead of a separate list to store noboot > > --- > > kernel/trace/trace.c | 7 +++++++ > > kernel/trace/trace.h | 2 ++ > > kernel/trace/trace_mmiotrace.c | 1 + > > 3 files changed, 10 insertions(+) > > > > diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c > > index 5360b7a..48c474f 100644 > > --- a/kernel/trace/trace.c > > +++ b/kernel/trace/trace.c > > @@ -5358,6 +5358,13 @@ static int tracing_set_tracer(struct trace_array *tr, const char *buf) > > if (t == tr->current_trace) > > goto out; > > > > + /* Some tracers won't work on kernel command line */ > > + if (system_state < SYSTEM_RUNNING && t->noboot) { > > + pr_warn("Tracer '%s' is not allowed on command line, ignored\n", > > + t->name); > I feel the core trace printed by WARN is not so meaningful, so I use > pr_warn instead. I'm fine with pr_warn, but I'm curious to what you mean by "not so meaningful"? A WARN() will cause a dump stack, which usually shows up as a bug in systems and more likely to be seen. But if someone is adding this to the kernel command line and it's not working, they should be looking for the tracer name within the dmesg anyway. Also, I'm currently at OSS in LA and hopefully I don't lose this patch. If you don't see anything by next Monday from me, feel free to send me a reminder ping. -- Steve