Skip to content

Commit 54245fd

Browse files
committed
perf session: Remove wrappers to machines__find
Start to untangle session from delivering samples, as there are tools that want to use ordered_events and don't use perf_session at all. Cc: Adrian Hunter <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: David Ahern <[email protected]> Cc: Don Zickus <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Mike Galbraith <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Stephane Eranian <[email protected]> Link: http://lkml.kernel.org/n/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent ddbb1b1 commit 54245fd

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

tools/perf/util/session.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -797,8 +797,7 @@ static void dump_sample(struct perf_evsel *evsel, union perf_event *event,
797797
sample_read__printf(sample, evsel->attr.read_format);
798798
}
799799

800-
static struct machine *
801-
perf_session__find_machine_for_cpumode(struct perf_session *session,
800+
static struct machine *machines__find_for_cpumode(struct machines *machines,
802801
union perf_event *event,
803802
struct perf_sample *sample)
804803
{
@@ -816,14 +815,13 @@ static struct machine *
816815
else
817816
pid = sample->pid;
818817

819-
machine = perf_session__find_machine(session, pid);
818+
machine = machines__find(machines, pid);
820819
if (!machine)
821-
machine = perf_session__findnew_machine(session,
822-
DEFAULT_GUEST_KERNEL_ID);
820+
machine = machines__find(machines, DEFAULT_GUEST_KERNEL_ID);
823821
return machine;
824822
}
825823

826-
return &session->machines.host;
824+
return &machines->host;
827825
}
828826

829827
static int deliver_sample_value(struct perf_session *session,
@@ -907,8 +905,7 @@ int perf_session__deliver_event(struct perf_session *session,
907905

908906
evsel = perf_evlist__id2evsel(session->evlist, sample->id);
909907

910-
machine = perf_session__find_machine_for_cpumode(session, event,
911-
sample);
908+
machine = machines__find_for_cpumode(&session->machines, event, sample);
912909

913910
switch (event->header.type) {
914911
case PERF_RECORD_SAMPLE:

0 commit comments

Comments
 (0)