[PATCH v2 24/25] perf s390-sample-raw: Don't pass evsel with sample

Ian Rogers
2026-03-19T23:24:56Z

The sample contains the evsel and so it is unnecessary to pass the
evsel as well.

Signed-off-by: Ian Rogers <irogers@google.com>
---
tools/perf/util/s390-sample-raw.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/tools/perf/util/s390-sample-raw.c b/tools/perf/util/s390-sample-raw.c
index c6ae0ae8d86a..bfa342536b9b 100644
--- a/tools/perf/util/s390-sample-raw.c
+++ b/tools/perf/util/s390-sample-raw.c
@@ -284,8 +284,9 @@ static bool s390_pai_all_test(struct perf_sample *sample)
return true;
}

-static void s390_pai_all_dump(struct evsel *evsel, struct perf_sample *sample)
+static void s390_pai_all_dump(struct perf_sample *sample)
{
+ struct evsel *evsel = sample->evsel;
size_t len = sample->raw_size, offset = 0;
unsigned char *p = sample->raw_data;
const char *color = PERF_COLOR_BLUE;
@@ -332,14 +333,16 @@ void evlist__s390_sample_raw(struct evlist *evlist, union perf_event *event,
struct perf_sample *sample)
{
const char *pai_name;
- struct evsel *evsel;
+ struct evsel *evsel = sample->evsel;

if (event->header.type != PERF_RECORD_SAMPLE)
return;

- evsel = evlist__event2evsel(evlist, event);
- if (!evsel)
- return;
+ if (!evsel) {
+ evsel = evlist__event2evsel(evlist, event);
+ if (!evsel)
+ return;
+ }

/* Check for raw data in sample */
if (!sample->raw_size || !sample->raw_data)
@@ -372,6 +375,6 @@ void evlist__s390_sample_raw(struct evlist *evlist, union perf_event *event,
} else {
if (!evsel->pmu)
evsel->pmu = perf_pmus__find_by_type(evsel->core.attr.type);
- s390_pai_all_dump(evsel, sample);
+ s390_pai_all_dump(sample);
}
}
--
2.53.0.959.g497ff81fa9-goog