Skip to content

Commit

Permalink
traceevent: remove dependency on incubator callstack
Browse files Browse the repository at this point in the history
Signed-off-by: Arnaud Fiorini <fiorini.arnaud@gmail.com>
  • Loading branch information
arfio committed Apr 12, 2024
1 parent c7c95ad commit 64e7d63
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 27 deletions.
Expand Up @@ -12,12 +12,12 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.tracecompass.incubator.traceevent.core,
org.junit,
org.eclipse.tracecompass.tmf.core,
org.eclipse.tracecompass.incubator.callstack.core,
org.eclipse.tracecompass.jsontrace.core,
org.eclipse.jdt.annotation;bundle-version="[2.0.0,3.0.0)";resolution:=optional,
org.eclipse.tracecompass.statesystem.core.tests,
org.eclipse.tracecompass.tmf.core.tests,
org.eclipse.tracecompass.incubator.analysis.core,
org.eclipse.tracecompass.analysis.profiling.core,
org.eclipse.tracecompass.analysis.timing.core
Export-Package: org.eclipse.tracecompass.incubator.traceevent.core.tests
Import-Package: com.google.common.base,
Expand Down
Expand Up @@ -21,7 +21,7 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.tracecompass.analysis.os.linux.core.model.HostThread;
import org.eclipse.tracecompass.incubator.callstack.core.base.EdgeStateValue;
import org.eclipse.tracecompass.analysis.profiling.core.instrumented.EdgeStateValue;
import org.eclipse.tracecompass.incubator.internal.traceevent.core.analysis.callstack.TraceEventCallstackAnalysis;
import org.eclipse.tracecompass.incubator.internal.traceevent.core.trace.TraceEventTrace;
import org.eclipse.tracecompass.statesystem.core.ITmfStateSystem;
Expand Down
Expand Up @@ -24,7 +24,7 @@

import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.tracecompass.incubator.callstack.core.base.EdgeStateValue;
import org.eclipse.tracecompass.analysis.profiling.core.instrumented.EdgeStateValue;
import org.eclipse.tracecompass.incubator.internal.traceevent.core.analysis.callstack.TraceEventCallstackAnalysis;
import org.eclipse.tracecompass.incubator.internal.traceevent.core.trace.TraceEventTrace;
import org.eclipse.tracecompass.statesystem.core.ITmfStateSystem;
Expand Down
Expand Up @@ -13,7 +13,6 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.tracecompass.common.core,
org.eclipse.tracecompass.tmf.core,
org.eclipse.tracecompass.segmentstore.core,
org.eclipse.tracecompass.incubator.callstack.core,
org.eclipse.tracecompass.analysis.os.linux.core,
org.eclipse.tracecompass.incubator.analysis.core,
org.eclipse.tracecompass.analysis.counters.core,
Expand Down
Expand Up @@ -28,10 +28,10 @@
import org.eclipse.tracecompass.analysis.os.linux.core.event.aspect.LinuxPidAspect;
import org.eclipse.tracecompass.analysis.os.linux.core.event.aspect.LinuxTidAspect;
import org.eclipse.tracecompass.analysis.os.linux.core.model.HostThread;
import org.eclipse.tracecompass.incubator.analysis.core.model.IHostModel;
import org.eclipse.tracecompass.incubator.callstack.core.base.EdgeStateValue;
import org.eclipse.tracecompass.incubator.callstack.core.instrumented.statesystem.CallStackStateProvider;
import org.eclipse.tracecompass.incubator.callstack.core.instrumented.statesystem.InstrumentedCallStackAnalysis;
import org.eclipse.tracecompass.analysis.profiling.core.callstack.CallStackStateProvider;
import org.eclipse.tracecompass.analysis.profiling.core.instrumented.EdgeStateValue;
import org.eclipse.tracecompass.analysis.profiling.core.instrumented.InstrumentedCallStackAnalysis;
import org.eclipse.tracecompass.analysis.profiling.core.model.IHostModel;
import org.eclipse.tracecompass.incubator.internal.traceevent.core.event.ITraceEventConstants;
import org.eclipse.tracecompass.incubator.internal.traceevent.core.event.TraceEventAspects;
import org.eclipse.tracecompass.incubator.internal.traceevent.core.event.TraceEventField;
Expand All @@ -41,6 +41,8 @@
import org.eclipse.tracecompass.statesystem.core.exceptions.AttributeNotFoundException;
import org.eclipse.tracecompass.statesystem.core.exceptions.StateSystemDisposedException;
import org.eclipse.tracecompass.statesystem.core.interval.ITmfStateInterval;
import org.eclipse.tracecompass.statesystem.core.statevalue.ITmfStateValue;
import org.eclipse.tracecompass.statesystem.core.statevalue.TmfStateValue;
import org.eclipse.tracecompass.tmf.core.event.ITmfEvent;
import org.eclipse.tracecompass.tmf.core.event.aspect.ITmfEventAspect;
import org.eclipse.tracecompass.tmf.core.statesystem.TmfAttributePool;
Expand Down Expand Up @@ -223,9 +225,9 @@ protected boolean considerEvent(@NonNull ITmfEvent event) {
}

