summaryrefslogtreecommitdiff
path: root/tools/perf/util/evsel.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2022-07-18 10:36:11 -0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2022-07-18 10:36:11 -0300
commit0698461ad2984892a47582a58eb235488d3aac7f (patch)
tree107cfefee20b50f79cde3ed847f075bdbf50fad0 /tools/perf/util/evsel.c
parent0d2997f750d1de394231bc22768dab94a5b5db2f (diff)
parentff6992735ade75aae3e35d16b17da1008d753d28 (diff)
Merge remote-tracking branch 'torvalds/master' into perf/core
To update the perf/core codebase. Fix conflict by moving arch__post_evsel_config(evsel, attr) to the end of evsel__config(), after what was added in: 49c692b7dfc9b6c0 ("perf offcpu: Accept allowed sample types only") Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/evsel.c')
-rw-r--r--tools/perf/util/evsel.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 8fea51a9cd90..a67cc3f2fa74 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -48,6 +48,7 @@
#include "util.h"
#include "hashmap.h"
#include "pmu-hybrid.h"
+#include "off_cpu.h"
#include "../perf-sys.h"
#include "util/parse-branch-options.h"
#include <internal/xyarray.h>
@@ -1107,6 +1108,11 @@ static void evsel__set_default_freq_period(struct record_opts *opts,
}
}
+static bool evsel__is_offcpu_event(struct evsel *evsel)
+{
+ return evsel__is_bpf_output(evsel) && !strcmp(evsel->name, OFFCPU_EVENT);
+}
+
/*
* The enable_on_exec/disabled value strategy:
*
@@ -1372,6 +1378,9 @@ void evsel__config(struct evsel *evsel, struct record_opts *opts,
if (evsel__is_dummy_event(evsel))
evsel__reset_sample_bit(evsel, BRANCH_STACK);
+ if (evsel__is_offcpu_event(evsel))
+ evsel->core.attr.sample_type &= OFFCPU_SAMPLE_TYPES;
+
arch__post_evsel_config(evsel, attr);
}