From 48b36dceefd77871835e1b4961fe0ba75f4bbed5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Genevi=C3=A8ve=20Bastien?= Date: Thu, 28 Jul 2016 10:49:38 -0400 Subject: [PATCH] linux/lttng: Fix return type and names of layout's network events MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Reviewed-on: https://git.eclipse.org/r/78070 Reviewed-by: Matthew Khouzam Reviewed-by: Hudson CI Reviewed-by: Alexandre Montplaisir --- .../trace/IKernelAnalysisEventLayout.java | 10 +++++----- .../core/trace/layout/Lttng27EventLayout.java | 14 +++++++------- .../core/trace/layout/LttngEventLayout.java | 19 ++++++++----------- 3 files changed, 20 insertions(+), 23 deletions(-) diff --git a/analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/analysis/os/linux/core/trace/IKernelAnalysisEventLayout.java b/analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/analysis/os/linux/core/trace/IKernelAnalysisEventLayout.java index 47289c9887..84f0837b9f 100644 --- a/analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/analysis/os/linux/core/trace/IKernelAnalysisEventLayout.java +++ b/analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/analysis/os/linux/core/trace/IKernelAnalysisEventLayout.java @@ -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 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 eventNetworkReceive() { - return Collections.singleton("netif_receive_skb"); //$NON-NLS-1$ + default Collection eventsNetworkReceive() { + return Collections.EMPTY_SET; } /** diff --git a/lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/trace/layout/Lttng27EventLayout.java b/lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/trace/layout/Lttng27EventLayout.java index c0b64ed099..cdba8318c7 100644 --- a/lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/trace/layout/Lttng27EventLayout.java +++ b/lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/trace/layout/Lttng27EventLayout.java @@ -13,10 +13,10 @@ 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 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 KVM_ENTRY_EVENTS = ImmutableSet.of(KVM_X86_ENTRY); - private static final Collection KVM_EXIT_EVENTS = ImmutableSet.of(KVM_X86_EXIT); + private static final Collection KVM_ENTRY_EVENTS = Collections.singleton("kvm_x86_entry"); //$NON-NLS-1$ + private static final Collection KVM_EXIT_EVENTS = Collections.singleton("kvm_x86_exit"); //$NON-NLS-1$ private static final Collection 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 eventsNetworkReceive() { + return EVENTS_NETWORK_RECEIVE; } } diff --git a/lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/trace/layout/LttngEventLayout.java b/lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/trace/layout/LttngEventLayout.java index 770f9908bc..f46363ee84 100644 --- a/lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/trace/layout/LttngEventLayout.java +++ b/lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/trace/layout/LttngEventLayout.java @@ -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 EVENTS_NETWORK_SEND = Collections.singleton("net_dev_queue"); + private static final Collection 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 KVM_ENTRY_EVENTS = ImmutableSet.of(KVM_ENTRY); - private static final Collection KVM_EXIT_EVENTS = ImmutableSet.of(KVM_EXIT); + private static final Collection KVM_ENTRY_EVENTS = Collections.singleton("kvm_entry"); + private static final Collection 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 eventsNetworkSend() { + return EVENTS_NETWORK_SEND; } @Override - public @NonNull Collection<@NonNull String> eventNetworkReceive() { - return Collections.singleton(EVENT_NETWORK_RECEIVE); + public Collection eventsNetworkReceive() { + return EVENTS_NETWORK_RECEIVE; } @Override -- 2.34.1