mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 09:36:22 +02:00
perf evlist: Try to avoid computing evsel from sample
As struct perf_sample now directly contains its own resolved evsel pointer, passing the evsel separately is redundant and clutters the interface. Remove the redundant evsel parameter from evlist-specific handlers and structures, ensuring the tool always directly accesses the evsel bound to the sample. This simplifies the API signatures and eliminates the risk of passing an inconsistent evsel. Signed-off-by: Ian Rogers <irogers@google.com> Acked-by: Namhyung Kim <namhyung@kernel.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Albert Ou <aou@eecs.berkeley.edu> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Alexandre Ghiti <alex@ghiti.fr> Cc: Andi Kleen <ak@linux.intel.com> Cc: Andrew Jones <ajones@ventanamicro.com> Cc: Anup Patel <anup@brainfault.org> Cc: Athira Rajeev <atrajeev@linux.ibm.com> Cc: Blake Jones <blakejones@google.com> Cc: Chen Ni <nichen@iscas.ac.cn> Cc: Chun-Tse Shao <ctshao@google.com> Cc: Dapeng Mi <dapeng1.mi@linux.intel.com> Cc: Derek Foreman <derek.foreman@collabora.com> Cc: Dmitriy Vyukov <dvyukov@google.com> Cc: Dr. David Alan Gilbert <linux@treblig.org> Cc: Howard Chu <howardchu95@gmail.com> Cc: Hrishikesh Suresh <hrishikesh123s@gmail.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: James Clark <james.clark@linaro.org> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Krzysztof Łopatowski <krzysztof.m.lopatowski@gmail.com> Cc: Leo Yan <leo.yan@arm.com> Cc: Palmer Dabbelt <palmer@dabbelt.com> Cc: Paul Walmsley <pjw@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Quan Zhou <zhouquan@iscas.ac.cn> Cc: Ravi Bangoria <ravi.bangoria@amd.com> Cc: Swapnil Sapkal <swapnil.sapkal@amd.com> Cc: Thomas Falcon <thomas.falcon@intel.com> Cc: Tianyou Li <tianyou.li@intel.com> Cc: Yujie Liu <yujie.liu@intel.com> Cc: tanze <tanze@kylinos.cn> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
1f44e8fe3d
commit
675073ddf8
|
|
@ -1164,7 +1164,9 @@ static int deliver_event(struct ordered_events *qe,
|
|||
goto next_event;
|
||||
}
|
||||
|
||||
evsel = evlist__id2evsel(session->evlist, sample.id);
|
||||
evsel = sample.evsel;
|
||||
if (!evsel)
|
||||
evsel = evlist__id2evsel(session->evlist, sample.id);
|
||||
assert(evsel != NULL);
|
||||
|
||||
if (event->header.type == PERF_RECORD_SAMPLE) {
|
||||
|
|
|
|||
|
|
@ -142,7 +142,9 @@ static int test__basic_mmap(struct test_suite *test __maybe_unused, int subtest
|
|||
}
|
||||
|
||||
err = -1;
|
||||
evsel = evlist__id2evsel(evlist, sample.id);
|
||||
evsel = sample.evsel;
|
||||
if (!evsel)
|
||||
evsel = evlist__id2evsel(evlist, sample.id);
|
||||
perf_sample__exit(&sample);
|
||||
if (evsel == NULL) {
|
||||
pr_debug("event with id %" PRIu64
|
||||
|
|
|
|||
|
|
@ -138,7 +138,10 @@ static int process_sample_event(struct evlist *evlist,
|
|||
goto out;
|
||||
}
|
||||
|
||||
evsel = evlist__id2evsel(evlist, sample.id);
|
||||
evsel = sample.evsel;
|
||||
if (!evsel)
|
||||
evsel = evlist__id2evsel(evlist, sample.id);
|
||||
|
||||
if (evsel == switch_tracking->switch_evsel) {
|
||||
next_tid = perf_sample__intval(&sample, "next_pid");
|
||||
prev_tid = perf_sample__intval(&sample, "prev_pid");
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user