/*******************************************************************************
- * Copyright (c) 2015 EfficiOS Inc., Alexandre Montplaisir
+ * Copyright (c) 2015, 2016 EfficiOS Inc., Alexandre Montplaisir
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
import org.eclipse.tracecompass.statesystem.core.exceptions.StateSystemDisposedException;
import org.eclipse.tracecompass.statesystem.core.interval.ITmfStateInterval;
import org.eclipse.tracecompass.statesystem.core.statevalue.ITmfStateValue;
-import org.eclipse.tracecompass.tmf.core.analysis.TmfAnalysisRequirement;
+import org.eclipse.tracecompass.tmf.core.analysis.requirements.TmfAbstractAnalysisRequirement;
import org.eclipse.tracecompass.tmf.core.exceptions.TmfAnalysisException;
import org.eclipse.tracecompass.tmf.core.statesystem.ITmfStateProvider;
import org.eclipse.tracecompass.tmf.core.statesystem.TmfStateSystemAnalysisModule;
}
@Override
- public Iterable<TmfAnalysisRequirement> getAnalysisRequirements() {
+ public Iterable<TmfAbstractAnalysisRequirement> getAnalysisRequirements() {
// TODO specify actual requirements once the requirement-checking is
// implemented. This analysis needs "ip" and "vpid" contexts.
- return checkNotNull(Collections.EMPTY_SET);
+ return Collections.EMPTY_SET;
}
@Override
ITmfStateSystem ss = checkNotNull(getStateSystem());
Set<UstDebugInfoBinaryFile> files = new TreeSet<>();
- try {
- ImmutableList.Builder<Integer> builder = ImmutableList.builder();
- List<Integer> vpidQuarks = ss.getSubAttributes(-1, false);
- for (Integer vpidQuark : vpidQuarks) {
- builder.addAll(ss.getSubAttributes(vpidQuark, false));
- }
- List<Integer> baddrQuarks = builder.build();
+ ImmutableList.Builder<Integer> builder = ImmutableList.builder();
+ List<Integer> vpidQuarks = ss.getSubAttributes(-1, false);
+ for (Integer vpidQuark : vpidQuarks) {
+ builder.addAll(ss.getSubAttributes(vpidQuark, false));
+ }
+ List<Integer> baddrQuarks = builder.build();
- /*
- * For each "baddr" attribute, get the "buildId" sub-attribute,
- * whose value is the file path.
- */
+ /*
+ * For each "baddr" attribute, get the "buildId" sub-attribute,
+ * whose value is the file path.
+ */
- for (Integer baddrQuark : baddrQuarks) {
+ for (Integer baddrQuark : baddrQuarks) {
- List<Integer> buildIdQuarks = ss.getSubAttributes(baddrQuark, false);
- for (Integer buildIdQuark : buildIdQuarks) {
- String buildId = ss.getAttributeName(buildIdQuark);
+ List<Integer> buildIdQuarks = ss.getSubAttributes(baddrQuark, false);
+ for (Integer buildIdQuark : buildIdQuarks) {
+ String buildId = ss.getAttributeName(buildIdQuark);
+ /*
+ * Explore the history of this attribute "horizontally",
+ * even though there should only be one valid interval.
+ */
+ ITmfStateInterval interval = StateSystemUtils.queryUntilNonNullValue(ss, buildIdQuark, ss.getStartTime(), Long.MAX_VALUE);
+ if (interval == null) {
/*
- * Explore the history of this attribute "horizontally",
- * even though there should only be one valid interval.
+ * If we created the attribute, we should have assigned
+ * a value to it!
*/
- ITmfStateInterval interval = StateSystemUtils.queryUntilNonNullValue(ss, buildIdQuark, ss.getStartTime(), Long.MAX_VALUE);
- if (interval == null) {
- /*
- * If we created the attribute, we should have assigned
- * a value to it!
- */
- throw new IllegalStateException();
- }
- String filePath = interval.getStateValue().unboxStr();
-
- files.add(new UstDebugInfoBinaryFile(filePath, buildId));
+ throw new IllegalStateException();
}
+ String filePath = interval.getStateValue().unboxStr();
+
+ files.add(new UstDebugInfoBinaryFile(filePath, buildId));
}
- } catch (AttributeNotFoundException e) {
- throw new IllegalStateException(e);
}
return files;
}
/* Get the most probable base address from all the known ones */
NavigableSet<Long> possibleBaddrs = possibleBaddrQuarks.stream()
.map(quark -> {
- String baddrStr = ss.getAttributeName(checkNotNull(quark).intValue());
+ String baddrStr = ss.getAttributeName(quark.intValue());
return checkNotNull(Long.valueOf(baddrStr));
})
.collect(Collectors.toCollection(TreeSet::new));
List<Integer> buildIds = ss.getSubAttributes(baddrQuark, false);
Optional<Integer> potentialBuildIdQuark = buildIds.stream()
.filter(id -> {
- int quark = checkNotNull(id).intValue();
+ int quark = id.intValue();
ITmfStateValue value = fullState.get(quark).getStateValue();
return (!value.isNull());
})