From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752320AbbJEPQw (ORCPT ); Mon, 5 Oct 2015 11:16:52 -0400 Received: from mail-wi0-f181.google.com ([209.85.212.181]:36393 "EHLO mail-wi0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752235AbbJEPQu (ORCPT ); Mon, 5 Oct 2015 11:16:50 -0400 MIME-Version: 1.0 In-Reply-To: <20150929151109.7cf518da@gandalf.local.home> References: <1443545176-3215-1-git-send-email-0x7f454c46@gmail.com> <20150929151109.7cf518da@gandalf.local.home> From: =?UTF-8?B?0JTQvNC40YLRgNC40Lkg0KHQsNGE0L7QvdC+0LI=?= <0x7f454c46@gmail.com> Date: Mon, 5 Oct 2015 18:16:29 +0300 Message-ID: Subject: Re: [PATCH 1/5] ftrace: remove redundant strsep in mod_callback To: Steven Rostedt Cc: mingo@redhat.com, Jonathan Corbet , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello again, Steven. I'm pinging :) 2015-09-29 22:11 GMT+03:00 Steven Rostedt : > On Tue, 29 Sep 2015 19:46:12 +0300 > Dmitry Safonov <0x7f454c46@gmail.com> wrote: > >> By now there isn't any subcommand for mod. >> >> Before: >> sh$ echo '*:mod:ipv6:a' > set_ftrace_filter >> sh$ echo '*:mod:ipv6' > set_ftrace_filter >> had the same results, but now first will result in: >> sh$ echo '*:mod:ipv6:a' > set_ftrace_filter >> -bash: echo: write error: Invalid argument >> >> Also, I clarified ftrace_mod_callback code a little. > > Thanks for the patches. I don't have time to look at them at the moment > as I'm trying to finish up some stuff before I leave for LinuxCon EU. > > If you don't hear from me by Monday, feel free to ping me again. I'll > be in Dublin (for LinuxCon), but I should be able to take a look at the > patches while I'm there. What do you think keynotes are for ;-) > > -- Steve > >> >> Signed-off-by: Dmitry Safonov <0x7f454c46@gmail.com> >> --- >> kernel/trace/ftrace.c | 17 ++++++----------- >> 1 file changed, 6 insertions(+), 11 deletions(-) >> >> diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c >> index b0623ac..f87401b 100644 >> --- a/kernel/trace/ftrace.c >> +++ b/kernel/trace/ftrace.c >> @@ -3564,8 +3564,7 @@ static int >> ftrace_mod_callback(struct ftrace_hash *hash, >> char *func, char *cmd, char *param, int enable) >> { >> - char *mod; >> - int ret = -EINVAL; >> + int ret; >> >> /* >> * cmd == 'mod' because we only registered this func >> @@ -3576,16 +3575,12 @@ ftrace_mod_callback(struct ftrace_hash *hash, >> */ >> >> /* we must have a module name */ >> - if (!param) >> - return ret; >> - >> - mod = strsep(¶m, ":"); >> - if (!strlen(mod)) >> - return ret; >> + if (!param || !strlen(param)) >> + return -EINVAL; >> >> - ret = ftrace_match_module_records(hash, func, mod); >> - if (!ret) >> - ret = -EINVAL; >> + ret = ftrace_match_module_records(hash, func, param); >> + if (ret == 0) >> + return -EINVAL; >> if (ret < 0) >> return ret; >> >