The Resource View assumes that if the base quark of a resource is
present, the "Status" sub-attribute will always be there. This may
not be the case, for example if the trace does not have sched_switch
events enabled, but has shed_wakeup.
Change-Id: Iaf25cf3d8a5b8ee686281dc3064f241229c2c245
Signed-off-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
Reviewed-on: https://git.eclipse.org/r/36492
Tested-by: Hudson CI
Reviewed-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Tested-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
try {
if (resourcesEntry.getType().equals(Type.CPU)) {
- int statusQuark = ssq.getQuarkRelative(quark, Attributes.STATUS);
+ int statusQuark;
+ try {
+ statusQuark = ssq.getQuarkRelative(quark, Attributes.STATUS);
+ } catch (AttributeNotFoundException e) {
+ /*
+ * The sub-attribute "status" is not available. May happen
+ * if the trace does not have sched_switch events enabled.
+ */
+ return null;
+ }
List<ITmfStateInterval> statusIntervals = StateSystemUtils.queryHistoryRange(ssq, statusQuark, realStart, realEnd - 1, resolution, monitor);
eventList = new ArrayList<>(statusIntervals.size());
long lastEndTime = -1;