[PATCH v4 0/5] perf evsel fallback changes

From: Ian Rogers

Date: Mon Mar 16 2026 - 23:06:51 EST


Discussion with Thomas Richter in:
https://lore.kernel.org/lkml/20260306071002.2526085-1-tmricht@xxxxxxxxxxxxx/
showed that the evsel__fallback wasn't working for s390. These patches
avoid the problematic frame pointer callchain on s390 and fix
evsel__fallback from a range of problems when falling back to a
software event. I simulated failures when developing the patches but
they are untested other than that.

v4: Changing the callchain parameter at configuration time means other
options aren't set the same as they would for `--call-graph
dwarf`, for example the stack size. Switch to setting the
callchain option on s390 to parameter parse time. For '-g' use
'--call-graph dwarf' for s390. Other --call-graph options are
parsed as normal, but a warning is generated when setting
`--call-graph fp` for s390. Also fix that sample IDs aren't wanted
when there is only 1 event in the evlist.

v3: Incorporate feedback about event and callchain behavior for s390:
https://lore.kernel.org/lkml/20260312061628.1593105-1-irogers@xxxxxxxxxx/
https://lore.kernel.org/lkml/20260313202811.2599195-1-irogers@xxxxxxxxxx/

v2: try exclude_callchain_user for s390 rather than fully disabling
the callchain. Fix a missed clearing of is_pmu_core if the
software event fallback.
https://lore.kernel.org/lkml/20260312061628.1593105-1-irogers@xxxxxxxxxx/

v1: https://lore.kernel.org/lkml/20260312031928.1494864-1-irogers@xxxxxxxxxx/

Ian Rogers (5):
perf evsel: Improve falling back from cycles
perf target: Constify simple check functions
perf evsel: Constify option arguments to config functions
perf callchain: Move callchain option parsing out of builtin
perf evlist: Improve default event for s390

tools/perf/builtin-record.c | 64 ++---------------------------
tools/perf/builtin-top.c | 2 +-
tools/perf/tests/event_update.c | 4 +-
tools/perf/tests/expand-cgroup.c | 4 +-
tools/perf/tests/perf-record.c | 7 +++-
tools/perf/tests/topology.c | 4 +-
tools/perf/util/callchain.c | 61 ++++++++++++++++++++++++++++
tools/perf/util/evlist.c | 32 ++++++++++-----
tools/perf/util/evlist.h | 2 +-
tools/perf/util/evsel.c | 70 +++++++++++++++++++++-----------
tools/perf/util/evsel.h | 10 +++--
tools/perf/util/target.h | 12 +++---
12 files changed, 159 insertions(+), 113 deletions(-)

--
2.53.0.851.ga537e3e6e9-goog