1 /*******************************************************************************
2 * Copyright (c) 2016 Movidius Inc. and others
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
9 *******************************************************************************/
11 package org
.eclipse
.tracecompass
.tmf
.ui
.symbols
;
13 import org
.eclipse
.core
.runtime
.IProgressMonitor
;
14 import org
.eclipse
.jdt
.annotation
.NonNull
;
15 import org
.eclipse
.jdt
.annotation
.Nullable
;
16 import org
.eclipse
.tracecompass
.tmf
.core
.event
.lookup
.ITmfCallsite
;
17 import org
.eclipse
.tracecompass
.tmf
.core
.trace
.ITmfTrace
;
18 import org
.eclipse
.tracecompass
.tmf
.core
.trace
.TmfTrace
;
21 * An ISymbolProvider is used to map symbol addresses that might be found inside
22 * an {@link TmfTrace} into human readable strings.
26 * @see ISymbolProviderFactory
28 public interface ISymbolProvider
{
31 * @return the trace that this class resolves symbols for
33 @NonNull ITmfTrace
getTrace();
36 * Some providers might have configurations that take some time to load. All
37 * the CPU intensive load operations shall be done in this method. The
38 * adopters shall call this method at an opportune moment when cancellation
39 * and UI feedback is possible. However, the implementors of this interface
40 * shall not assume that this method has been called.
43 * The progress monitor to use, can be null
45 void loadConfiguration(IProgressMonitor monitor
);
48 * Return the symbol text corresponding to the given address or null if
49 * there is no such symbol
52 * the address of the symbol
53 * @return the symbol text or null if the symbol cannot be found
55 @Nullable String
getSymbolText(long address
);
58 * Return additional information regarding the symbol from the given address
59 * or null if the symbol cannot be found
62 * the address of the symbol
63 * @return the symbol {@link ITmfCallsite} information or null if the symbol
66 @Nullable ITmfCallsite
getSymbolInfo(long address
);
69 * Return the symbol text corresponding to the given pid/timestamp/address
70 * tuple, or null if there is no such symbol.
73 * The process Id for which to query
75 * The timestamp of the query
77 * the address of the symbol
78 * @return the symbol text or null if the symbol cannot be found
80 default @Nullable String
getSymbolText(int pid
, long timestamp
, long address
) {
81 return getSymbolText(address
);
85 * Return additional information regarding the symbol from the given
86 * pid/timestamp/address tuple, or null if the symbol cannot be found.
89 * The process Id for which to query
91 * The timestamp of the query
93 * the address of the symbol
94 * @return the symbol {@link ITmfCallsite} information or null if the symbol
97 default @Nullable ITmfCallsite
getSymbolInfo(int pid
, long timestamp
, long address
) {
98 return getSymbolInfo(address
);
102 * Create the {@link ISymbolProviderPreferencePage} that can be used to
103 * configure this {@link ISymbolProvider}
105 * @return the {@link ISymbolProviderPreferencePage} or null if this symbol
106 * provider does not offer a configuration UI
108 @Nullable ISymbolProviderPreferencePage
createPreferencePage();