os.linux: Correctly model each CPU's run queue
[deliverable/tracecompass.git] / analysis / org.eclipse.tracecompass.analysis.os.linux.core / src / org / eclipse / tracecompass / analysis / os / linux / core / trace / IKernelAnalysisEventLayout.java
index 6ff8fdc0336fb053eb5961552a2d481af06dddad..ae77d746b815dc37039de8e288680699de7350cb 100644 (file)
@@ -13,6 +13,7 @@
 package org.eclipse.tracecompass.analysis.os.linux.core.trace;
 
 import java.util.Collection;
+import java.util.Collections;
 
 import org.eclipse.jdt.annotation.Nullable;
 
@@ -30,12 +31,6 @@ public interface IKernelAnalysisEventLayout {
     // Common definitions
     // ------------------------------------------------------------------------
 
-    /**
-     * The standard layout, very useful for test vectors that are not kernel
-     * based.
-     */
-    IKernelAnalysisEventLayout DEFAULT_LAYOUT = DefaultEventLayout.getInstance();
-
     /**
      * Whenever a process appears for the first time in a trace, we assume it
      * starts inside this system call. (The syscall prefix is defined by the
@@ -225,6 +220,16 @@ public interface IKernelAnalysisEventLayout {
      */
     String eventSchedProcessWakeupNew();
 
+    /**
+     * Migration event, moving a non-running thread from one CPU's run queue to
+     * another.
+     *
+     * @return The event name
+     * @since 2.2
+     */
+    default String eventSchedMigrateTask() {
+        return "sched_migrate_task"; //$NON-NLS-1$
+    }
 
     /**
      * Starting the high resolution timer
@@ -293,8 +298,8 @@ public interface IKernelAnalysisEventLayout {
     /**
      * The kernel just allocated a page of memory.
      * <p>
-     * In Linux, this typically means a user space application just got a page of
-     * ram.
+     * In Linux, this typically means a user space application just got a page
+     * of ram.
      *
      * @return the event name
      * @since 2.0
@@ -311,6 +316,46 @@ public interface IKernelAnalysisEventLayout {
      */
     String eventKmemPageFree();
 
+    /**
+     * <em>Interprocessor interrupts</em> (IPIs) are special types of interrupts by which
+     * one processor will interrupt another in a multi-core and multi-cpu system. They are
+     * typically used for
+     * <ol>
+     * <li>cache flushes</li>
+     * <li>shutdowns</li>
+     * <ol>
+     * They are not logged with standard events, but rather events looking like
+     * "x86_irq_vectors_thermal_apic_exit".
+     * <p>
+     * This event describes the entries into IPIs.
+     *
+     * @return the IPI list
+     * @since 2.1
+     */
+    default Collection<String> getIPIIrqVectorsEntries() {
+        return Collections.emptyList();
+    }
+
+    /**
+     * <em>Interprocessor interrupts</em> (IPIs) are special types of interrupts by which
+     * one processor will interrupt another in a multi-core and multi-cpu system. They are
+     * typically used for
+     * <ol>
+     * <li>cache flushes</li>
+     * <li>shutdowns</li>
+     * <ol>
+     * They are not logged with standard events, but rather events looking like
+     * "x86_irq_vectors_thermal_apic_exit".
+     * <p>
+     * This event describes the exits into IPIs.
+     *
+     * @return the IPI list
+     * @since 2.1
+     */
+    default Collection<String> getIPIIrqVectorsExits() {
+        return Collections.emptyList();
+    }
+
     // ------------------------------------------------------------------------
     // Event field names
     // ------------------------------------------------------------------------
@@ -495,6 +540,15 @@ public interface IKernelAnalysisEventLayout {
      */
     String fieldNewPrio();
 
+    /**
+     * The field with the prev priority. This is used in the scheduler's switch
+     * event to show the priority of the thread being scheduled out.
+     *
+     * @return the name of the field with the priority of the previous thread
+     * @since 2.0
+     */
+    String fieldPrevPrio();
+
     /**
      * The field with the next priority. This is used in the scheduler's switch
      * event to show the priority of the next thread or process.
@@ -513,8 +567,8 @@ public interface IKernelAnalysisEventLayout {
     String fieldHRtimer();
 
     /**
-     * The field with the expires value. The expires field holds the expiry time.
-     * of the hrtimer.
+     * The field with the expires value. The expires field holds the expiry
+     * time. of the hrtimer.
      *
      * @return the name of the expires field
      * @since 2.0
@@ -522,8 +576,8 @@ public interface IKernelAnalysisEventLayout {
     String fieldHRtimerExpires();
 
     /**
-     * Gets the field name with the softexpires value. The softexpire value is the
-     * absolute earliest expiry time of the hrtimer.
+     * Gets the field name with the softexpires value. The softexpire value is
+     * the absolute earliest expiry time of the hrtimer.
      *
      * @return the name of the softexpires field
      * @since 2.0
@@ -557,6 +611,28 @@ public interface IKernelAnalysisEventLayout {
         return "ret"; //$NON-NLS-1$
     }
 
+    /**
+     * Field indicating the upcoming CPU of sched_wakeup and sched_waking
+     * events.
+     *
+     * @return The field name
+     * @since 2.2
+     */
+    default String fieldTargetCpu() {
+        return "target_cpu"; //$NON-NLS-1$
+    }
+
+    /**
+     * Field of scheduler migration events, indicating the destination CPU of a
+     * thread being migrated.
+     *
+     * @return The field name
+     * @since 2.2
+     */
+    default String fieldDestCpu() {
+        return "dest_cpu"; //$NON-NLS-1$
+    }
+
     // ------------------------------------------------------------------------
     // I/O events and fields
     // ------------------------------------------------------------------------
@@ -704,4 +780,99 @@ public interface IKernelAnalysisEventLayout {
         return "diskname"; //$NON-NLS-1$
     }
 
+    /**
+     * The field with the IRQ number. This is used in IPI handlers (entry and
+     * exit).
+     *
+     * @return the name of the field with the IRQ number
+     * @since 2.1
+     */
+    default String fieldIPIVector() {
+        return "vector"; //$NON-NLS-1$
+    }
+
+    // ------------------------------------------------------------------------
+    // Network events and fields
+    // ------------------------------------------------------------------------
+
+    /**
+     * Get the list of events indicating that a packet is sent on the network
+     *
+     * @return The name of the packet send event
+     * @since 2.1
+     */
+    default Collection<String> eventsNetworkSend() {
+        return Collections.EMPTY_SET;
+    }
+
+    /**
+     * Get the list of events indicating that a packet is received from the
+     * network
+     *
+     * @return The collection of names of the packet receive event
+     * @since 2.1
+     */
+    default Collection<String> eventsNetworkReceive() {
+        return Collections.EMPTY_SET;
+    }
+
+    /**
+     * The path of the field corresponding to the sequence number field of a TCP
+     * header
+     *
+     * @return The path of the sequence number field in the TCP header of a
+     *         network packet
+     * @since 2.1
+     */
+    default String[] fieldPathTcpSeq() {
+        return new String[] { "seq" }; //$NON-NLS-1$
+    }
+
+    /**
+     * The path of the field corresponding to the acknowledgment number field of
+     * a TCP header
+     *
+     * @return The name of the acknowledgment number field in the TCP header of
+     *         a network packet
+     * @since 2.1
+     */
+    default String[] fieldPathTcpAckSeq() {
+        return new String[] { "ack_seq" }; //$NON-NLS-1$
+    }
+
+    /**
+     * The path of the field corresponding to the flags field of a TCP header
+     *
+     * @return The path of the flags field in the TCP header of a network packet
+     * @since 2.1
+     */
+    default String[] fieldPathTcpFlags() {
+        return new String[] { "flags" }; //$NON-NLS-1$
+    }
+
+    // ------------------------------------------------------------------------
+    // VirtualMachine events : kvm entry/exit events
+    // ------------------------------------------------------------------------
+
+    /**
+     * KVM kernel event indicating that virtual machine code is being run
+     *
+     * @return The name of the kvm entry event
+     * @since 2.1
+     */
+    default Collection<String> eventsKVMEntry() {
+        return Collections.EMPTY_SET;
+    }
+
+    /**
+     * KVM kernel event indicating that virtual machine code is not run anymore,
+     * but rather hypervisor-specific code
+     *
+     * @return The name of the kvm exit event
+     * @since 2.1
+     */
+    default Collection<String> eventsKVMExit() {
+        return Collections.EMPTY_SET;
+    }
+
 }
This page took 0.029729 seconds and 5 git commands to generate.