Skip to content

Commit

Permalink
Bug 581189: Fix Flame Chart symbol resolution for LTTng UST traces
Browse files Browse the repository at this point in the history
For that update the RocmTraceSymbolProviderFactory to not return a
symbol provider if the relevant ROCM analysis is not applicable for a
given trace. Also, it makes sure that the RocmTraceSymbolProvider
doesn't return a symbol if the analysis is not applicable for a given
trace (in the failing case the LTTng UST Trace).

[Fixed] Flame Chart symbol resolution for LTTng UST traces

Change-Id: I35adb2732df28e69947017856fd94022c05b95c6
Signed-off-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/c/tracecompass.incubator/org.eclipse.tracecompass.incubator/+/197573
Tested-by: Trace Compass Bot <tracecompass-bot@eclipse.org>
Tested-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-by: Arnaud Fiorini <fiorini.arnaud@gmail.com>
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
  • Loading branch information
bhufmann committed Dec 13, 2022
1 parent d49611b commit 7128110
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Expand Up @@ -59,15 +59,15 @@ public void loadConfiguration(@Nullable IProgressMonitor monitor) {
public @Nullable TmfResolvedSymbol getSymbol(long address) {
RocmMetadataAnalysis module = TmfTraceUtils.getAnalysisModuleOfClass(getTrace(),
RocmMetadataAnalysis.class, RocmMetadataAnalysis.ID);
if (module == null || address == -1) {
if (module == null) {
/*
* The analysis is not available for this trace, we won't be able to
* find the information.
*/
return new TmfResolvedSymbol(address, StringUtils.EMPTY);
return null;
}
ITmfStateSystem ss = module.getStateSystem();
if (ss == null) {
if (ss == null || address == -1) {
return new TmfResolvedSymbol(address, StringUtils.EMPTY);
}
String functionName;
Expand Down
Expand Up @@ -13,9 +13,11 @@

import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.tracecompass.incubator.internal.rocm.core.analysis.RocmMetadataAnalysis;
import org.eclipse.tracecompass.tmf.core.symbols.ISymbolProvider;
import org.eclipse.tracecompass.tmf.core.symbols.ISymbolProviderFactory;
import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
import org.eclipse.tracecompass.tmf.core.trace.TmfTraceUtils;

/**
* Factory for the ROCm Symbol provider
Expand All @@ -26,6 +28,11 @@ public class RocmTraceSymbolProviderFactory implements ISymbolProviderFactory {

@Override
public @Nullable ISymbolProvider createProvider(@NonNull ITmfTrace trace) {
RocmMetadataAnalysis module = TmfTraceUtils.getAnalysisModuleOfClass(trace,
RocmMetadataAnalysis.class, RocmMetadataAnalysis.ID);
if (module == null) {
return null;
}
return new RocmTraceSymbolProvider(trace);
}
}

0 comments on commit 7128110

Please sign in to comment.