Skip to content

Commit

Permalink
rocm: add rocm gpu trace for exatracer and ctf plugin
Browse files Browse the repository at this point in the history
Signed-off-by: Arnaud Fiorini <[email protected]>
  • Loading branch information
arfio committed Jul 19, 2024
1 parent f2d8a64 commit cc254ed
Show file tree
Hide file tree
Showing 64 changed files with 665 additions and 2,738 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ WORKDIR /app/

RUN mvn clean install -DskipTests

FROM alpine:3.16.0
FROM alpine:3.18.0

ENV JAVA_HOME=/opt/java-minimal
ENV PATH="$PATH:$JAVA_HOME/bin"
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
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
Expand All @@ -10,4 +10,4 @@
###############################################################################

Bundle-Vendor = Eclipse Trace Compass Incubator
Bundle-Name = Trace Compass Incubator gpu Core Tests Plug-in
Bundle-Name = Trace Compass Incubator GPU Core Tests Plug-in
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 Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.tracecompass.tmf.core,
org.eclipse.tracecompass.segmentstore.core,
org.eclipse.tracecompass.analysis.timing.core,
org.eclipse.tracecompass.analysis.profiling.core,
org.eclipse.tracecompass.analysis.callstack.core
org.eclipse.tracecompass.analysis.profiling.core
Export-Package: org.eclipse.tracecompass.incubator.gpu.core.trace,
org.eclipse.tracecompass.incubator.internal.gpu.core;x-friends:="org.eclipse.tracecompass.incubator.gpu.core.tests"
Automatic-Module-Name: org.eclipse.tracecompass.incubator.gpu.core
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
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
Expand All @@ -10,4 +10,4 @@
###############################################################################

