Skip to content

Commit

Permalink
execution comparison: resolving issues
Browse files Browse the repository at this point in the history
changes required considering the changes in trace compass core(
method getweigth(statistic type) from AggregatedCalledFunction is eliminated.
mthode refreshMouseProver from Tmfxychartviewer ie eliminated)

paramerticWeigthedTreeUtils is modified to use getSelfTime() and getweigth()
instead of get weigth(Statistic type)

ExecutionComparisonView and MultipleEventDensityViewer are changed to
reflect time ranges selection in event density charts without using
the method refreshMouseProvider().

Resolving Race condition

Eliminating unnecessary dependencies

and other issues

Signed-off-by: fariba <[email protected]>
  • Loading branch information
farajidaneshgar authored and Vlad Arama committed Jul 18, 2024
1 parent e8dccee commit b46224f
Show file tree
Hide file tree
Showing 29 changed files with 170 additions and 231 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.eclipse.tracecompass.incubator.executioncomparision.core.tests</name>
<name>org.eclipse.tracecompass.incubator.executioncomparison.core.tests</name>
<comment></comment>
<projects>
</projects>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-Vendor: %Bundle-Vendor
Bundle-SymbolicName: org.eclipse.tracecompass.incubator.executioncomparision.core.tests
Bundle-SymbolicName: org.eclipse.tracecompass.incubator.executioncomparison.core.tests
Bundle-Version: 0.1.0.qualifier
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.core.resources,
org.eclipse.tracecompass.common.core,
org.eclipse.tracecompass.incubator.executioncomparision.core,
org.eclipse.tracecompass.incubator.executioncomparison.core,
org.junit,
org.eclipse.jdt.annotation;bundle-version="[2.0.0,3.0.0)";resolution:=optional
Export-Package: org.eclipse.tracecompass.incubator.executioncomparision.core.tests
Export-Package: org.eclipse.tracecompass.incubator.executioncomparison.core.tests
Automatic-Module-Name: org.eclipse.tracecompass.incubator.executioncomparision.core.tests
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2022 École Polytechnique de Montréal
* Copyright (c) 2024 École Polytechnique de Montréal
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License 2.0 which
Expand All @@ -9,7 +9,7 @@
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/

package org.eclipse.tracecompass.incubator.executioncomparision.core.tests;
package org.eclipse.tracecompass.incubator.executioncomparison.core.tests;

import static org.junit.Assert.assertEquals;

Expand All @@ -21,7 +21,7 @@
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Plugin;
import org.eclipse.tracecompass.common.core.TraceCompassActivator;
import org.eclipse.tracecompass.incubator.internal.executioncomparision.core.Activator;
import org.eclipse.tracecompass.incubator.internal.executioncomparison.core.Activator;
import org.junit.Test;
import org.osgi.framework.BundleContext;

