]> git.baikalelectronics.ru Git - kernel.git/commit
perf tools: Add machine_pid and vcpu to id_index
authorAdrian Hunter <adrian.hunter@intel.com>
Mon, 11 Jul 2022 09:31:53 +0000 (12:31 +0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 20 Jul 2022 14:07:58 +0000 (11:07 -0300)
commit1318b26ec85084fe652ca94f874105cd3c9b42c9
tree457ad457fa1a80154ebb02f1ff0e3806ae4a70a5
parented05364c39e55085fae77adf12614664999be19b
perf tools: Add machine_pid and vcpu to id_index

When injecting events from a guest perf.data file, the events will have
separate sample ID numbers. These ID numbers can then be used to determine
which machine an event belongs to. To facilitate that, add machine_pid and
vcpu to id_index records. For backward compatibility, these are added at
the end of the record, and the length of the record is used to determine
if they are present or not.

Note, this is needed because the events from a guest perf.data file contain
the pid/tid of the process running at that time inside the VM not the
pid/tid of the (QEMU) hypervisor thread. So a way is needed to relate
guest events back to the guest machine and VCPU, and using sample ID
numbers for that is relatively simple and convenient.

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-11-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/lib/perf/include/internal/evsel.h
tools/lib/perf/include/perf/event.h
tools/perf/util/session.c
tools/perf/util/synthetic-events.c
tools/perf/util/synthetic-events.h