Skip to content

Commit db9b17f

Browse files
committed
vm: fixed review comments
Signed-off-by: philippe <beliasossim@gmail.com>
1 parent 1a084ee commit db9b17f

38 files changed

Lines changed: 588 additions & 1689 deletions

File tree

analyses/org.eclipse.tracecompass.incubator.executioncomparison.core/src/org/eclipse/tracecompass/incubator/internal/executioncomparison/core/DifferentialSeqCallGraphAnalysis.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,6 @@ public DifferentialSeqCallGraphAnalysis() {
9797
// Adding VM/Native analysis
9898
fCallStackAnalysisMap.put("org.eclipse.linuxtools.lttng2.kernel.tracetype", //$NON-NLS-1$
9999
"org.eclipse.tracecompass.incubator.internal.virtual.machine.analysis.core.flow.analysis.vm.native.callstack"); //$NON-NLS-1$
100-
101-
/*fCallStackAnalysisMap.put("org.eclipse.tracecompass.tmf.core.experiment", //$NON-NLS-1$
102-
"org.eclipse.tracecompass.incubator.overhead.core.analysis.vm.native.callstack"); //$NON-NLS-1$*/
103100
}
104101

105102
/**

callstack/org.eclipse.tracecompass.incubator.analysis.core/.settings/org.eclipse.m2e.core.prefs

Lines changed: 0 additions & 4 deletions
This file was deleted.

vm/org.eclipse.tracecompass.incubator.virtual.machine.analysis.core/plugin.xml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,10 @@
6363
class="org.eclipse.tracecompass.tmf.core.trace.TmfTrace">
6464
</tracetype>
6565
</module>
66-
<module
67-
analysis_module="org.eclipse.tracecompass.incubator.internal.virtual.machine.analysis.core.flow.analysis.VMNativeComparisonAnalysis"
68-
id="org.eclipse.tracecompass.incubator.internal.virtual.machine.analysis.core.flow.analysis.vmcomparison"
69-
name="VM vs Native Comparison">
70-
<tracetype
71-
class="org.eclipse.tracecompass.tmf.core.trace.experiment.TmfExperiment">
72-
</tracetype>
73-
</module>
7466
<module
7567
analysis_module="org.eclipse.tracecompass.incubator.internal.virtual.machine.analysis.core.flow.analysis.VMNativeCallStackAnalysis"
7668
applies_experiment="true"
69+
automatic="false"
7770
id="org.eclipse.tracecompass.incubator.internal.virtual.machine.analysis.core.flow.analysis.vm.native.callstack"
7871
name="VM Native CallStack">
7972
<tracetype

vm/org.eclipse.tracecompass.incubator.virtual.machine.analysis.core/src/org/eclipse/tracecompass/incubator/internal/virtual/machine/analysis/core/flow/analysis/ExecutionSequence.java

Lines changed: 10 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2026 École Polytechnique de Montréal
3+
*
4+
* All rights reserved. This program and the accompanying materials are
5+
* made available under the terms of the Eclipse Public License 2.0 which
6+
* accompanies this distribution, and is available at
7+
* https://www.eclipse.org/legal/epl-2.0/
8+
*
9+
* SPDX-License-Identifier: EPL-2.0
10+
*******************************************************************************/
111
package org.eclipse.tracecompass.incubator.internal.virtual.machine.analysis.core.flow.analysis;
212

313
import java.util.ArrayList;
414
import java.util.List;
5-
import java.io.File;
6-
import java.io.FileOutputStream;
7-
import java.io.IOException;
8-
import java.io.PrintWriter;
915

