os.linux: Manage sched_waking events
authorAlexandre Montplaisir <alexmonthy@efficios.com>
Thu, 1 Dec 2016 21:28:42 +0000 (16:28 -0500)
committerAlexandre Montplaisir <alexmonthy@efficios.com>
Wed, 7 Dec 2016 00:49:01 +0000 (19:49 -0500)
LTTng 2.8 (and kernels around that time) introduced the
sched_waking event. This event has the same fields as the
sched_wakeup one, and should cause the same state changes.

Since the linux-generic KernelStateProvider has no knowledge
of specific LTTng event layouts, we have to bring this
definition up into the base interface. Older traces simply
won't have any of these events.

Change-Id: Idf9eaf1ecba0346b22283adfbe71ad56d52b045f
Signed-off-by: Alexandre Montplaisir <alexmonthy@efficios.com>
Reviewed-on: https://git.eclipse.org/r/85804
Reviewed-by: Hudson CI
Reviewed-by: Genevieve Bastien <gbastien+lttng@versatic.net>
Tested-by: Genevieve Bastien <gbastien+lttng@versatic.net>
analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/analysis/os/linux/core/trace/DefaultEventLayout.java
analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/analysis/os/linux/core/trace/IKernelAnalysisEventLayout.java
analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/internal/analysis/os/linux/core/kernel/KernelStateProvider.java
analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/internal/analysis/os/linux/core/kernel/handlers/SchedWakeupHandler.java
lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/trace/layout/Lttng28EventLayout.java
lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/trace/layout/PerfEventLayout.java

index f8d249d97dc24056ec27a0911c1f955342ff107e..2d87a0a45fce2c9f2bf533eeeadab8d362ae31ac 100644 (file)
@@ -414,12 +414,7 @@ public class DefaultEventLayout implements IKernelAnalysisEventLayout {
         return NOW;
     }
 
-    /**
-     * Event indicating the source of the wakeup signal.
-     *
-     * @return The name of the event
-     * @since 2.0
-     */
+    @Override
     public String eventSchedProcessWaking() {
         return SCHED_WAKING;
     }
index 84f0837b9fe65836bf1ac70c191a779ad3473655..dc8afdf4a6734564a91bd24c22200c5bc91fc952 100644 (file)
@@ -220,6 +220,17 @@ public interface IKernelAnalysisEventLayout {
      */
     String eventSchedProcessWakeupNew();
 
+    /**
+     * Event called when waking a task; this event is guaranteed to be called
+     * from the waking context.
+     *
+     * @return The name of the event
+     * @since 2.1
+     */
+    default String eventSchedProcessWaking() {
+        return "sched_waking"; //$NON-NLS-1$
+    }
+
     /**
      * Starting the high resolution timer
      * <p>
index 94a9933a549cf59f13c7f9c5e68600010c15ac95..780acba92c16da62ebff6cbadf28c22e7f3e5946 100644 (file)
@@ -79,7 +79,7 @@ public class KernelStateProvider extends AbstractTmfStateProvider {
      * Version number of this state provider. Please bump this if you modify the
      * contents of the generated state history in some way.
      */
-    private static final int VERSION = 21;
+    private static final int VERSION = 22;
 
     // ------------------------------------------------------------------------
     // Fields
@@ -130,10 +130,12 @@ public class KernelStateProvider extends AbstractTmfStateProvider {
         builder.put(layout.eventSchedProcessFork(), new ProcessForkHandler(layout));
         builder.put(layout.eventSchedProcessExit(), new ProcessExitHandler(layout));
         builder.put(layout.eventSchedProcessFree(), new ProcessFreeHandler(layout));
-        for( String s : layout.getIPIIrqVectorsEntries()) {
+        builder.put(layout.eventSchedProcessWaking(), new SchedWakeupHandler(layout));
+
+        for (String s : layout.getIPIIrqVectorsEntries()) {
             builder.put(s, new IPIEntryHandler(layout));
         }
-        forString s : layout.getIPIIrqVectorsExits()) {
+        for (String s : layout.getIPIIrqVectorsExits()) {
             builder.put(s, new IPIExitHandler(layout));
         }
 
index 40bed11921b893fc5e951b78bb660c7facacdaea..5cd55db8640bed2d4533084e934f13327cc23607 100644 (file)
@@ -22,7 +22,11 @@ import org.eclipse.tracecompass.statesystem.core.statevalue.TmfStateValue;
 import org.eclipse.tracecompass.tmf.core.event.ITmfEvent;
 
 /**
- * Wakeup handler
+ * Waking/wakeup handler.
+ *
+ * "sched_waking" and "sched_wakeup" tracepoints contain the same fields, and
+ * apply the same state transitions in our model, so they can both use this
+ * handler.
  */
 public class SchedWakeupHandler extends KernelEventHandler {
 
index cd3a9e175c420084f06d1c5e101c2b9c794a9849..5f0ed96f7790d22a69d7e31effc73ab570f71106 100644 (file)
@@ -33,13 +33,7 @@ public class Lttng28EventLayout extends Lttng27EventLayout {
     // New definitions in LTTng 2.8
     // ------------------------------------------------------------------------
 
-    /**
-     * Event called when waking a task; this event is guaranteed to be called
-     * from the waking context.
-     *
-     * @return The name of the event
-     * @since 2.0
-     */
+    @Override
     public String eventSchedProcessWaking() {
         return "sched_waking"; //$NON-NLS-1$
     }
index d43f40b65a3272ffe677e6a17d1fe895f0faf2bc..a3e51b0c356b9c86491675b21656359ba0890d6c 100644 (file)
@@ -142,6 +142,11 @@ public final class PerfEventLayout implements IKernelAnalysisEventLayout {
         return "sched:process_wakeup_new";  //$NON-NLS-1$
     }
 
+    @Override
+    public String eventSchedProcessWaking() {
+        return "sched:sched_waking"; //$NON-NLS-1$
+    }
+
     @Override
     public String eventHRTimerStart() {
         return "timer:hrtimer_start";  //$NON-NLS-1$
This page took 0.045068 seconds and 5 git commands to generate.