Skip to content

Commit 45f706e

Browse files
committed
perf evsel: Fix missing inherit + sample read check
JIRA: https://issues.redhat.com/browse/RHEL-45091 upstream ======== commit 1afe05b Author: Namhyung Kim <namhyung@kernel.org> Date: Tue Oct 8 23:22:50 2024 -0700 description =========== It should not clear the inherit bit simply because the kernel doesn't support the sample read with it. IOW the inherit bit should be kept when the sample read is not requested for the event. Fixes: 90035d3 ("tools/perf: Allow inherit + PERF_SAMPLE_READ when opening events") Acked-by: Ben Gainey <ben.gainey@arm.com> Link: https://lore.kernel.org/r/20241009062250.730192-1-namhyung@kernel.org Signed-off-by: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Michael Petlan <mpetlan@redhat.com>
1 parent f73a8b7 commit 45f706e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tools/perf/util/evsel.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2101,7 +2101,8 @@ static int __evsel__prepare_open(struct evsel *evsel, struct perf_cpu_map *cpus,
21012101

21022102
static void evsel__disable_missing_features(struct evsel *evsel)
21032103
{
2104-
if (perf_missing_features.inherit_sample_read)
2104+
if (perf_missing_features.inherit_sample_read && evsel->core.attr.inherit &&
2105+
(evsel->core.attr.sample_type & PERF_SAMPLE_READ))
21052106
evsel->core.attr.inherit = 0;
21062107
if (perf_missing_features.branch_counters)
21072108
evsel->core.attr.branch_sample_type &= ~PERF_SAMPLE_BRANCH_COUNTERS;

0 commit comments

Comments
 (0)