1 /*******************************************************************************
2 * Copyright (c) 2014 École Polytechnique de Montréal
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * Geneviève Bastien - Initial API and implementation
11 *******************************************************************************/
13 package org
.eclipse
.tracecompass
.internal
.lttng2
.kernel
.core
.analysis
.vm
.model
;
17 import org
.eclipse
.jdt
.annotation
.Nullable
;
18 import org
.eclipse
.tracecompass
.analysis
.os
.linux
.core
.model
.HostThread
;
19 import org
.eclipse
.tracecompass
.tmf
.core
.event
.ITmfEvent
;
22 * Interface that represents the model of an hypervisor. Each hypervisor (or
23 * tracing method for an hypervisor) should implement this.
25 * @author Geneviève Bastien
27 public interface IVirtualMachineModel
{
30 * Get the machine that ran this event
34 * @return The machine this event was run on or {@code null} if the machine
35 * is not one belonging to this model.
38 VirtualMachine
getCurrentMachine(ITmfEvent event
);
41 * Get a the set of events required for this model to apply.
43 * TODO: This should be updated to something else to fit the event layout
46 * @return The set of required events for this model
48 Set
<String
> getRequiredEvents();
51 * Get the virtual CPU that is entering hypervisor mode with this event.
53 * "Hypervisor mode" means the virtual CPU of the guest is running on the
54 * host, but it is not running code from the guest, but rather other tasks
55 * from the hypervisor. When hypervisor mode is entered, the process on the
56 * host stops running guest code, so from the guest point of view, the
57 * thread running on this CPU is preempted.
60 * The event being handled
62 * The current thread this event belongs to
63 * @return The virtual CPU entering hypervisor mode or {@code null} if the
64 * hypervisor is not being entered with this event.
67 VirtualCPU
getVCpuEnteringHypervisorMode(ITmfEvent event
, HostThread ht
);
70 * Get the virtual CPU that is exiting hypervisor mode with this event.
72 * "Hypervisor mode" means the virtual CPU of the guest is running on the
73 * host, but it is not running code from the guest, but rather other tasks
74 * from the hypervisor. When hypervisor mode is exited, the process on the
75 * host runs guest code, so from the guest point of view, the thread running
76 * on this CPU is actively running.
79 * The event being handled
81 * The current thread this event belongs to
82 * @return The virutal CPU exiting hypervisor mode or {@code null} if the
83 * hypervisor is not exiting with this event.
86 VirtualCPU
getVCpuExitingHypervisorMode(ITmfEvent event
, HostThread ht
);
89 * Get the virtual CPU from a guest that corresponds to a specific thread
93 * The event being handled
95 * The current thread this event belongs to. This thread should
96 * be running on the host.
97 * @return The virtual CPU corresponding to this thread or {@code null} if
98 * no virtual CPU corresponds to the thread
101 VirtualCPU
getVirtualCpu(HostThread ht
);
104 * Handles the event. This method will be called for each event required or
105 * optional by the analysis, before any other handling is done on this
108 * This is where each implementation of the model will build itself,
109 * determine which guests are running on which hosts and get the necessary
110 * information to be able to return the virtual CPUs requested by the other
111 * methods of this interface.
114 * The event being handled. It can come from any trace in the
117 void handleEvent(ITmfEvent event
);
This page took 0.032843 seconds and 5 git commands to generate.