os.tests: Add a kernel stub trace class and use that in unit tests
[deliverable/tracecompass.git] / analysis / org.eclipse.tracecompass.analysis.os.linux.core / src / org / eclipse / tracecompass / analysis / os / linux / core / trace / DefaultEventLayout.java
index a367ebeb17db98c2d5233be2c86c0797ed0e432e..b593e94995f7d44cb99077385b81a7a0c085ca93 100644 (file)
@@ -30,7 +30,7 @@ import com.google.common.collect.ImmutableList;
  * @author Alexandre Montplaisir
  * @since 1.0
  */
-public class DefaultEventLayout implements IKernelAnalysisEventLayout{
+public class DefaultEventLayout implements IKernelAnalysisEventLayout {
 
     /* Event names */
     private static final String IRQ_HANDLER_ENTRY = "irq_handler_entry"; //$NON-NLS-1$
@@ -38,16 +38,19 @@ public class DefaultEventLayout implements IKernelAnalysisEventLayout{
     private static final String SOFTIRQ_ENTRY = "softirq_entry"; //$NON-NLS-1$
     private static final String SOFTIRQ_EXIT = "softirq_exit"; //$NON-NLS-1$
     private static final String SOFTIRQ_RAISE = "softirq_raise"; //$NON-NLS-1$
+    private static final String HRTIMER_START = "hrtimer_start"; //$NON-NLS-1$
+    private static final String HRTIMER_CANCEL = "hrtimer_cancel"; //$NON-NLS-1$
     private static final String HRTIMER_EXPIRE_ENTRY = "hrtimer_expire_entry"; //$NON-NLS-1$
     private static final String HRTIMER_EXPIRE_EXIT = "hrtimer_expire_exit"; //$NON-NLS-1$
     private static final String SCHED_SWITCH = "sched_switch"; //$NON-NLS-1$
     private static final String SCHED_PI_SETPRIO = "sched_pi_setprio"; //$NON-NLS-1$
 
     private static final String SCHED_TTWU = "sched_ttwu"; //$NON-NLS-1$
+    private static final String SCHED_WAKING = "sched_waking"; //$NON-NLS-1$
     private static final String SCHED_WAKEUP = "sched_wakeup"; //$NON-NLS-1$
     private static final String SCHED_WAKEUP_NEW = "sched_wakeup_new"; //$NON-NLS-1$
     private static final Collection<String> SCHED_WAKEUP_EVENTS =
-            checkNotNull(ImmutableList.of(SCHED_WAKEUP, SCHED_WAKEUP_NEW)); //$NON-NLS-1$ //$NON-NLS-2$
+            checkNotNull(ImmutableList.of(SCHED_WAKEUP, SCHED_WAKEUP_NEW));
 
     private static final String SCHED_PROCESS_FORK = "sched_process_fork"; //$NON-NLS-1$
     private static final String SCHED_PROCESS_EXIT = "sched_process_exit"; //$NON-NLS-1$
@@ -78,9 +81,19 @@ public class DefaultEventLayout implements IKernelAnalysisEventLayout{
     private static final String STATUS = "status"; //$NON-NLS-1$
     private static final String PREV_COMM = "prev_comm"; //$NON-NLS-1$
     private static final String FILENAME = "filename"; //$NON-NLS-1$
+    private static final String HRTIMER = "hrtimer"; //$NON-NLS-1$
+    private static final String FUNCTION = "function"; //$NON-NLS-1$
+    private static final String EXPIRES = "expires"; //$NON-NLS-1$
+    private static final String NOW = "now"; //$NON-NLS-1$
+    private static final String SOFT_EXPIRES = "softexpires"; //$NON-NLS-1$
 
-    /** All instances are the same. Only provide a static instance getter */
-    private DefaultEventLayout() {
+    /**
+     * Constructor, to be used by classes extending this one. To get an instance
+     * of this class, INSTANCE should be used.
+     *
+     * @since 2.0
+     */
+    protected DefaultEventLayout() {
     }
 
     /**
@@ -173,6 +186,12 @@ public class DefaultEventLayout implements IKernelAnalysisEventLayout{
         return SYSCALL_EXIT_PREFIX;
     }
 
+    /** @since 2.0 */
+    @Override
+    public String eventCompatSyscallExitPrefix() {
+        return SYSCALL_EXIT_PREFIX;
+    }
+
     // ------------------------------------------------------------------------
     // Event field names
     // ------------------------------------------------------------------------
@@ -293,6 +312,18 @@ public class DefaultEventLayout implements IKernelAnalysisEventLayout{
         return SCHED_WAKEUP_NEW;
     }
 
+    /** @since 2.0 */
+    @Override
+    public String eventHRTimerStart() {
+        return HRTIMER_START;
+    }
+
+    /** @since 2.0 */
+    @Override
+    public String eventHRTimerCancel() {
+        return HRTIMER_CANCEL;
+    }
+
     /** @since 2.0 */
     @Override
     public String eventHRTimerExpireEntry() {
@@ -315,4 +346,44 @@ public class DefaultEventLayout implements IKernelAnalysisEventLayout{
         return SCHED_TTWU;
     }
 
+    /** @since 2.0 */
+    @Override
+    public String fieldHRtimer() {
+        return HRTIMER;
+    }
+
+    /** @since 2.0 */
+    @Override
+    public String fieldHRtimerFunction() {
+        return FUNCTION;
+    }
+
+    /** @since 2.0 */
+    @Override
+    public String fieldHRtimerExpires() {
+        return EXPIRES;
+    }
+
+    /** @since 2.0 */
+    @Override
+    public String fieldHRtimerSoftexpires() {
+        return SOFT_EXPIRES;
+    }
+
+    /** @since 2.0 */
+    @Override
+    public String fieldHRtimerNow() {
+        return NOW;
+    }
+
+    /**
+     * Event indicating the source of the wakeup signal.
+     *
+     * @return The name of the event
+     * @since 2.0
+     */
+    public String eventSchedProcessWaking() {
+        return SCHED_WAKING;
+    }
+
 }
This page took 0.025974 seconds and 5 git commands to generate.