Virtual machine execution tracing
First Claim
1. A method performed by a computing device comprising processing hardware and storage hardware, the method comprising:
- executing a virtualization layer that manages execution of a plurality of virtual machines on the processing hardware, the plurality of virtual machines comprising a first virtual machine comprising a respective first virtual processor and a respective first guest operating system and a second virtual machine comprising a respective second virtual processor and a respective second guest operating system;
switching, by the virtualization layer, to a first execution context of the first virtual machine, to enable the first guest operating system to issue a plurality of first instructions to the first virtual processor;
based on the plurality of first instructions being executed by the first virtual processor, recording first execution trace data comprising (i) the plurality of first instructions executed by the first virtual processor, (ii) first memory portions selected for tracing on the basis of the first memory portions storing inputs and/or outputs of the plurality of first instructions, and (iii) a plurality of first ordering markers inserted into the first execution trace data by the virtualization layer, each of the plurality of first ordering markers corresponding to a respective determination that a first orderable event has occurred between two or more of the plurality of first instructions;
switching, by the virtualization layer, to a second execution context of the second virtual machine, to enable the second guest operating system to issue a plurality of second instructions to the second virtual processor; and
based on the plurality of second instructions being executed by the second virtual processor, recording second execution trace data comprising (i) the plurality of second instructions executed by the second virtual processor, (ii) second memory portions selected for tracing on the basis of the second memory portions storing inputs and/or outputs of the plurality of second instructions, and (iii) a plurality of second ordering markers inserted into the second execution trace data by the virtualization layer, each of the plurality of second ordering markers corresponding to a respective determination that a second orderable event has occurred between two or more of the plurality of second instructions,wherein the plurality of first ordering markers and the plurality of second ordering markers also enable a determination of causality between the first orderable event at the first virtual machine and the second orderable event at the second virtual machine.
1 Assignment
0 Petitions
Accused Products
Abstract
Embodiments relate to a virtualization layer capturing replayable execution traces of VMs managed by the virtualization layer. Execution tracing can be performed on any unit of execution managed by the virtualization layer, e.g., threads, processes, virtual processors, individual VMs, multiple VMs, etc. Traced execution units may be executing in parallel. Execution tracing involves capturing to a buffer: executed instructions, memory inputted to instructions, memory outputted by instructions, registers touched by instructions, and ordering markers. Trace data can be captured in chunks, where causality is preserved and ordering is preserved between chunks but not necessarily within chunks. The chunks may be delineated by inserting monotonically increasing markers between context switches, thus relatively ordering the chunks. Determinism may be partially provided by identifying non-deterministic events. VM tracing may be transparent to guest software, which need not be instrumented. Alternatively, guests may interface with the virtualization layer to control tracing functionality.
138 Citations
20 Claims
-
1. A method performed by a computing device comprising processing hardware and storage hardware, the method comprising:
-
executing a virtualization layer that manages execution of a plurality of virtual machines on the processing hardware, the plurality of virtual machines comprising a first virtual machine comprising a respective first virtual processor and a respective first guest operating system and a second virtual machine comprising a respective second virtual processor and a respective second guest operating system; switching, by the virtualization layer, to a first execution context of the first virtual machine, to enable the first guest operating system to issue a plurality of first instructions to the first virtual processor; based on the plurality of first instructions being executed by the first virtual processor, recording first execution trace data comprising (i) the plurality of first instructions executed by the first virtual processor, (ii) first memory portions selected for tracing on the basis of the first memory portions storing inputs and/or outputs of the plurality of first instructions, and (iii) a plurality of first ordering markers inserted into the first execution trace data by the virtualization layer, each of the plurality of first ordering markers corresponding to a respective determination that a first orderable event has occurred between two or more of the plurality of first instructions; switching, by the virtualization layer, to a second execution context of the second virtual machine, to enable the second guest operating system to issue a plurality of second instructions to the second virtual processor; and based on the plurality of second instructions being executed by the second virtual processor, recording second execution trace data comprising (i) the plurality of second instructions executed by the second virtual processor, (ii) second memory portions selected for tracing on the basis of the second memory portions storing inputs and/or outputs of the plurality of second instructions, and (iii) a plurality of second ordering markers inserted into the second execution trace data by the virtualization layer, each of the plurality of second ordering markers corresponding to a respective determination that a second orderable event has occurred between two or more of the plurality of second instructions, wherein the plurality of first ordering markers and the plurality of second ordering markers also enable a determination of causality between the first orderable event at the first virtual machine and the second orderable event at the second virtual machine. - View Dependent Claims (2, 3, 4, 5, 6, 7)
-
-
8. A computer system comprising:
-
one or more processors; and one or more computer-readable media having stored thereon computer-executable instructions that are executable by the one or more processors to cause the computer to perform the following; execute a virtualization layer that manages execution of a plurality of virtual machines on the processing hardware, the plurality of virtual machines comprising a first virtual machine comprising a respective first virtual processor and a respective first guest operating system and a second virtual machine comprising a respective second virtual processor and a respective second guest operating system; switch, by the virtualization layer, to a first execution context of the first virtual machine, to enable the first guest operating system to issue a plurality of first instructions to the first virtual processor; based on the plurality of first instructions being executed by the first virtual processor, record first execution trace data comprising (i) the plurality of first instructions executed by the first virtual processor, (ii) first memory portions selected for tracing on the basis of the first memory portions storing inputs and/or outputs of the plurality of first instructions, and (iii) a plurality of first ordering markers inserted into the first execution trace data by the virtualization layer, each of the plurality of first ordering markers corresponding to a respective determination that a first orderable event has occurred between two or more of the plurality of first instructions; switch, by the virtualization layer, to a second execution context of the second virtual machine, to enable the second guest operating system to issue a plurality of second instructions to the second virtual processor; and based on the plurality of second instructions being executed by the second virtual processor, record second execution trace data comprising (i) the plurality of second instructions executed by the second virtual processor, (ii) second memory portions selected for tracing on the basis of the second memory portions storing inputs and/or outputs of the plurality of second instructions, and (iii) a plurality of second ordering markers inserted into the second execution trace data by the virtualization layer, each of the plurality of second ordering markers corresponding to a respective determination that a second orderable event has occurred between two or more of the plurality of second instructions, wherein the plurality of first ordering markers and the plurality of second ordering markers also enable a determination of causality between the first orderable event at the first virtual machine and the second orderable event at the second virtual machine. - View Dependent Claims (9, 10, 11, 12, 13, 14)
-
-
15. A computer program product comprising one or more hardware storage devices having stored thereon computer-executable instructions that are executable by one or more processors to cause a computer to perform the following:
-
execute a virtualization layer that manages execution of a plurality of virtual machines on the processing hardware, the plurality of virtual machines comprising a first virtual machine comprising a respective first virtual processor and a respective first guest operating system and a second virtual machine comprising a respective second virtual processor and a respective second guest operating system; switch, by the virtualization layer, to a first execution context of the first virtual machine, to enable the first guest operating system to issue a plurality of first instructions to the first virtual processor; based on the plurality of first instructions being executed by the first virtual processor, record first execution trace data comprising (i) the plurality of first instructions executed by the first virtual processor, (ii) first memory portions selected for tracing on the basis of the first memory portions storing inputs and/or outputs of the plurality of first instructions, and (iii) a plurality of first ordering markers inserted into the first execution trace data by the virtualization layer, each of the plurality of first ordering markers corresponding to a respective determination that a first orderable event has occurred between two or more of the plurality of first instructions; switch, by the virtualization layer, to a second execution context of the second virtual machine, to enable the second guest operating system to issue a plurality of second instructions to the second virtual processor; and based on the plurality of second instructions being executed by the second virtual processor, record second execution trace data comprising (i) the plurality of second instructions executed by the second virtual processor, (ii) second memory portions selected for tracing on the basis of the second memory portions storing inputs and/or outputs of the plurality of second instructions, and (iii) a plurality of second ordering markers inserted into the second execution trace data by the virtualization layer, each of the plurality of second ordering markers corresponding to a respective determination that a second orderable event has occurred between two or more of the plurality of second instructions, wherein the plurality of first ordering markers and the plurality of second ordering markers also enable a determination of causality between the first orderable event at the first virtual machine and the second orderable event at the second virtual machine. - View Dependent Claims (16, 17, 18, 19, 20)
-
Specification