Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752062AbbDQFJb (ORCPT ); Fri, 17 Apr 2015 01:09:31 -0400 Received: from LGEMRELSE7Q.lge.com ([156.147.1.151]:39290 "EHLO lgemrelse7q.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751041AbbDQFJZ (ORCPT ); Fri, 17 Apr 2015 01:09:25 -0400 X-Original-SENDERIP: 10.177.220.157 X-Original-MAILFROM: iamjoonsoo.kim@lge.com Date: Fri, 17 Apr 2015 14:10:53 +0900 From: Joonsoo Kim To: Steven Rostedt Cc: Ingo Molnar , linux-kernel@vger.kernel.org Subject: Re: [PATCH] tracing: fix incorrect enabling of trace events by boot cmdline Message-ID: <20150417051053.GC25530@js1304-P5Q-DELUXE> References: <1429159484-22977-1-git-send-email-iamjoonsoo.kim@lge.com> <20150416093952.1dba3052@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150416093952.1dba3052@gandalf.local.home> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2255 Lines: 64 On Thu, Apr 16, 2015 at 09:39:52AM -0400, Steven Rostedt wrote: > 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; > Ah... my bad... :) thanks for fixing it. Thanks. -- 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/