The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Dmitry Safonov <0x7f454c46@gmail.com>
Cc: mingo@redhat.com, corbet@lwn.net, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/5] ftrace: remove redundant strsep in mod_callback
Date: Tue, 29 Sep 2015 15:11:09 -0400	[thread overview]
Message-ID: <20150929151109.7cf518da@gandalf.local.home> (raw)
In-Reply-To: <1443545176-3215-1-git-send-email-0x7f454c46@gmail.com>

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(&param, ":");
> -	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;
>  


  parent reply	other threads:[~2015-09-29 19:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-29 16:46 [PATCH 1/5] ftrace: remove redundant strsep in mod_callback Dmitry Safonov
2015-09-29 16:46 ` [PATCH 2/5] ftrace: clarify code for mod command Dmitry Safonov
2015-09-29 16:46 ` [PATCH 3/5] ftrace: introduce ftrace_glob structure Dmitry Safonov
2015-10-16 15:05   ` Steven Rostedt
2015-10-16 22:32     ` Dmitry Safonov
2015-09-29 16:46 ` [PATCH 4/5] ftrace: add module globbing Dmitry Safonov
2015-09-29 16:46 ` [PATCH 5/5] Documentation: ftrace: module globbing usage Dmitry Safonov
2015-09-29 19:11 ` Steven Rostedt [this message]
2015-10-05 15:16   ` [PATCH 1/5] ftrace: remove redundant strsep in mod_callback Дмитрий Сафонов
2015-10-14  0:48 ` Steven Rostedt
2015-10-16  8:52   ` Dmitry Safonov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150929151109.7cf518da@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=0x7f454c46@gmail.com \
    --cc=corbet@lwn.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox