Commit a088031c authored by Adrian Hunter's avatar Adrian Hunter Committed by Arnaldo Carvalho de Melo

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: default avatarAdrian 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.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 67322d13
...@@ -299,6 +299,8 @@ struct machine *machines__add(struct machines *machines, pid_t pid, ...@@ -299,6 +299,8 @@ struct machine *machines__add(struct machines *machines, pid_t pid,
rb_link_node(&machine->rb_node, parent, p); rb_link_node(&machine->rb_node, parent, p);
rb_insert_color_cached(&machine->rb_node, &machines->guests, leftmost); rb_insert_color_cached(&machine->rb_node, &machines->guests, leftmost);
machine->machines = machines;
return machine; return machine;
} }
......
...@@ -18,6 +18,7 @@ struct symbol; ...@@ -18,6 +18,7 @@ struct symbol;
struct target; struct target;
struct thread; struct thread;
union perf_event; union perf_event;
struct machines;
/* Native host kernel uses -1 as pid index in machine */ /* Native host kernel uses -1 as pid index in machine */
#define HOST_KERNEL_ID (-1) #define HOST_KERNEL_ID (-1)
...@@ -59,6 +60,7 @@ struct machine { ...@@ -59,6 +60,7 @@ struct machine {
void *priv; void *priv;
u64 db_id; u64 db_id;
}; };
struct machines *machines;
bool trampolines_mapped; bool trampolines_mapped;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment