[PATCH v12 04/11] perf/probe: Ignore comment lines in dynamic_events/kprobe_events file

From: Masami Hiramatsu (Google)

Date: Sun Jun 28 2026 - 19:52:18 EST


From: Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx>

Since dynamic_events/kprobe_events files show the fetcharg debug
information as comment lines, its reader needs to ignore it.

Signed-off-by: Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx>
---
tools/perf/util/probe-file.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/tools/perf/util/probe-file.c b/tools/perf/util/probe-file.c
index 4032572cbf55..4d12693a83b3 100644
--- a/tools/perf/util/probe-file.c
+++ b/tools/perf/util/probe-file.c
@@ -197,6 +197,8 @@ struct strlist *probe_file__get_rawlist(int fd)
idx = strlen(p) - 1;
if (p[idx] == '\n')
p[idx] = '\0';
+ if (buf[0] == '#')
+ continue;
ret = strlist__add(sl, buf);
if (ret < 0) {
pr_debug("strlist__add failed (%d)\n", ret);