]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
perf evsel: Add per-thread warning for EOPNOTSUPP open failues
authorIan Rogers <irogers@google.com>
Sat, 12 Apr 2025 00:47:03 +0000 (17:47 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 12 May 2025 17:18:16 +0000 (14:18 -0300)
The mrvl_ddr_pmu will return EOPNOTSUPP if opened in per-thread
mode. Give a warning for this similar to EINVAL.

Doing this better supports metric testing with limited permissions when
the mrvl_ddr_pmu is present, as the failure to open causes the test to
skip and not fail.

Signed-off-by: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@linaro.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Weilin Wang <weilin.wang@intel.com>
Link: https://lore.kernel.org/r/20250412004704.2297939-1-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/evsel.c

index b60461e16804bb1f0e8c0473b8e24cc0df95e2a9..c06b191e73985f942602a62f2e37d7d9c12a598a 100644 (file)
@@ -3785,6 +3785,10 @@ int evsel__open_strerror(struct evsel *evsel, struct target *target,
                        return scnprintf(msg, size, "%s",
        "No hardware sampling interrupt available.\n");
 #endif
+               if (!target__has_cpu(target))
+                       return scnprintf(msg, size,
+       "Unsupported event (%s) in per-thread mode, enable system wide with '-a'.",
+                                       evsel__name(evsel));
                break;
        case EBUSY:
                if (find_process("oprofiled"))