* [PATCH v2] perf probe: Fix to delete multiple probe event
@ 2020-02-28 7:57 Masami Hiramatsu
2020-03-09 13:43 ` Arnaldo Carvalho de Melo
2020-03-19 14:04 ` [tip: perf/urgent] " tip-bot2 for Masami Hiramatsu
0 siblings, 2 replies; 3+ messages in thread
From: Masami Hiramatsu @ 2020-02-28 7:57 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: Masami Hiramatsu, Adrian Hunter, Jiri Olsa, Namhyung Kim,
Linux Kernel Mailing List, He Zhe, stable
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
Fixes: 72363540c009 ("perf probe: Support multiprobe event")
Reported-by: Arnaldo Carvalho de Melo <acme@kernel.org>
Reported-by: He Zhe <zhe.he@windriver.com>
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
---
v2:
- Forward port on the latest perf/urgent tree.
- Add Fixes and Reporters.
---
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 0f5fda11675f..8c852948513e 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;
}
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] perf probe: Fix to delete multiple probe event
2020-02-28 7:57 [PATCH v2] perf probe: Fix to delete multiple probe event Masami Hiramatsu
@ 2020-03-09 13:43 ` Arnaldo Carvalho de Melo
2020-03-19 14:04 ` [tip: perf/urgent] " tip-bot2 for Masami Hiramatsu
1 sibling, 0 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2020-03-09 13:43 UTC (permalink / raw)
To: Masami Hiramatsu
Cc: Adrian Hunter, Jiri Olsa, Namhyung Kim, Linux Kernel Mailing List,
He Zhe, stable
Em Fri, Feb 28, 2020 at 04:57:42PM +0900, Masami Hiramatsu escreveu:
> 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
Thanks, tested and applied to perf/urgent.
- Arnaldo
> Fixes: 72363540c009 ("perf probe: Support multiprobe event")
> Reported-by: Arnaldo Carvalho de Melo <acme@kernel.org>
> Reported-by: He Zhe <zhe.he@windriver.com>
> Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
> ---
> v2:
> - Forward port on the latest perf/urgent tree.
> - Add Fixes and Reporters.
> ---
> 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 0f5fda11675f..8c852948513e 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;
> }
>
--
- Arnaldo
^ permalink raw reply [flat|nested] 3+ messages in thread
* [tip: perf/urgent] perf probe: Fix to delete multiple probe event
2020-02-28 7:57 [PATCH v2] perf probe: Fix to delete multiple probe event Masami Hiramatsu
2020-03-09 13:43 ` Arnaldo Carvalho de Melo
@ 2020-03-19 14:04 ` tip-bot2 for Masami Hiramatsu
1 sibling, 0 replies; 3+ messages in thread
From: tip-bot2 for Masami Hiramatsu @ 2020-03-19 14:04 UTC (permalink / raw)
To: linux-tip-commits
Cc: Arnaldo Carvalho de Melo, He Zhe, Masami Hiramatsu,
Arnaldo Carvalho de Melo, Adrian Hunter, Jiri Olsa, Namhyung Kim,
stable, x86, LKML
The following commit has been merged into the perf/urgent branch of tip:
Commit-ID: 6b8d68f1ce9266b05a55e93c62923ff51daae4c1
Gitweb: https://git.kernel.org/tip/6b8d68f1ce9266b05a55e93c62923ff51daae4c1
Author: Masami Hiramatsu <mhiramat@kernel.org>
AuthorDate: Fri, 28 Feb 2020 16:57:42 +09:00
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitterDate: Mon, 09 Mar 2020 10:41:14 -03:00
perf probe: Fix to delete multiple probe event
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 it:
# perf probe -d \*
Removed event: probe_perf:map__map_ip
#
Fixes: 72363540c009 ("perf probe: Support multiprobe event")
Reported-by: Arnaldo Carvalho de Melo <acme@kernel.org>
Reported-by: He Zhe <zhe.he@windriver.com>
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: stable@vger.kernel.org
Link: http://lore.kernel.org/lkml/158287666197.16697.7514373548551863562.stgit@devnote2
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.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 0f5fda1..8c85294 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;
}
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-03-19 14:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-28 7:57 [PATCH v2] perf probe: Fix to delete multiple probe event Masami Hiramatsu
2020-03-09 13:43 ` Arnaldo Carvalho de Melo
2020-03-19 14:04 ` [tip: perf/urgent] " tip-bot2 for Masami Hiramatsu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).