Skip to content

Commit

Permalink
analysis.timing: Remove depr. APIs in AbstractSegmentStatisticsAnalysis
Browse files Browse the repository at this point in the history
Deprecated in patch:
https://git.eclipse.org/r/c/tracecompass/org.eclipse.tracecompass/+/193127

Fixes issue eclipse-tracecompass#87

[Removed] AbstractSegmentStatisticsAnalysis.getSegmentProviderAnalysis()

Signed-off-by: Patrick Tasse <patrick.tasse@gmail.com>
  • Loading branch information
PatrickTasse committed May 22, 2024
1 parent 20c9c37 commit 535cfa6
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 32 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2017 Ericsson
* Copyright (c) 2017, 2024 Ericsson
*
* 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 @@ -13,7 +13,6 @@

import java.util.Iterator;

import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.tracecompass.analysis.profiling.core.callstack.CallStackAnalysis;
import org.eclipse.tracecompass.analysis.timing.core.segmentstore.ISegmentStoreProvider;
Expand All @@ -32,9 +31,8 @@ public class CallGraphStatisticsAnalysis extends AbstractSegmentStatisticsAnalys
/** The analysis module ID */
public static final String ID = CallGraphAnalysis.ID + ".statistics"; //$NON-NLS-1$

@Deprecated
@Override
protected @Nullable ISegmentStoreProvider getSegmentProviderAnalysis(@NonNull ITmfTrace trace) {
protected @Nullable ISegmentStoreProvider getSegmentStoreProvider(ITmfTrace trace) {
// FIXME: Return the CallStackAnalysis when the segment store comes from there
// and not the CallGraph. Now, we return the CallGraphAnalysis, just so we can
// wait for this analysis to finish to get the full segment store
Expand All @@ -48,7 +46,7 @@ public class CallGraphStatisticsAnalysis extends AbstractSegmentStatisticsAnalys
}

@Override
protected @Nullable String getSegmentType(@NonNull ISegment segment) {
protected @Nullable String getSegmentType(ISegment segment) {
if (segment instanceof ICalledFunction) {
ICalledFunction calledFunction = (ICalledFunction) segment;
StringBuilder builder = new StringBuilder(calledFunction.getName());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2016 Ericsson
* Copyright (c) 2016, 2024 Ericsson
*
* 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 Expand Up @@ -108,9 +108,8 @@ public boolean setTrace(@NonNull ITmfTrace trace) throws TmfAnalysisException {
return segment.getLength() % 2 == 0 ? "even" : "odd";
}

@Deprecated
@Override
protected @Nullable ISegmentStoreProvider getSegmentProviderAnalysis(@NonNull ITmfTrace trace) {
protected @Nullable ISegmentStoreProvider getSegmentStoreProvider(@NonNull ITmfTrace trace) {
return fSegmentStoreProvider;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-Vendor: %Bundle-Vendor
Bundle-Version: 5.5.1.qualifier
Bundle-Version: 6.0.0.qualifier
Bundle-Localization: plugin
Bundle-SymbolicName: org.eclipse.tracecompass.analysis.timing.core;singleton:=true
Bundle-Activator: org.eclipse.tracecompass.internal.analysis.timing.core.Activator
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2018, 2023 Ericsson
* Copyright (c) 2018, 2024 Ericsson
*
* 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 Expand Up @@ -50,9 +50,8 @@ public GenericSegmentStatisticsAnalysis(String secondaryId) {
return null;
}

@Deprecated
@Override
protected @Nullable ISegmentStoreProvider getSegmentProviderAnalysis(ITmfTrace trace) {
protected @Nullable ISegmentStoreProvider getSegmentStoreProvider(ITmfTrace trace) {
IAnalysisModule segmentStoreModule = trace.getAnalysisModule(fSecondaryId);
if (segmentStoreModule instanceof ISegmentStoreProvider) {
return (ISegmentStoreProvider) segmentStoreModule;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2016 Ericsson
* Copyright (c) 2016, 2024 Ericsson
*
* 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 Expand Up @@ -225,18 +225,6 @@ private static boolean isEternity(long start, long end) {
*/
protected abstract @Nullable String getSegmentType(ISegment segment);

/**
* Find the segment store provider used for this analysis
*
* @param trace
* The active trace
*
* @return The segment store provider
* @deprecated use {@link #getSegmentStoreProvider(ITmfTrace)} instead
*/
@Deprecated
protected abstract @Nullable ISegmentStoreProvider getSegmentProviderAnalysis(ITmfTrace trace);

/**
* Find the segment store provider used for this analysis
*
Expand All @@ -246,10 +234,7 @@ private static boolean isEternity(long start, long end) {
* @return The segment store provider
* @since 5.3
*/
protected @Nullable ISegmentStoreProvider getSegmentStoreProvider(ITmfTrace trace) {
// TODO: make getSegmentStoreProvider abstract when removing the following:
return getSegmentProviderAnalysis(trace);
}
protected abstract @Nullable ISegmentStoreProvider getSegmentStoreProvider(ITmfTrace trace);

@Override
protected void canceling() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2016 École Polytechnique de Montréal
* Copyright (c) 2016, 2024 École Polytechnique de Montréal and others
*
* 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 Expand Up @@ -47,9 +47,8 @@ public XmlPatternLatencyStatisticsAnalysis(@Nullable String patternAnalysisId) {
return null;
}

@Deprecated
@Override
protected @Nullable ISegmentStoreProvider getSegmentProviderAnalysis(@NonNull ITmfTrace trace) {
protected @Nullable ISegmentStoreProvider getSegmentStoreProvider(@NonNull ITmfTrace trace) {
return fPatternAnalysisId != null ? TmfTraceUtils.getAnalysisModuleOfClass(trace, XmlPatternAnalysis.class, fPatternAnalysisId) : null;
}
}

0 comments on commit 535cfa6

Please sign in to comment.