Bundle-Vendor = Eclipse Trace Compass Incubator
Bundle-Name = Trace Compass gpu Core Plug-in (Incubator)
Bundle-Name = Trace Compass GPU Core Plug-in (Incubator)
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class GpuCallStackAnalysis extends InstrumentedCallStackAnalysis {
/** Name of the sub-attribute where the correlation id is stored */
public static final String CORRELATION_ID = "correlation_id"; //$NON-NLS-1$
/** Name of the sub-attribute where the operations are stored */
public static final String HIP_OPERATION_QUEUES = "hip_operation_queues"; //$NON-NLS-1$
public static final String OPERATION_QUEUES = "operation_queues"; //$NON-NLS-1$

@Override
protected Collection<Integer> getEdgeQuarks() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class ApiEventHandler implements IGpuEventHandler {

@Override
public void handleEvent(ITmfEvent event, ITmfStateSystemBuilder ssb, IGpuTraceEventLayout layout, ITmfStateProvider stateProvider) {
Integer tid = event.getContent().getFieldValue(Integer.class, layout.fieldThreadId());
Long tid = event.getContent().getFieldValue(Long.class, layout.fieldThreadId());
if (tid == null) {
return;
}
Expand All @@ -41,7 +41,7 @@ public void handleEvent(ITmfEvent event, ITmfStateSystemBuilder ssb, IGpuTraceEv
int apiQuark = ssb.getQuarkRelativeAndAdd(processQuark, apiLayout.getApiName());
int callStackQuark = ssb.getQuarkRelativeAndAdd(apiQuark, CallStackAnalysis.CALL_STACK);

if (apiLayout.isBeginEvent()) {
if (apiLayout.isBeginEvent(event)) {
ssb.pushAttribute(event.getTimestamp().getValue(), apiLayout.getEventName(event), callStackQuark);
} else {
ssb.popAttribute(event.getTimestamp().getValue(), callStackQuark);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public interface IApiEventLayout {
* the event object
* @return whether the event timestamp is the beginning
*/
public abstract boolean isBeginEvent();
public abstract boolean isBeginEvent(ITmfEvent event);

/**
* This function extracts the name of the event.
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
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
Expand All @@ -9,7 +9,7 @@
# SPDX-License-Identifier: EPL-2.0
###############################################################################

featureName=Trace Compass gpu (Incubation)
featureName=Trace Compass GPU (Incubation)

description=

Expand Down
19 changes: 3 additions & 16 deletions analyses/org.eclipse.tracecompass.incubator.gpu/feature.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,13 @@
<license url="%licenseURL">
%license
</license>

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

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

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

</feature>
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,12 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.tracecompass.statesystem.core,
org.eclipse.tracecompass.analysis.timing.core,
org.eclipse.tracecompass.analysis.os.linux.core,
org.eclipse.tracecompass.analysis.profiling.core;bundle-version="2.4.0",
org.eclipse.tracecompass.analysis.counters.core;bundle-version="2.2.1",
org.eclipse.tracecompass.incubator.analysis.core,
org.eclipse.tracecompass.incubator.callstack.core,
org.eclipse.tracecompass.analysis.profiling.core,
org.eclipse.tracecompass.analysis.counters.core,
org.eclipse.tracecompass.incubator.gpu.core,
org.eclipse.jdt.annotation;bundle-version="[2.0.0,3.0.0)";resolution:=optional
Export-Package: org.eclipse.tracecompass.incubator.internal.rocm.core;x-friends:="org.eclipse.tracecompass.incubator.rocm.core.tests",
org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.old,
org.eclipse.tracecompass.incubator.rocm.core.analysis.dependency,
org.eclipse.tracecompass.incubator.rocm.core.trace,
org.eclipse.tracecompass.incubator.rocm.core.trace.old
Export-Package: org.eclipse.tracecompass.incubator.internal.rocm.core,
org.eclipse.tracecompass.incubator.rocm.core.trace
Automatic-Module-Name: org.eclipse.tracecompass.incubator.rocm.ctf.core
Import-Package: com.google.common.annotations,
com.google.common.base,
Expand Down
68 changes: 6 additions & 62 deletions analyses/org.eclipse.tracecompass.incubator.rocm.core/plugin.xml
Original file line number Diff line number Diff line change
@@ -1,79 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="org.eclipse.linuxtools.tmf.core.analysis">
<module
analysis_module="org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.old.RocmMetadataAnalysis"
automatic="true"
id="org.eclipse.tracecompass.incubator.rocm.core.analysis.functionname"
name="ROCm Function Name Analysis">
<tracetype
applies="true"
class="org.eclipse.tracecompass.incubator.rocm.core.trace.old.RocmTrace">
</tracetype>
</module>
</extension>
<extension
point="org.eclipse.linuxtools.tmf.core.analysis">
<module
analysis_module="org.eclipse.tracecompass.analysis.counters.core.CounterAnalysis"
automatic="true"
id="org.eclipse.tracecompass.analysis.counters.core.counteranalysis"
name="Counters">
<tracetype
class="org.eclipse.tracecompass.incubator.rocm.core.trace.old.RocmTrace">
</tracetype>
</module>
<module
analysis_module="org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.RocmCallStackAnalysis"
automatic="true"
id="org.eclipse.tracecompass.incubator.rocm.core.analysis.atomic"
name="ROCm API Analysis">
<tracetype
applies="true"
class="org.eclipse.tracecompass.incubator.rocm.core.trace.RocmTrace">
</tracetype>
</module>
</extension>
<extension
point="org.eclipse.linuxtools.tmf.core.tracetype">
<type
category="org.eclipse.linuxtools.tmf.ctf.core.category.ctf"
event_type="org.eclipse.tracecompass.tmf.core.event.TmfEvent"
id="org.eclipse.tracecompass.incubator.rocm.core.trace"
id="org.eclipse.tracecompass.incubator.rocm.core.trace.exatracer"
isDirectory="true"
name="%trace.rocm.old"
trace_type="org.eclipse.tracecompass.incubator.rocm.core.trace.old.RocmTrace">
name="Exatracer Trace"
trace_type="org.eclipse.tracecompass.incubator.rocm.core.exatracer.trace.RocmExatracerTrace">
</type>
<type
category="org.eclipse.linuxtools.tmf.ctf.core.category.ctf"
event_type="org.eclipse.tracecompass.tmf.core.event.TmfEvent"
id="org.eclipse.tracecompass.incubator.rocm.core.trace.atomic"
id="org.eclipse.tracecompass.incubator.rocm.core.trace.ctfplugin"
isDirectory="true"
name="%trace.rocm"
trace_type="org.eclipse.tracecompass.incubator.rocm.core.trace.RocmTrace">
name="RocmCtfPlugin Trace"
trace_type="org.eclipse.tracecompass.incubator.rocm.core.ctfplugin.trace.RocmCtfPluginTrace">
</type>
</extension>
<extension
point="org.eclipse.linuxtools.tmf.core.analysis">
<module
analysis_module="org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.old.RocmCallStackAnalysis"
automatic="true"
id="org.eclipse.tracecompass.incubator.rocm.core.analysis.interval"
name="ROCm API Analysis">
<tracetype
applies="true"
class="org.eclipse.tracecompass.incubator.rocm.core.trace.old.RocmTrace">
</tracetype>
</module>
</extension>
<extension
point="org.eclipse.tracecompass.tmf.core.symbolProvider">
<providerFactory
class="org.eclipse.tracecompass.incubator.rocm.core.trace.RocmTraceSymbolProviderFactory"
id="org.eclipse.tracecompass.incubator.rocm.core.trace.providerfactory"
priority="56">
</providerFactory>
</extension>
</plugin>
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 @@ -15,7 +15,7 @@
import java.util.Objects;

import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.tracecompass.internal.provisional.analysis.profiling.core.instrumented.InstrumentedCallStackAnalysis;
import org.eclipse.tracecompass.analysis.profiling.core.instrumented.InstrumentedCallStackAnalysis;
import org.eclipse.tracecompass.statesystem.core.ITmfStateSystem;
import org.eclipse.tracecompass.tmf.core.statesystem.ITmfStateProvider;

Expand All @@ -29,7 +29,6 @@
*
* @author Arnaud Fiorini
*/
@SuppressWarnings("restriction")
public class RocmCallStackAnalysis extends InstrumentedCallStackAnalysis {

private static final String EDGES = "EDGES"; //$NON-NLS-1$
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 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 Down

This file was deleted.

Loading

0 comments on commit cc254ed

Please sign in to comment.