package org.eclipse.tracecompass.analysis.os.linux.core.trace;
import java.util.Collection;
+import java.util.Collections;
import org.eclipse.jdt.annotation.Nullable;
// Common definitions
// ------------------------------------------------------------------------
- /**
- * The standard layout, very useful for test vectors that are not kernel
- * based.
- */
- IKernelAnalysisEventLayout DEFAULT_LAYOUT = DefaultEventLayout.INSTANCE;
-
/**
* 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
*/
String eventSyscallExitPrefix();
+ /**
+ * System call compatibility layer exit prefix, something like
+ * "compat_syscall_exit".
+ *
+ * @return the event name
+ * @since 2.0
+ */
+ String eventCompatSyscallExitPrefix();
+
/**
* The scheduler replaced the current process image with a new one. The
* process should also be renamed at this point. In windows, this is part of
*/
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
*/
String eventHRTimerExpireExit();
+ /**
+ * The kernel just allocated a page of memory.
+ * <p>
+ * In Linux, this typically means a user space application just got a page
+ * of ram.
+ *
+ * @return the event name
+ * @since 2.0
+ */
+ String eventKmemPageAlloc();
+
+ /**
+ * The kernel just deallocated a page of memory.
+ * <p>
+ * In Linux, this typically means a page of ram was just freed
+ *
+ * @return the event name
+ * @since 2.0
+ */
+ 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
// ------------------------------------------------------------------------
*/
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.
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
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
*/
String fieldHRtimerNow();
+ /**
+ * The field containing the return value of a system call exit.
+ *
+ * @return The name of return field
+ * @since 2.0
+ */
+ default String fieldSyscallRet() {
+ 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
+ // ------------------------------------------------------------------------
+
+ /**
+ * A request to a block IO has just been inserted in the waiting queue.
+ *
+ * @return The name of the event
+ * @since 2.0
+ */
+ default String eventBlockRqInsert() {
+ return "block_rq_insert"; //$NON-NLS-1$
+ }
+
+ /**
+ * A request to a block IO has just been issued and passed from the waiting
+ * queue to the driver queue. It is being served.
+ *
+ * @return The name of the event
+ * @since 2.0
+ */
+ default String eventBlockRqIssue() {
+ return "block_rq_issue"; //$NON-NLS-1$
+ }
+
+ /**
+ * A request to a block IO has just been completed.
+ *
+ * @return The name of the event
+ * @since 2.0
+ */
+ default String eventBlockRqComplete() {
+ return "block_rq_complete"; //$NON-NLS-1$
+ }
+
+ /**
+ * A BIO operation is being merged at the front of a waiting request
+ *
+ * @return The name of the event
+ * @since 2.0
+ */
+ default String eventBlockBioFrontmerge() {
+ return "block_bio_frontmerge"; //$NON-NLS-1$
+ }
+
+ /**
+ * A BIO operation is being merged at the back of a waiting request
+ *
+ * @return The name of the event
+ * @since 2.0
+ */
+ default String eventBlockBioBackmerge() {
+ return "block_bio_backmerge"; //$NON-NLS-1$
+ }
+
+ /**
+ * 2 requests previously inserted in the waiting queue are being merged
+ *
+ * @return The name of the event
+ * @since 2.0
+ */
+ default String eventBlockRqMerge() {
+ return "block_rq_merge"; //$NON-NLS-1$
+ }
+
+ /**
+ * Optional event used by some tracers to associate the name of the block
+ * device to a device ID
+ *
+ * @return The name of the event
+ * @since 2.0
+ */
+ default @Nullable String eventStatedumpBlockDevice() {
+ return null;
+ }
+
+ /**
+ * The field containing the device ID
+ *
+ * @return The name of the field
+ * @since 2.0
+ */
+ default String fieldBlockDeviceId() {
+ return "dev"; //$NON-NLS-1$
+ }
+
+ /**
+ * The field with the first sector of a block operation
+ *
+ * @return The name of the field
+ * @since 2.0
+ */
+ default String fieldBlockSector() {
+ return "sector"; //$NON-NLS-1$
+ }
+
+ /**
+ * The field with the number of sectors involved in a block operation
+ *
+ * @return The name of the field
+ * @since 2.0
+ */
+ default String fieldBlockNrSector() {
+ return "nr_sector"; //$NON-NLS-1$
+ }
+
+ /**
+ * The field containing the read/write flag of a block operation
+ *
+ * @return The name of the field
+ * @since 2.0
+ */
+ default String fieldBlockRwbs() {
+ return "rwbs"; //$NON-NLS-1$
+ }
+
+ /**
+ * The field with the first sector of a request in which another block
+ * operation is being merged
+ *
+ * @return The name of the field
+ * @since 2.0
+ */
+ default String fieldBlockRqSector() {
+ return "rq_sector"; //$NON-NLS-1$
+ }
+
+ /**
+ * The field with the sector of the request being merged in another one
+ *
+ * @return The name of the field
+ * @since 2.0
+ */
+ default String fieldBlockNextRqSector() {
+ return "nextrq_sector"; //$NON-NLS-1$
+ }
+
+ /**
+ * The field containing the name of the disk
+ *
+ * @return The name of the field
+ * @since 2.0
+ */
+ default String fieldDiskname() {
+ 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;
+ }
+
}