summaryrefslogtreecommitdiff
path: root/tools/perf
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@kernel.org>2024-12-05 15:15:29 -0800
committerNamhyung Kim <namhyung@kernel.org>2024-12-05 15:15:29 -0800
commitc33aea446bf555ab2b4e06deb914ba8f87cdb068 (patch)
tree33d6b550af3b955a10a37a3e54a3c425afffa59b /tools/perf
parent968121f0a649ee2ff5ac7b29aa4d4f6b0798ea9e (diff)
downloadlwn-c33aea446bf555ab2b4e06deb914ba8f87cdb068.tar.gz
lwn-c33aea446bf555ab2b4e06deb914ba8f87cdb068.zip
perf tools: Fix precise_ip fallback logic
Sometimes it returns other than EOPNOTSUPP for invalid precise_ip so it cannot check the error code. Let's move the fallback after the missing feature checks so that it can handle EINVAL as well. This also aligns well with the existing behavior which blindly turns off the precise_ip but we check the missing features correctly now. Fixes: af954f76eea56453 ("perf tools: Check fallback error and order") Reported-by: kernel test robot <oliver.sang@intel.com> Reported-by: Arnaldo Carvalho de Melo <acme@redhat.com> Closes: https://lore.kernel.org/oe-lkp/202411301431.799e5531-lkp@intel.com Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com> Link: https://lore.kernel.org/r/Z1DV0lN8qHSysX7f@google.com Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Diffstat (limited to 'tools/perf')
-rw-r--r--tools/perf/util/evsel.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index f745723d486b..d22c5df1701e 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -2571,12 +2571,12 @@ try_fallback:
if (err == -EMFILE && rlimit__increase_nofile(&set_rlimit))
goto retry_open;
- if (err == -EOPNOTSUPP && evsel__precise_ip_fallback(evsel))
- goto retry_open;
-
if (err == -EINVAL && evsel__detect_missing_features(evsel))
goto fallback_missing_features;
+ if (evsel__precise_ip_fallback(evsel))
+ goto retry_open;
+
if (evsel__handle_error_quirks(evsel, err))
goto retry_open;