[tip:perf/core] perf session: Remove wrappers to machines__find

From: tip-bot for Arnaldo Carvalho de Melo
Date: Thu Feb 26 2015 - 06:34:10 EST


Commit-ID: 54245fdc357613633954bfd38cffb71cb9def067
Gitweb: http://git.kernel.org/tip/54245fdc357613633954bfd38cffb71cb9def067
Author: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
AuthorDate: Sat, 14 Feb 2015 14:26:15 -0300
Committer: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
CommitDate: Sun, 22 Feb 2015 22:22:41 -0300

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 <adrian.hunter@xxxxxxxxx>
Cc: Borislav Petkov <bp@xxxxxxx>
Cc: David Ahern <dsahern@xxxxxxxxx>
Cc: Don Zickus <dzickus@xxxxxxxxxx>
Cc: Frederic Weisbecker <fweisbec@xxxxxxxxx>
Cc: Jiri Olsa <jolsa@xxxxxxxxxx>
Cc: Mike Galbraith <efault@xxxxxx>
Cc: Namhyung Kim <namhyung@xxxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Cc: Stephane Eranian <eranian@xxxxxxxxxx>
Link: http://lkml.kernel.org/n/tip-rn4pk3pjxd78sgzrkn19tktp@xxxxxxxxxxxxxx
Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
---
tools/perf/util/session.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 504b7e6..fac08e1 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -797,8 +797,7 @@ static void dump_sample(struct perf_evsel *evsel, union perf_event *event,
sample_read__printf(sample, evsel->attr.read_format);
}

-static struct machine *
- perf_session__find_machine_for_cpumode(struct perf_session *session,
+static struct machine *machines__find_for_cpumode(struct machines *machines,
union perf_event *event,
struct perf_sample *sample)
{
@@ -816,14 +815,13 @@ static struct machine *
else
pid = sample->pid;

- machine = perf_session__find_machine(session, pid);
+ machine = machines__find(machines, pid);
if (!machine)
- machine = perf_session__findnew_machine(session,
- DEFAULT_GUEST_KERNEL_ID);
+ machine = machines__find(machines, DEFAULT_GUEST_KERNEL_ID);
return machine;
}

- return &session->machines.host;
+ return &machines->host;
}

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

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

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

switch (event->header.type) {
case PERF_RECORD_SAMPLE:
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/