Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1239650

Re: [PATCH 1/5] ftrace: remove redundant strsep in mod_callback

From Дмитрий Сафонов <0x7f454c46@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH 1/5] ftrace: remove redundant strsep in mod_callback
Date 2015-10-05 17:20 +0200
Message-ID <qgfIv-2DV-23@gated-at.bofh.it> (permalink)
References <qe6gh-3Gy-9@gated-at.bofh.it> <qe8Br-78E-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hello again, Steven.
I'm pinging :)

2015-09-29 22:11 GMT+03:00 Steven Rostedt <rostedt@goodmis.org>:
> 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;
>>
>
--
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/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 1/5] ftrace: remove redundant strsep in mod_callback Dmitry Safonov <0x7f454c46@gmail.com> - 2015-09-29 18:50 +0200
  [PATCH 3/5] ftrace: introduce ftrace_glob structure Dmitry Safonov <0x7f454c46@gmail.com> - 2015-09-29 18:50 +0200
    Re: [PATCH 3/5] ftrace: introduce ftrace_glob structure Steven Rostedt <rostedt@goodmis.org> - 2015-10-16 17:10 +0200
      Re: [PATCH 3/5] ftrace: introduce ftrace_glob structure Dmitry Safonov <0x7f454c46@gmail.com> - 2015-10-17 00:40 +0200
  [PATCH 5/5] Documentation: ftrace: module globbing usage Dmitry Safonov <0x7f454c46@gmail.com> - 2015-09-29 18:50 +0200
  [PATCH 2/5] ftrace: clarify code for mod command Dmitry Safonov <0x7f454c46@gmail.com> - 2015-09-29 18:50 +0200
  [PATCH 4/5] ftrace: add module globbing Dmitry Safonov <0x7f454c46@gmail.com> - 2015-09-29 18:50 +0200
  Re: [PATCH 1/5] ftrace: remove redundant strsep in mod_callback Steven Rostedt <rostedt@goodmis.org> - 2015-09-29 21:20 +0200
    Re: [PATCH 1/5] ftrace: remove redundant strsep in mod_callback Дмитрий Сафонов   <0x7f454c46@gmail.com> - 2015-10-05 17:20 +0200
  Re: [PATCH 1/5] ftrace: remove redundant strsep in mod_callback Steven Rostedt <rostedt@goodmis.org> - 2015-10-14 03:00 +0200
    Re: [PATCH 1/5] ftrace: remove redundant strsep in mod_callback Dmitry Safonov <0x7f454c46@gmail.com> - 2015-10-16 11:00 +0200

csiph-web