lkml.org 
[lkml]   [2015]   [Apr]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH perf/core 2/8] [BUGFIX] perf probe: Remove all probes matches given pattern at once
Hi Masami,

On Tue, Apr 21, 2015 at 08:42:00PM +0900, Masami Hiramatsu wrote:
> @@ -2760,14 +2762,17 @@ int del_perf_probe_events(struct strlist *dellist)
>
> pr_debug("Group: %s, Event: %s\n", group, event);
>
> + ret = ret2 = -ENOENT;
> if (namelist)
> ret = del_trace_probe_event(kfd, buf, namelist);
>
> - if (unamelist && ret != 0)
> - ret = del_trace_probe_event(ufd, buf, unamelist);
> + if (unamelist)
> + ret2 = del_trace_probe_event(ufd, buf, unamelist);
>
> - if (ret != 0)
> - pr_info("Info: Event \"%s\" does not exist.\n", buf);
> + /* Since we can remove probes which already removed, no error */
> + if (ret != 0 && ret2 != 0)
> + pr_debug("Event \"%s\" does not exist.\n", buf);

I think it'd be better checking 'ret == -ENOENT && ret2 == -ENOENT'
here since del_trace_probe_event() can return other error codes.

Thanks,
Namhyung


> + ret = 0;
>
> free(str);
> }
>


\
 
 \ /
  Last update: 2015-04-22 10:01    [W:0.094 / U:7.992 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site