1016
/**
1117
* Represents a complete execution sequence in a virtualized environment:
@@ -82,78 +88,6 @@ void setVmEntry(FlowEvent event) {
8288
this.vmEntry = event;
8389
}
8490

85-
/**
86-
* Prints the execution sequence for debugging purposes.
87-
* <p>
88-
* The sequence is printed both to the standard output and appended
89-
* to a file on disk.
90-
* </p>
91-
*
92-
* @throws IOException
93-
* if an I/O error occurs while writing to the file
94-
*/
95-
void printSequence() throws IOException {
96-
try (
97-
FileOutputStream fos = new FileOutputStream(
98-
new File("/home/philippe/Desktop/virtualized_flow.txt"), true); //$NON-NLS-1$
99-
PrintWriter writer = new PrintWriter(fos)) {
100-
101-
// Print guest events
102-
for (FlowEvent guestEvent : guestEvents) {
103-
KernelEventInfo evt = guestEvent.kernelEvent;
104-
System.out.printf(" [GUEST] %s (TID:%d, CPU:%d)\n", evt.name, evt.tid, evt.cpuid); //$NON-NLS-1$
105-
writer.printf(" [GUEST] %s (TID:%d, CPU:%d)\n", evt.name, evt.tid, evt.cpuid); //$NON-NLS-1$
106-
}
107-
108-
// Print VM exit
109-
if (vmExit != null) {
110-
System.out.printf(" ↓ [VM_EXIT] %s (CPU:%d, VCPU:%d, exit_reason:%s)\n", //$NON-NLS-1$
111-
vmExit.kernelEvent.name,
112-
vmExit.kernelEvent.cpuid,
113-
vmExit.kernelEvent.vcpuid,
114-
vmExit.kernelEvent.exitReason);
115-
116-
writer.printf(" ↓ [VM_EXIT] %s (CPU:%d, VCPU:%d, exit_reason:%s)\n", //$NON-NLS-1$
117-
vmExit.kernelEvent.name,
118-
vmExit.kernelEvent.cpuid,
119-
vmExit.kernelEvent.vcpuid,
120-
vmExit.kernelEvent.exitReason);
121-
}
122-
123-
// Print hypervisor events
124-
for (FlowEvent hypervisorEvent : hypervisorEvents) {
125-
KernelEventInfo evt = hypervisorEvent.kernelEvent;
126-
System.out.printf(" [HOST] %s (PID:%d, CPU:%d)\n", //$NON-NLS-1$
127-
evt.name, evt.pid, evt.cpuid);
128-
129-
writer.printf(" [HOST] %s (PID:%d, CPU:%d)\n", //$NON-NLS-1$
130-
evt.name, evt.pid, evt.cpuid);
131-
}
132-
133-
// Print VM entry
134-
if (vmEntry != null) {
135-
System.out.printf(" ↑ [VM_ENTRY] %s (CPU:%d, VCPU:%d)\n", //$NON-NLS-1$
136-
vmEntry.kernelEvent.name,
137-
vmEntry.kernelEvent.cpuid,
138-
vmEntry.kernelEvent.vcpuid);
139-
140-
writer.printf(" ↑ [VM_ENTRY] %s (CPU:%d, VCPU:%d)\n", //$NON-NLS-1$
141-
vmEntry.kernelEvent.name,
142-
vmEntry.kernelEvent.cpuid,
143-
vmEntry.kernelEvent.vcpuid);
144-
}
145-
146-
// Print timing summary
147-
if (!guestEvents.isEmpty() && vmEntry != null) {
148-
long totalDuration = vmEntry.kernelEvent.timestamp
149-
- guestEvents.get(0).kernelEvent.timestamp;
150-
151-
System.out.printf(" Total sequence duration: %d µs\n", totalDuration / 1000); //$NON-NLS-1$
152-
writer.printf(" Total sequence duration: %d µs\n", totalDuration / 1000); //$NON-NLS-1$
153-
}
154-
}
155-
}
156-
15791
/**
15892
* Indicates whether the execution sequence is complete.
15993
* <p>

vm/org.eclipse.tracecompass.incubator.virtual.machine.analysis.core/src/org/eclipse/tracecompass/incubator/internal/virtual/machine/analysis/core/flow/analysis/ExitReasonMap.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2026 École Polytechnique de Montréal
3+
*
4+
* All rights reserved. This program and the accompanying materials are
5+
* made available under the terms of the Eclipse Public License 2.0 which
6+
* accompanies this distribution, and is available at
7+
* https://www.eclipse.org/legal/epl-2.0/
8+
*
9+
* SPDX-License-Identifier: EPL-2.0
10+
*******************************************************************************/
111
package org.eclipse.tracecompass.incubator.internal.virtual.machine.analysis.core.flow.analysis;
212

