lttng: Handle compat_syscall_exit_* events correctly
authorAlexandre Montplaisir <alexmonthy@efficios.com>
Mon, 25 Jan 2016 20:26:04 +0000 (15:26 -0500)
committerAlexandre Montplaisir <alexmonthy@efficios.com>
Mon, 25 Jan 2016 21:42:29 +0000 (16:42 -0500)
The compatibility layer syscall entry events were handled correctly,
but not the corresponding exit ones.

Bug: 486351

Change-Id: I2709a406eec805a8410651972fac618dcaf27dc4
Signed-off-by: Alexandre Montplaisir <alexmonthy@efficios.com>
Reviewed-on: https://git.eclipse.org/r/65134
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-by: Hudson CI
analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/analysis/os/linux/core/trace/DefaultEventLayout.java
analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/analysis/os/linux/core/trace/IKernelAnalysisEventLayout.java
analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/internal/analysis/os/linux/core/kernel/KernelStateProvider.java
lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/trace/layout/Lttng26EventLayout.java
lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/trace/layout/LttngEventLayout.java
lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/trace/layout/PerfEventLayout.java

index 7a59d87e07c0196c459029d599cd18f612f79103..87da71bbfd8321c1f34c1703a0c16405050175d5 100644 (file)
@@ -181,6 +181,12 @@ public class DefaultEventLayout implements IKernelAnalysisEventLayout{
         return SYSCALL_EXIT_PREFIX;
     }
 
+    /** @since 2.0 */
+    @Override
+    public String eventCompatSyscallExitPrefix() {
+        return SYSCALL_EXIT_PREFIX;
+    }
+
     // ------------------------------------------------------------------------
     // Event field names
     // ------------------------------------------------------------------------
index 0d7e59b854c58245a16c57807d3b6ccaeee9df8a..75e43fa7c8dcc4e4081b7ff9eec47f8da4b957f3 100644 (file)
@@ -184,6 +184,15 @@ public interface IKernelAnalysisEventLayout {
      */
     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
index 9474d0a2dbe1fb09bfc3d57cb67f61edd6665a10..279e0db21c8ea9b77386c61dec2500a884787d97 100644 (file)
@@ -61,7 +61,7 @@ public class KernelStateProvider extends AbstractTmfStateProvider {
      * Version number of this state provider. Please bump this if you modify the
      * contents of the generated state history in some way.
      */
-    private static final int VERSION = 10;
+    private static final int VERSION = 11;
 
     // ------------------------------------------------------------------------
     // Fields
@@ -195,7 +195,8 @@ public class KernelStateProvider extends AbstractTmfStateProvider {
     }
 
     private boolean isSyscallExit(String eventName) {
-        return (eventName.startsWith(fLayout.eventSyscallExitPrefix()));
+        return (eventName.startsWith(fLayout.eventSyscallExitPrefix()) ||
+                eventName.startsWith(fLayout.eventCompatSyscallExitPrefix()));
     }
 
 }
index 34284ceda12d0b48892246b4c33c03deae704dd3..606699a8f69ad0ec6652d8be9b7f0f7ea4eea280 100644 (file)
@@ -49,4 +49,9 @@ public class Lttng26EventLayout extends LttngEventLayout {
     public String eventSyscallExitPrefix() {
         return "syscall_exit_"; //$NON-NLS-1$
     }
+
+    @Override
+    public String eventCompatSyscallExitPrefix() {
+        return "compat_syscall_exit_"; //$NON-NLS-1$
+    }
 }
index d0454610b17ba4398d091b1a2b6c3b2ddbd1534f..80dcf265e9b3f1a3d996ffeb0daeeb9d813af1de 100644 (file)
@@ -185,6 +185,15 @@ public class LttngEventLayout implements IKernelAnalysisEventLayout {
         return SYSCALL_EXIT_PREFIX;
     }
 
+    @Override
+    public String eventCompatSyscallExitPrefix() {
+        /*
+         * In LTTng < 2.6, the same generic event name is used for both standard
+         * and compat syscalls.
+         */
+        return SYSCALL_EXIT_PREFIX;
+    }
+
     // ------------------------------------------------------------------------
     // Event field names
     // ------------------------------------------------------------------------
index ad164dc28d3726726fda45ebf4c31c6185402f68..1b927c4c828b4e76f750ca3a0076d2383ccec621 100644 (file)
@@ -124,6 +124,11 @@ public class PerfEventLayout implements IKernelAnalysisEventLayout {
         return "raw_syscalls:sys_exit"; //$NON-NLS-1$
     }
 
+    @Override
+    public String eventCompatSyscallExitPrefix() {
+        return eventSyscallExitPrefix();
+    }
+
     @Override
     public String eventSchedProcessExec() {
         return "sched:sched_process_exec"; //$NON-NLS-1$
This page took 0.033508 seconds and 5 git commands to generate.