]> www.infradead.org Git - users/jedix/linux-maple.git/commit
perf tools: Check fallback error and order
authorNamhyung Kim <namhyung@kernel.org>
Wed, 16 Oct 2024 06:23:57 +0000 (23:23 -0700)
committerNamhyung Kim <namhyung@kernel.org>
Tue, 22 Oct 2024 16:55:08 +0000 (09:55 -0700)
commitaf954f76eea56453713ae657f6812d4063f9bc57
treeae663c09737af464e88efa2e3095eedb3da380e3
parent28398ce1726e5dfa74f6305dd842e0fb7e332ef1
perf tools: Check fallback error and order

The perf_event_open might fail due to various reasons, so blindly
reducing precise_ip level might not be the best way to deal with it.

It seems the kernel return -EOPNOTSUPP when PMU doesn't support the
given precise level.  Let's try again with the correct error code.

This caused a problem on AMD, as it stops on precise_ip of 2 for IBS but
user events with exclude_kernel=1 cannot make progress.  Let's add the
evsel__handle_error_quirks() to this case specially.  I plan to work on
the kernel side to improve this situation but it'd still need some
special handling for IBS.

Reviewed-by: James Clark <james.clark@linaro.org>
Reviewed-by: Ravi Bangoria <ravi.bangoria@amd.com>
Acked-by: Kan Liang <kan.liang@linux.intel.com>
Cc: James Clark <james.clark@arm.com>
Cc: Atish Patra <atishp@atishpatra.org>
Cc: Mingwei Zhang <mizhang@google.com>
Cc: Kajol Jain <kjain@linux.ibm.com>
Cc: Thomas Richter <tmricht@linux.ibm.com>
Cc: Palmer Dabbelt <palmer@rivosinc.com>
Link: https://lore.kernel.org/r/20241016062359.264929-8-namhyung@kernel.org
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/util/evsel.c