diff options
author | Adrian Hunter <adrian.hunter@intel.com> | 2022-05-17 16:10:06 +0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2022-05-23 10:18:06 -0300 |
commit | a088031c4998297c86a06d925cc0f38508205950 (patch) | |
tree | 92dd5cccf3a4c3a6484193f23fe3a98a85e5bf6d /tools/perf/util/machine.c | |
parent | 67322d13fe3043c81b54b7efa919b800e3d4374a (diff) | |
download | lwn-a088031c4998297c86a06d925cc0f38508205950.tar.gz lwn-a088031c4998297c86a06d925cc0f38508205950.zip |
perf tools: Add machine to machines back pointer
When dealing with guest machines, it can be necessary to get a reference
to the host machine. Add a machines pointer to struct machine to make that
possible.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: kvm@vger.kernel.org
Link: https://lore.kernel.org/r/20220517131011.6117-2-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/machine.c')
-rw-r--r-- | tools/perf/util/machine.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index 95391236f5f6..e96f6ea4fd82 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c @@ -299,6 +299,8 @@ struct machine *machines__add(struct machines *machines, pid_t pid, rb_link_node(&machine->rb_node, parent, p); rb_insert_color_cached(&machine->rb_node, &machines->guests, leftmost); + machine->machines = machines; + return machine; } |