diff options
author | Jiri Olsa <[email protected]> | 2019-07-03 10:09:49 +0200 |
---|---|---|
committer | Arnaldo Carvalho de Melo <[email protected]> | 2019-07-06 14:30:30 -0300 |
commit | cd136189370cc8a5aec0ea4b4ec517e5ee38d8a0 (patch) | |
tree | daaa7c3e2b1bbc12ac87817d7e82de482a0217ad | |
parent | 4c00af0e94cd01b8c5a5e6b3323d34677b04e192 (diff) |
perf evsel: Do not rely on errno values for precise_ip fallback
Konstantin reported problem with default perf record command, which
fails on some AMD servers, because of the default maximum precise
config.
The current fallback mechanism counts on getting ENOTSUP errno for
precise_ip fails, but that's not the case on some AMD servers.
We can fix this by removing the errno check completely, because the
precise_ip fallback is separated. We can just try (if requested by
evsel->precise_max) all possible precise_ip, and if one succeeds we win,
if not, we continue with standard fallback.
Reported-by: Konstantin Kharlamov <[email protected]>
Signed-off-by: Jiri Olsa <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Andi Kleen <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Quentin Monnet <[email protected]>
Cc: Kim Phillips <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
-rw-r--r-- | tools/perf/util/evsel.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index 4a5947625c5c..69beb9f80f07 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -1785,14 +1785,8 @@ static int perf_event_open(struct perf_evsel *evsel, if (fd >= 0) break; - /* - * Do quick precise_ip fallback if: - * - there is precise_ip set in perf_event_attr - * - maximum precise is requested - * - sys_perf_event_open failed with ENOTSUP error, - * which is associated with wrong precise_ip - */ - if (!precise_ip || !evsel->precise_max || (errno != ENOTSUP)) + /* Do not try less precise if not requested. */ + if (!evsel->precise_max) break; /* |