Use transparent color for unknown states in ControlFlow/Resources view
authorPatrick Tasse <patrick.tasse@gmail.com>
Tue, 26 Feb 2013 19:14:39 +0000 (14:14 -0500)
committerPatrick Tasse <patrick.tasse@gmail.com>
Tue, 26 Feb 2013 21:03:14 +0000 (16:03 -0500)
The TRANSPARENT value is used for unknown states (states embedded by the
view in between actual states due to the sampling). When many states
occur in the same pixel range, the pixel now takes the color of one of
the states within the pixel range. The selected state color for a pixel
can change with regards to the current widget size and time range. The
tool tip information may be computed for a transparent state which does
not match the visible color under the cursor. In that case the state
name "(multiple)" is displayed.

Change-Id: If9185f67826bdab450cecf6f70c8b25f9beda33d
Signed-off-by: Patrick Tasse <patrick.tasse@gmail.com>
Reviewed-on: https://git.eclipse.org/r/10187
Reviewed-by: Bernd Hufmann <bhufmann@gmail.com>
IP-Clean: Bernd Hufmann <bhufmann@gmail.com>
Tested-by: Bernd Hufmann <bhufmann@gmail.com>
Tested-by: Hudson CI
org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/Messages.java
org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/messages.properties
org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/controlflow/ControlFlowEvent.java
org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/controlflow/ControlFlowPresentationProvider.java
org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/controlflow/ControlFlowView.java
org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/resources/ResourcesEvent.java
org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/resources/ResourcesPresentationProvider.java

index 7c222d1a30b79a55bf2a5a3104003937d81f848d..6ccddb13c7bd81650a186373325226e16130597c 100644 (file)
@@ -13,6 +13,7 @@ public class Messages extends NLS {
     public static String ControlFlowView_traceColumn;
 
     public static String ControlFlowView_stateTypeName;
+    public static String ControlFlowView_multipleStates;
     public static String ControlFlowView_nextProcessActionNameText;
     public static String ControlFlowView_nextProcessActionToolTipText;
     public static String ControlFlowView_previousProcessActionNameText;
@@ -22,6 +23,7 @@ public class Messages extends NLS {
     public static String ControlFlowView_attributeCpuName;
 
     public static String ResourcesView_stateTypeName;
+    public static String ResourcesView_multipleStates;
     public static String ResourcesView_nextResourceActionNameText;
     public static String ResourcesView_nextResourceActionToolTipText;
     public static String ResourcesView_previousResourceActionNameText;
index 5313c99b936fc2c207e1fbc0c430b9ce4fa82495..695a92186c66cd193736f820ec2ab3ca003474b3 100644 (file)
@@ -5,6 +5,7 @@ ControlFlowView_processColumn=Process
 ControlFlowView_traceColumn=Trace
 
 ControlFlowView_stateTypeName=Process
+ControlFlowView_multipleStates=(multiple)
 ControlFlowView_nextProcessActionNameText=Next Process
 ControlFlowView_nextProcessActionToolTipText=Select Next Process
 ControlFlowView_previousProcessActionNameText=Previous Process
@@ -14,6 +15,7 @@ ControlFlowView_attributeSyscallName=System Call
 ControlFlowView_attributeCpuName=CPU
 
 ResourcesView_stateTypeName=Resource
+ResourcesView_multipleStates=(multiple)
 ResourcesView_nextResourceActionNameText=Next Resource
 ResourcesView_nextResourceActionToolTipText=Select Next Resource
 ResourcesView_previousResourceActionNameText=Previous Resource
index 5651b1ca5adee2852c17ee520beb1fbbfc0f4625..b84f5dd03dbab851f47b2d1395248bb359226a4a 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2012 Ericsson
+ * Copyright (c) 2012, 2013 Ericsson
  *
  * All rights reserved. This program and the accompanying materials are
  * made available under the terms of the Eclipse Public License v1.0 which
@@ -48,4 +48,9 @@ public class ControlFlowEvent extends TimeEvent {
     public int getStatus() {
         return fStatus;
     }
+
+    @Override
+    public String toString() {
+        return "ControlFlowEvent start=" + fTime + " end=" + (fTime + fDuration) + " duration=" + fDuration + " status=" + fStatus; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+    }
 }
index b1e0d99c0a7e706f312f89f9af040594fa8e3f33..a7e5b754dbb01c156ef2e2088362d96fda7611a2 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2012 Ericsson
+ * Copyright (c) 2012, 2013 Ericsson
  *
  * All rights reserved. This program and the accompanying materials are
  * made available under the terms of the Eclipse Public License v1.0 which
@@ -77,7 +77,7 @@ public class ControlFlowPresentationProvider extends TimeGraphPresentationProvid
             int status = ((ControlFlowEvent) event).getStatus();
             return getMatchingState(status).ordinal();
         }
-        return State.UNKNOWN.ordinal();
+        return TRANSPARENT;
     }
 
     @Override
