aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/session.c
diff options
context:
space:
mode:
authorAdrian Hunter <adrian.hunter@intel.com>2021-02-18 11:57:55 +0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2021-02-18 16:14:14 -0300
commitfcda5ff711d9ddb7a92fff38b2cc153be8123c0e (patch)
tree5141bb8f61b510a103e4713f0fb31d28d98711e2 /tools/perf/util/session.c
parentperf intel-pt: Amend decoder to track the NR flag (diff)
downloadlinux-dev-fcda5ff711d9ddb7a92fff38b2cc153be8123c0e.tar.xz
linux-dev-fcda5ff711d9ddb7a92fff38b2cc153be8123c0e.zip
perf machine: Factor out machines__find_guest()
Factor out machines__find_guest() so it can be re-used. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Acked-by: Andi Kleen <ak@linux.intel.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Jiri Olsa <jolsa@redhat.com> Link: https://lore.kernel.org/r/20210218095801.19576-6-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to '')
-rw-r--r--tools/perf/util/session.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index f4aeb1af05d8..7b0d0c9e3dd1 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -1356,8 +1356,6 @@ static struct machine *machines__find_for_cpumode(struct machines *machines,
union perf_event *event,
struct perf_sample *sample)
{
- struct machine *machine;
-
if (perf_guest &&
((sample->cpumode == PERF_RECORD_MISC_GUEST_KERNEL) ||
(sample->cpumode == PERF_RECORD_MISC_GUEST_USER))) {
@@ -1369,10 +1367,7 @@ static struct machine *machines__find_for_cpumode(struct machines *machines,
else
pid = sample->pid;
- machine = machines__find(machines, pid);
- if (!machine)
- machine = machines__findnew(machines, DEFAULT_GUEST_KERNEL_ID);
- return machine;
+ return machines__find_guest(machines, pid);
}
return &machines->host;