Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933714AbbDPNkK (ORCPT ); Thu, 16 Apr 2015 09:40:10 -0400 Received: from smtprelay0089.hostedemail.com ([216.40.44.89]:57258 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1757464AbbDPNj4 (ORCPT ); Thu, 16 Apr 2015 09:39:56 -0400 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:1541:1593:1594:1711:1730:1747:1777:1792:2393:2553:2559:2562:2693:2918:3138:3139:3140:3141:3142:3353:3622:3865:3867:3868:3870:3871:3872:3873:3874:4321:4362:5007:6261:7875:7901:7903:10004:10400:10848:10967:11026:11232:11658:11914:12043:12296:12438:12517:12519:12555:12740:13069:13311:13357:14096:14097:21080,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 X-HE-Tag: chess92_56944fa25854a X-Filterd-Recvd-Size: 2743 Date: Thu, 16 Apr 2015 09:39:52 -0400 From: Steven Rostedt To: Joonsoo Kim Cc: Ingo Molnar , linux-kernel@vger.kernel.org Subject: Re: [PATCH] tracing: fix incorrect enabling of trace events by boot cmdline Message-ID: <20150416093952.1dba3052@gandalf.local.home> In-Reply-To: <1429159484-22977-1-git-send-email-iamjoonsoo.kim@lge.com> References: <1429159484-22977-1-git-send-email-iamjoonsoo.kim@lge.com> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.25; 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: 2061 Lines: 64 On Thu, 16 Apr 2015 13:44:44 +0900 Joonsoo Kim wrote: > There is a problem that trace events are not properly enabled with > boot cmdline. Problem is that if we pass "trace_event=kmem:mm_page_alloc" > to boot cmdline, it enables all kmem trace events. > > It is caused by parsing mechanism. When we parse cmdline, buffer > contents is modified due to tokenization. And, if we use this buffer > again, we will get wrong result. > > Unfortunately, this buffer should be accessed three times > to set trace events properly in boot time. So, we need to handle > this situation. > > There is already handling code for ",", but, we need another for > ":". This patch add it. Thanks, but your patch has a bug in it. I'll fix it up. > > Signed-off-by: Joonsoo Kim > --- > kernel/trace/trace_events.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c > index db54dda..ce5b194 100644 > --- a/kernel/trace/trace_events.c > +++ b/kernel/trace/trace_events.c > @@ -565,6 +565,7 @@ static int __ftrace_set_clr_event(struct trace_array *tr, const char *match, > static int ftrace_set_clr_event(struct trace_array *tr, char *buf, int set) > { > char *event = NULL, *sub = NULL, *match; > + int ret; > > /* > * The buf format can be : > @@ -590,7 +591,11 @@ static int ftrace_set_clr_event(struct trace_array *tr, char *buf, int set) > event = NULL; > } > > - return __ftrace_set_clr_event(tr, match, sub, event, set); > + ret = __ftrace_set_clr_event(tr, match, sub, event, set); > + > + /* Put back the colon to allow this to be called again */ > + if (buf) > + *(buf - 1) = ':'; You forgot to add: return ret; -- Steve > } > > /** -- 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/