From: "Steven Rostedt (Google)" <rostedt@xxxxxxxxxxx> The guest CPU numbers may not match what the kvm enter/exit events show. This will prevent trace-cmd from saving what host threads map to which guest vcpu. Luckily, it seems that the mappings are sorted. That is, the vcpuX of kvm has the X in the same order as the CPUs numbers of the guest. And currently, the guests see consecutive numbers (not sparse). This adds a mapping between the vcpuX and the consective numbers that allows trace-cmd to find the host threads that map to the guests. Steven Rostedt (Google) (2): trace-cmd: Do not use KVM debug vcpu directories as the CPU mapping trace-cmd: Have the pid to vcpu mappings know about sparse maps lib/trace-cmd/trace-timesync-kvm.c | 104 ++++++++++++++++------------- tracecmd/trace-tsync.c | 100 ++++++++++++++++++++++++++- 2 files changed, 157 insertions(+), 47 deletions(-) -- 2.35.1