[tip: perf/core] perf evsel: Be consistent when looking which evsel PERF_SAMPLE_ bits are set

From: tip-bot2 for Adrian Hunter
Date: Wed Apr 22 2020 - 08:21:11 EST


The following commit has been merged into the perf/core branch of tip:

Commit-ID: 8e94b3243a9af2c49a38fd0d6f2f9beb542e41a4
Gitweb: https://git.kernel.org/tip/8e94b3243a9af2c49a38fd0d6f2f9beb542e41a4
Author: Adrian Hunter <adrian.hunter@xxxxxxxxx>
AuthorDate: Wed, 01 Apr 2020 13:16:07 +03:00
Committer: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
CommitterDate: Thu, 16 Apr 2020 12:19:17 -03:00

perf evsel: Be consistent when looking which evsel PERF_SAMPLE_ bits are set

Using 'type' variable for checking for callchains is equivalent to using
evsel__has_callchain(evsel) and is how the other PERF_SAMPLE_ bits are checked
in this function, so use it to be consistent.

Signed-off-by: Adrian Hunter <adrian.hunter@xxxxxxxxx>
Cc: Andi Kleen <ak@xxxxxxxxxxxxxxx>
Cc: Jiri Olsa <jolsa@xxxxxxxxxx>
Link: http://lore.kernel.org/lkml/20200401101613.6201-11-adrian.hunter@xxxxxxxxx
[ split from a larger patch ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
---
tools/perf/util/evsel.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index d23db67..f320ada 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -2136,7 +2136,7 @@ int perf_evsel__parse_sample(struct evsel *evsel, union perf_event *event,
}
}

- if (evsel__has_callchain(evsel)) {
+ if (type & PERF_SAMPLE_CALLCHAIN) {
const u64 max_callchain_nr = UINT64_MAX / sizeof(u64);

OVERFLOW_CHECK_u64(array);