Expand All @@ -39,7 +39,7 @@ public class ActivatorTest extends Plugin {
/**
* The plug-in ID
*/
public static final String PLUGIN_ID = "org.eclipse.tracecompass.incubator.executioncomparision.core.tests"; //$NON-NLS-1$
public static final String PLUGIN_ID = "org.eclipse.tracecompass.incubator.executioncomparison.core.tests"; //$NON-NLS-1$

/**
* The shared instance
Expand Down Expand Up @@ -91,7 +91,7 @@ public void stop(BundleContext context) throws Exception {
@Test
public void testActivator() {
TraceCompassActivator instance = Activator.getInstance();
assertEquals("org.eclipse.tracecompass.incubator.executioncomparision.core", instance.getPluginId());
assertEquals("org.eclipse.tracecompass.incubator.executioncomparison.core", instance.getPluginId());
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.eclipse.tracecompass.incubator.executioncomparision.core</name>
<name>org.eclipse.tracecompass.incubator.executioncomparison.core</name>
<comment></comment>
<projects>
</projects>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-Vendor: %Bundle-Vendor
Bundle-SymbolicName: org.eclipse.tracecompass.incubator.executioncomparision.core;singleton:=true
Bundle-SymbolicName: org.eclipse.tracecompass.incubator.executioncomparison.core;singleton:=true
Bundle-Version: 0.1.0.qualifier
Bundle-Localization: plugin
Bundle-Activator: org.eclipse.tracecompass.incubator.internal.executioncomparision.core.Activator
Bundle-Activator: org.eclipse.tracecompass.incubator.internal.executioncomparison.core.Activator
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-17
Require-Bundle: org.eclipse.core.runtime,
Expand All @@ -22,11 +22,10 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.tracecompass.lttng2.ust.core,
org.eclipse.tracecompass.analysis.os.linux.core,
org.eclipse.tracecompass.analysis.profiling.core,
org.eclipse.tracecompass.incubator.callstack.core,
org.eclipse.tracecompass.incubator.traceevent.core,
org.eclipse.jdt.annotation
Export-Package: org.eclipse.tracecompass.incubator.internal.executioncomparision.core;x-friends:="org.eclipse.tracecompass.incubator.executioncomparision.ui,org.eclipse.tracecompass.incubator.executioncomparision.core.tests"
Automatic-Module-Name: org.eclipse.tracecompass.incubator.executioncomparision.core
Export-Package: org.eclipse.tracecompass.incubator.internal.executioncomparison.core;x-friends:="org.eclipse.tracecompass.incubator.executioncomparison.core.tests,org.eclipse.tracecompass.incubator.executioncomparison.ui"
Automatic-Module-Name: org.eclipse.tracecompass.incubator.executioncomparison.core
Import-Package: com.google.common.annotations,
com.google.common.base,
com.google.common.cache,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<extension
point="org.eclipse.linuxtools.tmf.core.analysis">
<module
analysis_module="org.eclipse.tracecompass.incubator.internal.executioncomparision.core.DifferentialSeqCallGraphAnalysis"
analysis_module="org.eclipse.tracecompass.incubator.internal.executioncomparison.core.DifferentialSeqCallGraphAnalysis"
applies_experiment="false"
automatic="false"
id="org.eclipse.tracecompass.incubator.executioncomparision.diffcallgraph"
id="org.eclipse.tracecompass.incubator.executioncomparison.diffcallgraph"
name="Execution Comparison">
<tracetype
applies="true"
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2022 École Polytechnique de Montréal
* Copyright (c) 2024 École Polytechnique de Montréal
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License 2.0 which
Expand All @@ -9,7 +9,7 @@
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/

package org.eclipse.tracecompass.incubator.internal.executioncomparision.core;
package org.eclipse.tracecompass.incubator.internal.executioncomparison.core;

import org.eclipse.tracecompass.common.core.TraceCompassActivator;

Expand All @@ -19,7 +19,7 @@
public class Activator extends TraceCompassActivator {

/** The plug-in ID */
public static final String PLUGIN_ID = "org.eclipse.tracecompass.incubator.executioncomparision.core"; //$NON-NLS-1$
public static final String PLUGIN_ID = "org.eclipse.tracecompass.incubator.executioncomparison.core"; //$NON-NLS-1$

/**
* The constructor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2023 École Polytechnique de Montréal
* Copyright (c) 2024 École Polytechnique de Montréal
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License 2.0 which
Expand All @@ -9,7 +9,7 @@
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/

package org.eclipse.tracecompass.incubator.internal.executioncomparision.core;
package org.eclipse.tracecompass.incubator.internal.executioncomparison.core;

import java.util.Collection;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2023 École Polytechnique de Montréal
* Copyright (c) 2024 École Polytechnique de Montréal
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License 2.0 which
Expand All @@ -9,7 +9,7 @@
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/

package org.eclipse.tracecompass.incubator.internal.executioncomparision.core;
package org.eclipse.tracecompass.incubator.internal.executioncomparison.core;

import java.util.Collections;
import java.util.HashMap;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2023 École Polytechnique de Montréal
* Copyright (c) 2024 École Polytechnique de Montréal
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License 2.0 which
Expand All @@ -9,7 +9,7 @@
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/

package org.eclipse.tracecompass.incubator.internal.executioncomparision.core;
package org.eclipse.tracecompass.incubator.internal.executioncomparison.core;

import java.util.ArrayList;
import java.util.Collection;
Expand Down Expand Up @@ -70,7 +70,7 @@ public class DifferentialSeqCallGraphAnalysis extends TmfAbstractAnalysisModule
/**
* The ID
*/
public static final String ID = "org.eclipse.tracecompass.incubator.executioncomparision.diffcallgraph"; //$NON-NLS-1$
public static final String ID = "org.eclipse.tracecompass.incubator.executioncomparison.diffcallgraph"; //$NON-NLS-1$
private static final Logger LOGGER = TraceCompassLog.getLogger(DifferentialSeqCallGraphAnalysis.class);

private static final String MERGE = "Merge"; //$NON-NLS-1$
Expand Down Expand Up @@ -106,13 +106,13 @@ public void refreshDiffCG(@Nullable IProgressMonitor monitor) {
try (ScopeLog sl = new ScopeLog(LOGGER, Level.CONFIG, "DifferentialSequenceCGA::refresh()")) { //$NON-NLS-1$
Collection<WeightedTree<ICallStackSymbol>> originalTree = new ArrayList<>();
Collection<WeightedTree<ICallStackSymbol>> diffTree = new ArrayList<>();
WeightedTreeSet<ICallStackSymbol, Object> callGraphA = mergeCallGraph(fStartA, fEndA, fTraceListA);
WeightedTreeSet<ICallStackSymbol, Object> callGraphA = mergeCallGraph(fStartA, fEndA, getTraceListA());
Collection<@NonNull ?> processes = callGraphA.getTreesForNamed(MERGE);
for (Object process : processes) {
originalTree.add((AggregatedCalledFunction) process);
}

WeightedTreeSet<ICallStackSymbol, Object> callGraphB = mergeCallGraph(fStartB, fEndB, fTraceListB);
WeightedTreeSet<ICallStackSymbol, Object> callGraphB = mergeCallGraph(fStartB, fEndB, getTraceListB());
processes = callGraphB.getTreesForNamed(MERGE);
for (Object process : processes) {
diffTree.add((AggregatedCalledFunction) process);
Expand Down Expand Up @@ -228,7 +228,7 @@ public IWeightedTreeSet<ICallStackSymbol, Object, DifferentialWeightedTree<ICall
public AggregatedCalledFunction mergeCG(AggregatedCalledFunction cg1, AggregatedCalledFunction cg2) {
AggregatedCalledFunction merged = cg1.copyOf();
merged.meanData(cg2);
/// As the merge function in Weighted tree adds the values og two trees,
/// As the merge function in Weighted tree adds the values of two trees,
/// we need to divide them by 2.
return merged;

Expand Down Expand Up @@ -305,19 +305,21 @@ public void selectionRangeUpdated(TmfComparisonFilteringUpdatedSignal signal) {
// tuning fTraceList
List<String> traceListA = signal.getTraceListA();
if (traceListA != null) {
fTraceListA.clear();
for (String name : signal.getTraceListA()) {
fTraceListA.add(name);

List<String> synchronizedListA = Collections.synchronizedList(fTraceListA);
synchronized (synchronizedListA) {
synchronizedListA.clear();
for (String name : traceListA) {
synchronizedListA.add(name);
}
}

}
List<String> traceListB = signal.getTraceListB();
if (traceListB != null) {
fTraceListB.clear();
for (String name : signal.getTraceListB()) {
fTraceListB.add(name);

List<String> synchronizedListB = Collections.synchronizedList(fTraceListB);
synchronizedListB.clear();
for (String name : traceListB) {
synchronizedListB.add(name);
}

}
Expand Down Expand Up @@ -379,5 +381,12 @@ private static ITmfTrace getTrace(String traceName) {
}
return null;
}
private List<String> getTraceListA() {
return new ArrayList<>(fTraceListA);
}

private List<String> getTraceListB() {
return new ArrayList<>(fTraceListB);
}

}
Loading

0 comments on commit b46224f

Please sign in to comment.