Skip to content

Commit c33aea4

Browse files
committed
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: af954f7 ("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>
1 parent 968121f commit c33aea4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tools/perf/util/evsel.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2571,12 +2571,12 @@ static int evsel__open_cpu(struct evsel *evsel, struct perf_cpu_map *cpus,
25712571
if (err == -EMFILE && rlimit__increase_nofile(&set_rlimit))
25722572
goto retry_open;
25732573

2574-
if (err == -EOPNOTSUPP && evsel__precise_ip_fallback(evsel))
2575-
goto retry_open;
2576-
25772574
if (err == -EINVAL && evsel__detect_missing_features(evsel))
25782575
goto fallback_missing_features;
25792576

2577+
if (evsel__precise_ip_fallback(evsel))
2578+
goto retry_open;
2579+
25802580
if (evsel__handle_error_quirks(evsel, err))
25812581
goto retry_open;
25822582

0 commit comments

Comments
 (0)