@@ -86,7 +86,7 @@ public class ControlFlowPresentationProvider extends TimeGraphPresentationProvid
             int status = ((ControlFlowEvent) event).getStatus();
             return getMatchingState(status).toString();
         }
-        return State.UNKNOWN.toString();
+        return Messages.ControlFlowView_multipleStates;
     }
 
     private static State getMatchingState(int status) {
index e4a673531657f60de54289783683b7d85eff2ea7..7a9933fdc676b897489eb67cf525ede58e5ab424 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2012 Ericsson
+ * Copyright (c) 2012, 2013 Ericsson
  *
  * All rights reserved. This program and the accompanying materials are
  * made available under the terms of the Eclipse Public License v1.0 which
@@ -787,7 +787,7 @@ public class ControlFlowView extends TmfView {
                     e.printStackTrace();
                 }
                 if (lastEndTime != time && lastEndTime != -1) {
-                    eventList.add(new ControlFlowEvent(entry, lastEndTime, time - lastEndTime, 0));
+                    eventList.add(new TimeEvent(entry, lastEndTime, time - lastEndTime));
                 }
                 eventList.add(new ControlFlowEvent(entry, time, duration, status));
                 lastEndTime = time + duration;
index ab7361d1e4d6659e9299860b4039e310c9055c68..d8acb7d0d38f884cfd26d9bdccba3d6eafd649ad 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2012 Ericsson
+ * Copyright (c) 2012, 2013 Ericsson
  *
  * All rights reserved. This program and the accompanying materials are
  * made available under the terms of the Eclipse Public License v1.0 which
@@ -76,4 +76,9 @@ public class ResourcesEvent extends TimeEvent {
     public Type getType() {
         return fType;
     }
+
+    @Override
+    public String toString() {
+        return "ResourcesEvent start=" + fTime + " end=" + (fTime + fDuration) + " duration=" + fDuration + " type=" + fType + " value=" + fValue; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+    }
 }
index 4182a68c11341466d2390f4fb0611dc6a861470d..77fa8fbd7e200466da6bc375193bad338d512db0 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2012 Ericsson
+ * Copyright (c) 2012, 2013 Ericsson
  *
  * All rights reserved. This program and the accompanying materials are
  * made available under the terms of the Eclipse Public License v1.0 which
@@ -53,7 +53,6 @@ public class ResourcesPresentationProvider extends TimeGraphPresentationProvider
     private long fLastThreadId = -1; // used to draw the process name label only once per thread id
 
     private enum State {
-        UNKNOWN         (new RGB(100, 100, 100)),
         IDLE            (new RGB(200, 200, 200)),
         USERMODE        (new RGB(0, 200, 0)),
         SYSCALL         (new RGB(0, 0, 200)),
@@ -121,10 +120,10 @@ public class ResourcesPresentationProvider extends TimeGraphPresentationProvider
                 }
                 return State.SOFT_IRQ_ACTIVE.ordinal();
             } else {
-                return -1; // NULL
+                return INVISIBLE; // NULL
             }
         }
-        return State.UNKNOWN.ordinal();
+        return TRANSPARENT;
     }
 
     @Override
@@ -156,7 +155,7 @@ public class ResourcesPresentationProvider extends TimeGraphPresentationProvider
                 return null;
             }
         }
-        return State.UNKNOWN.toString();
+        return Messages.ResourcesView_multipleStates;
     }
 
     @Override
This page took 0.029482 seconds and 5 git commands to generate.