]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
perf evsel: Make unknown event names more unique
authorIan Rogers <irogers@google.com>
Wed, 1 Apr 2026 16:13:23 +0000 (09:13 -0700)
committerNamhyung Kim <namhyung@kernel.org>
Fri, 3 Apr 2026 02:35:17 +0000 (19:35 -0700)
In situations like the perf data converter the evsel__name will be
used to create babeltrace events. If the events have the same name
then creation can fail. Avoid these failures by including more
information into the unknown event names.

Signed-off-by: Ian Rogers <irogers@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/util/evsel.c

index 5a294595a677620eb1866f94cb765c1911fd8afb..1281af056cecd201e985b48c82139335e1bd8c73 100644 (file)
@@ -926,7 +926,8 @@ const char *evsel__name(struct evsel *evsel)
                break;
 
        case PERF_TYPE_TRACEPOINT:
-               scnprintf(bf, sizeof(bf), "%s", "unknown tracepoint");
+               scnprintf(bf, sizeof(bf), "unknown tracepoint id=%#"PRIx64,
+                         evsel->core.attr.config);
                break;
 
        case PERF_TYPE_BREAKPOINT:
@@ -938,8 +939,8 @@ const char *evsel__name(struct evsel *evsel)
                break;
 
        default:
-               scnprintf(bf, sizeof(bf), "unknown attr type: %d",
-                         evsel->core.attr.type);
+               scnprintf(bf, sizeof(bf), "unknown event PMU=%d config=%#"PRIx64,
+                         evsel->core.attr.type, evsel->core.attr.config);
                break;
        }