Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

profiling: cache symbol key interval #197

Merged
merged 1 commit into from
Jan 6, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public class InstrumentedCallStackElement extends CallStackElement {
private final int fQuark;
private final IHostIdResolver fHostResolver;
private final @Nullable IThreadIdResolver fThreadIdResolver;
private @Nullable ITmfStateInterval fSymbolKeyInterval = null;
private final Map<Integer, ICallStackElement> fNextElements = new HashMap<>();

private @Nullable CallStack fCallstack = null;
Expand Down Expand Up @@ -178,13 +179,18 @@ private static Collection<ICallStackElement> getNextElements(InstrumentedGroupDe
public int retrieveSymbolKeyAt(long startTime) {
int processId = CallStackElement.DEFAULT_SYMBOL_KEY;
if (fQuark != ITmfStateSystem.ROOT_ATTRIBUTE) {
ITmfStateInterval symbolKeyInterval = fSymbolKeyInterval;
if (symbolKeyInterval != null && symbolKeyInterval.intersects(startTime)) {
return symbolKeyInterval.getValueInt();
}
try {
// Query a time that is within the bounds of the state system
long start = Math.max(fStateSystem.getStartTime(), startTime);
start = Math.max(start, fStateSystem.getCurrentEndTime());

// Query the value of the quark at the requested time
ITmfStateInterval interval = fStateSystem.querySingleState(start, fQuark);
fSymbolKeyInterval = interval;
ITmfStateValue processStateValue = interval.getStateValue();
// If the state value is an integer, assume it is the symbol we
// are looking for
Expand Down
Loading