merged.

Bruce


On Tue, Feb 25, 2020 at 10:28 PM <zhe...@windriver.com> wrote:
>
> From: Masami Hiramatsu <mhira...@kernel.org>
>
> Fix to delete multiple probe event with filter correctly.
>
> When we put an event with multiple probes, perf-probe fails
> to delete with filters. This comes from a failure to list
> up the event name because of overwrapping its name.
>
> To fix this issue, skip to list up the event which has
> same name.
>
> Without this patch:
>   # perf probe -l \*
>     probe_perf:map__map_ip (on perf_sample__fprintf_brstackoff:21@
>     probe_perf:map__map_ip (on perf_sample__fprintf_brstackoff:25@
>     probe_perf:map__map_ip (on append_inlines:12@util/machine.c in
>     probe_perf:map__map_ip (on unwind_entry:19@util/machine.c in /
>     probe_perf:map__map_ip (on map__map_ip@util/map.h in /home/mhi
>     probe_perf:map__map_ip (on map__map_ip@util/map.h in /home/mhi
>   # perf probe -d \*
>   "*" does not hit any event.
>     Error: Failed to delete events. Reason: No such file or directory (Code: 
> -2)
>
> With this:
>   # perf probe -d \*
>   Removed event: probe_perf:map__map_ip
>
> Reported-by: Arnaldo Carvalho de Melo <a...@kernel.org>
> Signed-off-by: Masami Hiramatsu <mhira...@kernel.org>
>
> https://lkml.org/lkml/2019/12/3/136
>
> Signed-off-by: He Zhe <zhe...@windriver.com>
> ---
>  tools/perf/util/probe-file.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/tools/perf/util/probe-file.c b/tools/perf/util/probe-file.c
> index 5003ba4..c03a591 100644
> --- a/tools/perf/util/probe-file.c
> +++ b/tools/perf/util/probe-file.c
> @@ -206,6 +206,9 @@ static struct strlist *__probe_file__get_namelist(int fd, 
> bool include_group)
>                 } else
>                         ret = strlist__add(sl, tev.event);
>                 clear_probe_trace_event(&tev);
> +               /* Skip if there is same name multi-probe event in the list */
> +               if (ret == -EEXIST)
> +                       ret = 0;
>                 if (ret < 0)
>                         break;
>         }
> --
> 2.7.4
>


--
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#8395): 
https://lists.yoctoproject.org/g/linux-yocto/message/8395
Mute This Topic: https://lists.yoctoproject.org/mt/71548260/21656
Group Owner: linux-yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to