@Override
protected @Nullable Object functionEntry(@NonNull ITmfEvent event) {
protected @Nullable ITmfStateValue functionEntry(@NonNull ITmfEvent event) {
if (isEntry(event)) {
return event.getName();
return TmfStateValue.newValueString(event.getName());
}
return null;
}
Expand All @@ -236,9 +238,9 @@ private static boolean isEntry(ITmfEvent event) {
}

@Override
protected @Nullable Object functionExit(@NonNull ITmfEvent event) {
protected @Nullable ITmfStateValue functionExit(@NonNull ITmfEvent event) {
if (isExit(event)) {
return event.getName();
return TmfStateValue.newValueString(event.getName());
}
return null;
}
Expand Down Expand Up @@ -477,7 +479,7 @@ private static int getAvailableEdgeQuark(ITmfStateSystemBuilder ssb, long startT
}

private void handleStart(@NonNull ITmfEvent event, ITmfStateSystemBuilder ss, long timestamp, String processName) {
Object functionBeginName = functionEntry(event);
ITmfStateValue functionBeginName = functionEntry(event);
if (functionBeginName != null) {
int processQuark = ss.getQuarkAbsoluteAndAdd(PROCESSES, processName);
int pid = getProcessId(event);
Expand All @@ -492,7 +494,7 @@ private void handleStart(@NonNull ITmfEvent event, ITmfStateSystemBuilder ss, lo
ss.modifyAttribute(timestamp, threadId, threadQuark);

int callStackQuark = ss.getQuarkRelativeAndAdd(threadQuark, InstrumentedCallStackAnalysis.CALL_STACK);
ss.pushAttribute(timestamp, functionBeginName, callStackQuark);
ss.pushAttribute(timestamp, functionBeginName.unboxValue(), callStackQuark);
prepareNextSlice(ss, callStackQuark, timestamp);
}
}
Expand All @@ -505,8 +507,9 @@ private static void prepareNextSlice(ITmfStateSystemBuilder ss, int quark, long

private void handleEnd(@NonNull ITmfEvent event, ITmfStateSystemBuilder ss, long timestamp, String processName) {
/* Check if the event is a function exit */
Object functionExitName = functionExit(event);
if (functionExitName != null) {
ITmfStateValue functionExitState = functionExit(event);
if (functionExitState != null) {
String functionExitName = functionExitState.unboxStr();
String pName = processName;

if (pName == null) {
Expand Down
Expand Up @@ -16,7 +16,7 @@
import java.util.Objects;

import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.tracecompass.incubator.callstack.core.instrumented.statesystem.InstrumentedCallStackAnalysis;
import org.eclipse.tracecompass.analysis.profiling.core.instrumented.InstrumentedCallStackAnalysis;
import org.eclipse.tracecompass.statesystem.core.ITmfStateSystem;
import org.eclipse.tracecompass.tmf.core.analysis.requirements.TmfAbstractAnalysisRequirement;
import org.eclipse.tracecompass.tmf.core.statesystem.ITmfStateProvider;
Expand Down
Expand Up @@ -25,7 +25,6 @@
<import plugin="org.eclipse.tracecompass.common.core"/>
<import plugin="org.eclipse.tracecompass.tmf.core"/>
<import plugin="org.eclipse.tracecompass.segmentstore.core"/>
<import plugin="org.eclipse.tracecompass.incubator.callstack.core"/>
<import plugin="org.eclipse.tracecompass.analysis.os.linux.core"/>
<import plugin="org.eclipse.tracecompass.incubator.analysis.core"/>
<import plugin="org.eclipse.tracecompass.analysis.counters.core"/>
Expand All @@ -40,22 +39,15 @@
<import plugin="org.eclipse.ui"/>
<import plugin="org.eclipse.tracecompass.tmf.ui"/>
<import plugin="org.eclipse.swt"/>
<import feature="org.eclipse.tracecompass.incubator.callstack"/>
<import plugin="org.eclipse.tracecompass.jsontrace.core"/>
</requires>

<plugin
id="org.eclipse.tracecompass.incubator.traceevent.core"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
version="0.0.0"/>

<plugin
id="org.eclipse.tracecompass.incubator.traceevent.ui"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
version="0.0.0"/>

</feature>

0 comments on commit 64e7d63

Please sign in to comment.