os.linux: Create PPID and SYSTEM_CALL attributes on demand
[deliverable/tracecompass.git] / analysis / org.eclipse.tracecompass.analysis.os.linux.ui / src / org / eclipse / tracecompass / internal / analysis / os / linux / ui / views / controlflow / ControlFlowPresentationProvider.java
index f36d274c79400cbb96624e3bb622c68e2a559041..14b087ab762f5eb87f8875652c45a3339a2616cc 100644 (file)
@@ -174,15 +174,18 @@ public class ControlFlowPresentationProvider extends TimeGraphPresentationProvid
         }
         int status = ((TimeEvent) event).getValue();
         if (status == StateValues.PROCESS_STATUS_RUN_SYSCALL) {
+            int syscallQuark = ssq.optQuarkRelative(entry.getThreadQuark(), Attributes.SYSTEM_CALL);
+            if (syscallQuark == ITmfStateSystem.INVALID_ATTRIBUTE) {
+                return retMap;
+            }
             try {
-                int syscallQuark = ssq.getQuarkRelative(entry.getThreadQuark(), Attributes.SYSTEM_CALL);
                 ITmfStateInterval value = ssq.querySingleState(event.getTime(), syscallQuark);
                 if (!value.getStateValue().isNull()) {
                     ITmfStateValue state = value.getStateValue();
                     retMap.put(Messages.ControlFlowView_attributeSyscallName, state.toString());
                 }
 
-            } catch (AttributeNotFoundException | TimeRangeException e) {
+            } catch (TimeRangeException e) {
                 Activator.getDefault().logError("Error in ControlFlowPresentationProvider", e); //$NON-NLS-1$
             } catch (StateSystemDisposedException e) {
                 /* Ignored */
@@ -213,8 +216,11 @@ public class ControlFlowPresentationProvider extends TimeGraphPresentationProvid
         if (status != StateValues.PROCESS_STATUS_RUN_SYSCALL) {
             return;
         }
+        int syscallQuark = ss.optQuarkRelative(entry.getThreadQuark(), Attributes.SYSTEM_CALL);
+        if (syscallQuark == ITmfStateSystem.INVALID_ATTRIBUTE) {
+            return;
+        }
         try {
-            int syscallQuark = ss.getQuarkRelative(entry.getThreadQuark(), Attributes.SYSTEM_CALL);
             ITmfStateInterval value = ss.querySingleState(event.getTime(), syscallQuark);
             if (!value.getStateValue().isNull()) {
                 ITmfStateValue state = value.getStateValue();
@@ -233,7 +239,7 @@ public class ControlFlowPresentationProvider extends TimeGraphPresentationProvid
 
                 Utils.drawText(gc, state.toString().substring(beginIndex), bounds.x, bounds.y, bounds.width, bounds.height, true, true);
             }
-        } catch (AttributeNotFoundException | TimeRangeException e) {
+        } catch (TimeRangeException e) {
             Activator.getDefault().logError("Error in ControlFlowPresentationProvider", e); //$NON-NLS-1$
         } catch (StateSystemDisposedException e) {
             /* Ignored */
This page took 0.026825 seconds and 5 git commands to generate.