summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/thread.h
diff options
context:
space:
mode:
authorAdrian Hunter <adrian.hunter@intel.com>2022-07-11 11:31:55 +0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2022-07-20 16:08:04 +0200
commit797efbc523b37de29dc533a8561d34b97deb42e4 (patch)
tree1fdfa09a245109903781b272162fa21acea03802 /tools/perf/util/thread.h
parentperf session: Create guest machines from id_index (diff)
downloadlinux-797efbc523b37de29dc533a8561d34b97deb42e4.tar.xz
linux-797efbc523b37de29dc533a8561d34b97deb42e4.zip
perf tools: Add guest_cpu to hypervisor threads
It is possible to know which guest machine was running at a point in time based on the PID of the currently running host thread. That is, perf identifies guest machines by the PID of the hypervisor. To determine the guest CPU, put it on the hypervisor (QEMU) thread for that VCPU. This is done when processing the id_index which provides the necessary information. 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: Namhyung Kim <namhyung@kernel.org> Cc: kvm@vger.kernel.org Link: https://lore.kernel.org/r/20220711093218.10967-13-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/thread.h')
-rw-r--r--tools/perf/util/thread.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/perf/util/thread.h b/tools/perf/util/thread.h
index b066fb30d203..241f300d7d6e 100644
--- a/tools/perf/util/thread.h
+++ b/tools/perf/util/thread.h
@@ -39,6 +39,7 @@ struct thread {
pid_t tid;
pid_t ppid;
int cpu;
+ int guest_cpu; /* For QEMU thread */
refcount_t refcnt;
bool comm_set;
int comm_len;