linux/lttng: Fix return type and names of layout's network events
authorGeneviève Bastien <gbastien+lttng@versatic.net>
Thu, 28 Jul 2016 14:49:38 +0000 (10:49 -0400)
committerGenevieve Bastien <gbastien+lttng@versatic.net>
Mon, 8 Aug 2016 13:19:15 +0000 (09:19 -0400)
All new events added to the layout should return a Collection instead of a
single string. This patch updates the network event's signature

Change-Id: I978f760d6f72714467511f3c58c7a9f3a134830d
Signed-off-by: Geneviève Bastien <gbastien+lttng@versatic.net>
Reviewed-on: https://git.eclipse.org/r/78070
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-by: Hudson CI
Reviewed-by: Alexandre Montplaisir <alexmonthy@efficios.com>
analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/analysis/os/linux/core/trace/IKernelAnalysisEventLayout.java
lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/trace/layout/Lttng27EventLayout.java
lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/trace/layout/LttngEventLayout.java

index 47289c9887710489af4849d434c59cbffb299d65..84f0837b9fe65836bf1ac70c191a779ad3473655 100644 (file)
@@ -763,13 +763,13 @@ public interface IKernelAnalysisEventLayout {
     // ------------------------------------------------------------------------
 
     /**
-     * An event indicating that a packet is sent on the network
+     * 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 String eventNetworkSend() {
-        return "net_dev_queue"; //$NON-NLS-1$
+    default Collection<String> eventsNetworkSend() {
+        return Collections.EMPTY_SET;
     }
 
     /**
@@ -779,8 +779,8 @@ public interface IKernelAnalysisEventLayout {
      * @return The collection of names of the packet receive event
      * @since 2.1
      */
-    default Collection<String> eventNetworkReceive() {
-        return Collections.singleton("netif_receive_skb"); //$NON-NLS-1$
+    default Collection<String> eventsNetworkReceive() {
+        return Collections.EMPTY_SET;
     }
 
     /**
index c0b64ed099c1309474b1208333e1a1404391d8c2..cdba8318c7459819ae3b4fa2a23e97cdcbbaa217 100644 (file)
 package org.eclipse.tracecompass.internal.lttng2.kernel.core.trace.layout;
 
 import java.util.Collection;
+import java.util.Collections;
 
 import org.eclipse.jdt.annotation.NonNull;
 
-import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableSet;
 
 /**
@@ -50,11 +50,11 @@ public class Lttng27EventLayout extends Lttng26EventLayout {
     private static final String X86_IRQ_VECTORS_DEFERRED_ERROR_APIC_EXIT = "x86_irq_vectors_deferred_error_apic_exit";   //$NON-NLS-1$
     private static final String X86_IRQ_VECTORS_THERMAL_APIC_ENTRY = "x86_irq_vectors_thermal_apic_entry";  //$NON-NLS-1$
     private static final String X86_IRQ_VECTORS_THERMAL_APIC_EXIT = "x86_irq_vectors_thermal_apic_exit";  //$NON-NLS-1$
+    /* Network event */
+    private static final Collection<String> EVENTS_NETWORK_RECEIVE = Collections.singleton("net_if_receive_skb"); //$NON-NLS-1$
     /* KVM events */
-    private static final String KVM_X86_ENTRY = "kvm_x86_entry";  //$NON-NLS-1$
-    private static final String KVM_X86_EXIT = "kvm_x86_exit";  //$NON-NLS-1$
-    private static final Collection<String> KVM_ENTRY_EVENTS = ImmutableSet.of(KVM_X86_ENTRY);
-    private static final Collection<String> KVM_EXIT_EVENTS = ImmutableSet.of(KVM_X86_EXIT);
+    private static final Collection<String> KVM_ENTRY_EVENTS = Collections.singleton("kvm_x86_entry"); //$NON-NLS-1$
+    private static final Collection<String> KVM_EXIT_EVENTS = Collections.singleton("kvm_x86_exit"); //$NON-NLS-1$
 
     private static final Collection<String> IPI_ENTRY_SET = ImmutableSet.of(
             X86_IRQ_VECTORS_LOCAL_TIMER_ENTRY,
@@ -283,8 +283,8 @@ public class Lttng27EventLayout extends Lttng26EventLayout {
     }
 
     @Override
-    public @NonNull Collection<@NonNull String> eventNetworkReceive() {
-        return ImmutableList.of("netif_receive_skb", "net_if_receive_skb"); //$NON-NLS-1$ //$NON-NLS-2$
+    public Collection<String> eventsNetworkReceive() {
+        return EVENTS_NETWORK_RECEIVE;
     }
 
 }
index 770f9908bceace3b2a9bb71d8cfdb838d9d72917..f46363ee84307ae11945bffc46716b35f933c8fe 100644 (file)
@@ -19,7 +19,6 @@ import org.eclipse.jdt.annotation.NonNull;
 import org.eclipse.tracecompass.analysis.os.linux.core.trace.IKernelAnalysisEventLayout;
 
 import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableSet;
 
 /**
  * This file defines all the known event and field names for LTTng kernel
@@ -108,17 +107,15 @@ public class LttngEventLayout implements IKernelAnalysisEventLayout {
     private static final String NEXTRQ_SECTOR= "nextrq_sector";
 
     /* Network events and field names */
-    private static final String EVENT_NETWORK_SEND = "net_dev_queue";
-    private static final String EVENT_NETWORK_RECEIVE = "netif_receive_skb";
+    private static final Collection<String> EVENTS_NETWORK_SEND = Collections.singleton("net_dev_queue");
+    private static final Collection<String> EVENTS_NETWORK_RECEIVE = Collections.singleton("netif_receive_skb");
     private static final String[] TCP_SEQ_FIELD = { "transport_fields", "thtype_tcp", "seq" };
     private static final String[] TCP_ACK_FIELD = { "transport_fields", "thtype_tcp", "ack_seq" };
     private static final String[] TCP_FLAGS_FIELD = { "transport_fields", "thtype_tcp", "flags" };
 
     /* KVM events */
-    private static final String KVM_ENTRY = "kvm_entry";  //$NON-NLS-1$
-    private static final String KVM_EXIT = "kvm_exit";  //$NON-NLS-1$
-    private static final Collection<String> KVM_ENTRY_EVENTS = ImmutableSet.of(KVM_ENTRY);
-    private static final Collection<String> KVM_EXIT_EVENTS = ImmutableSet.of(KVM_EXIT);
+    private static final Collection<String> KVM_ENTRY_EVENTS = Collections.singleton("kvm_entry");
+    private static final Collection<String> KVM_EXIT_EVENTS = Collections.singleton("kvm_exit");
 
     /** All instances are the same. Only provide a static instance getter */
     protected LttngEventLayout() {
@@ -489,13 +486,13 @@ public class LttngEventLayout implements IKernelAnalysisEventLayout {
     }
 
     @Override
-    public @NonNull String eventNetworkSend() {
-        return EVENT_NETWORK_SEND;
+    public Collection<String> eventsNetworkSend() {
+        return EVENTS_NETWORK_SEND;
     }
 
     @Override
-    public @NonNull Collection<@NonNull String> eventNetworkReceive() {
-        return Collections.singleton(EVENT_NETWORK_RECEIVE);
+    public Collection<String> eventsNetworkReceive() {
+        return EVENTS_NETWORK_RECEIVE;
     }
 
     @Override
This page took 0.03024 seconds and 5 git commands to generate.