313
import java.util.HashMap;
@@ -6,6 +16,7 @@
616

717
/**
818
* Mapping of Exit reason number to their text description
19+
*
920
* @author Francois Belias
1021
*/
1122
public class ExitReasonMap {

vm/org.eclipse.tracecompass.incubator.virtual.machine.analysis.core/src/org/eclipse/tracecompass/incubator/internal/virtual/machine/analysis/core/flow/analysis/FlowEvent.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2026 École Polytechnique de Montréal
3+
*
4+
* All rights reserved. This program and the accompanying materials are
5+
* made available under the terms of the Eclipse Public License 2.0 which
6+
* accompanies this distribution, and is available at
7+
* https://www.eclipse.org/legal/epl-2.0/
8+
*
9+
* SPDX-License-Identifier: EPL-2.0
10+
*******************************************************************************/
111
package org.eclipse.tracecompass.incubator.internal.virtual.machine.analysis.core.flow.analysis;
212

313
/**

vm/org.eclipse.tracecompass.incubator.virtual.machine.analysis.core/src/org/eclipse/tracecompass/incubator/internal/virtual/machine/analysis/core/flow/analysis/KernelEventInfo.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2026 École Polytechnique de Montréal
3+
*
4+
* All rights reserved. This program and the accompanying materials are
5+
* made available under the terms of the Eclipse Public License 2.0 which
6+
* accompanies this distribution, and is available at
7+
* https://www.eclipse.org/legal/epl-2.0/
8+
*
9+
* SPDX-License-Identifier: EPL-2.0
10+
*******************************************************************************/
111
package org.eclipse.tracecompass.incubator.internal.virtual.machine.analysis.core.flow.analysis;
212

313

vm/org.eclipse.tracecompass.incubator.virtual.machine.analysis.core/src/org/eclipse/tracecompass/incubator/internal/virtual/machine/analysis/core/flow/analysis/KvmExitAnalysisModule.java

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1-
/***********************************************************************
2-
* KVM Exit Analysis Module
3-
* This module analyzes and tracks KVM exit event per cpu
4-
***********************************************************************/
1+
/*******************************************************************************
2+
* Copyright (c) 2026 École Polytechnique de Montréal
3+
*
4+
* All rights reserved. This program and the accompanying materials are
5+
* made available under the terms of the Eclipse Public License 2.0 which
6+
* accompanies this distribution, and is available at
7+
* https://www.eclipse.org/legal/epl-2.0/
8+
*
9+
* SPDX-License-Identifier: EPL-2.0
10+
*******************************************************************************/
511

612
package org.eclipse.tracecompass.incubator.internal.virtual.machine.analysis.core.flow.analysis;
713

@@ -16,6 +22,8 @@
1622
/**
1723
* Analysis module that builds a state system from KVM exit events in a trace.
1824
* It tracks the number and types of VM exits for each CPU.
25+
*
26+
* @author Francois Belias
1927
*/
2028
public class KvmExitAnalysisModule extends TmfStateSystemAnalysisModule {
2129

vm/org.eclipse.tracecompass.incubator.virtual.machine.analysis.core/src/org/eclipse/tracecompass/incubator/internal/virtual/machine/analysis/core/flow/analysis/KvmExitStateProvider.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
21
/*******************************************************************************
3-
* KVM Exit State Provider
4-
* This state provider processes trace events related to KVM exits
2+
* Copyright (c) 2026 École Polytechnique de Montréal
3+
*
4+
* All rights reserved. This program and the accompanying materials are
5+
* made available under the terms of the Eclipse Public License 2.0 which
6+
* accompanies this distribution, and is available at
7+
* https://www.eclipse.org/legal/epl-2.0/
8+
*
9+
* SPDX-License-Identifier: EPL-2.0
510
*******************************************************************************/
6-
7-
8-
911
package org.eclipse.tracecompass.incubator.internal.virtual.machine.analysis.core.flow.analysis;
1012

1113

0 commit comments

Comments
 (0)