Comparing guest and host timelines
You can use information from trace events to compare timelines of events in the guest and the host.
t:0x2ebe7b16b CPU:00 QVM :GUEST_ENTER guest_ip:0x00000000fe087700
t:0x2ebe7c20c CPU:00 QVM :CYCLES
at_entry:0x0000000068ed5b7f
at_exit:0x0000000068ed620e
t:0x2ebe7c6f7 CPU:00 QVM :GUEST_EXIT
status:0x00000000
hw_reason:0x07e00000
clockcycles_offset:0xfffffffd7d05a4eb
guest_ip:0x00000000fc4047f0
payload:0x0000000000000000
Where:
status:0x00000000
indicates that the guest entry was successful, so the at_entry and at_exit values are meaningful (seeID 1 — guest exit
).at_entry:0x0000000068ed5b7f
is the value for the guest timestamp count just before the vCPU thread transitioned into the guest environment.at_exit:0x0000000068ed620e
is the guest timestamp count just after the vCPU thread transitioned out of the guest environment.clockcycles_offset:0xfffffffd7d05a4eb
is the clock-cycle offset between the guest view of the timestamp and the host view of the timestamp.
The host necessarily begins counting before the guest, so the host timestamp count will always be greater than the guest timestamp.
To obtain values that can be used for a meaningful comparison of when an event occurred for the guest with when it occurred for the host, you need to:
- Construct a timeline for the guest with at_entry/at_exit event pairs.
Construct a timeline for the host with the same at_entry/at_exit event pairs, combined with the value in clockcycles_offset at the guest exit.
As you construct your host timeline, note which event pair in the host corresponds to which event pair in the guest.
(0x0000000068ed5b7f - 0xfffffffd7d05a4eb) = 0x2ebe7b694
and:
(0x0000000068ed620e - 0xfffffffd7d05a4eb) = 0x2ebe7bd23
Remember that:
- The value of clockcycles_offset will vary due to time drift.
- Any ClockCycles() value outside the at_entry/at_exit intervals will never be observed by a guest.
For more information, go to Time
in the Understanding QNX Virtual Environments
chapter.