lttng.ust: Update lib load/unload events for LTTng 2.9
authorAlexandre Montplaisir <alexmonthy@efficios.com>
Tue, 12 Jul 2016 20:26:24 +0000 (16:26 -0400)
committerAlexandre Montplaisir <alexmonthy@efficios.com>
Wed, 13 Jul 2016 18:18:30 +0000 (14:18 -0400)
LTTng 2.9 adds new "lttng_ust_lib:{load|unload|build_id|debug_link}"
events, which should be used instead of the lttng_ust_dl:* events
to track library loading and unloading.

See https://bugs.lttng.org/issues/1035

Bug: 497351

Change-Id: I3a7631afd1ea6701e5bc7e2a5b24919a4ec7eee6
Signed-off-by: Alexandre Montplaisir <alexmonthy@efficios.com>
Reviewed-on: https://git.eclipse.org/r/77177
Reviewed-by: Hudson CI
Reviewed-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Tested-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
lttng/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/tracecompass/internal/lttng2/ust/core/analysis/debuginfo/UstDebugInfoStateProvider.java
lttng/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/tracecompass/internal/lttng2/ust/core/trace/layout/LttngUst29EventLayout.java [new file with mode: 0644]
lttng/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/tracecompass/lttng2/ust/core/trace/LttngUstTrace.java

index de04196fd974dc9a5ed1150fb2ef7fb60c4260d8..67ea2bd18b8a05452bb0740c0de6e85deb21b259 100644 (file)
@@ -80,7 +80,7 @@ public class UstDebugInfoStateProvider extends AbstractTmfStateProvider {
     public static final String DEBUG_LINK_ATTRIB = "debug_link"; //$NON-NLS-1$
 
     /** Version of this state provider */
-    private static final int VERSION = 3;
+    private static final int VERSION = 4;
 
     private static final Logger LOGGER = TraceCompassLog.getLogger(UstDebugInfoStateProvider.class);
 
diff --git a/lttng/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/tracecompass/internal/lttng2/ust/core/trace/layout/LttngUst29EventLayout.java b/lttng/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/tracecompass/internal/lttng2/ust/core/trace/layout/LttngUst29EventLayout.java
new file mode 100644 (file)
index 0000000..f5dde42
--- /dev/null
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2016 EfficiOS Inc., Alexandre Montplaisir
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.internal.lttng2.ust.core.trace.layout;
+
+/**
+ * Updated event definitions for LTTng-UST 2.9.
+ *
+ * @author Alexandre Montplaisir
+ */
+@SuppressWarnings("nls")
+public class LttngUst29EventLayout extends LttngUst28EventLayout {
+
+    /**
+     * Constructor
+     */
+    protected LttngUst29EventLayout() {}
+
+    private static final LttngUst29EventLayout INSTANCE = new LttngUst29EventLayout();
+
+    /**
+     * Get a singleton instance.
+     *
+     * @return The instance
+     */
+    public static LttngUst29EventLayout getInstance() {
+        return INSTANCE;
+    }
+
+    // ------------------------------------------------------------------------
+    // Library load/unload events
+    // ------------------------------------------------------------------------
+
+    /*
+     * With LTTng 2.9, it is now recommended to use the load/unload events
+     * instead of the dlopen/dlclose ones to track libraries loading and
+     * unloading into the process space. The library now does the reference
+     * counting for us. The event fields are exactly the same.
+     *
+     * See https://bugs.lttng.org/issues/1035 and related commits.
+     */
+
+    @Override
+    public String eventDlOpen() {
+        return "lttng_ust_lib:load";
+    }
+
+    @Override
+    public String eventDlClose() {
+        return "lttng_ust_lib:unload";
+    }
+
+    @Override
+    public String eventDlBuildId() {
+        return "lttng_ust_lib:build_id";
+    }
+
+    @Override
+    public String eventDlDebugLink() {
+        return "lttng_ust_lib:debug_link";
+    }
+
+}
index 03fe86ed9f648fc2aa77e6f59a4f5c3ffc9fb68d..8660c255d3bf5c969e1e3ba25e2929d2eb8a0e67 100644 (file)
@@ -27,6 +27,7 @@ import org.eclipse.tracecompass.internal.lttng2.ust.core.Activator;
 import org.eclipse.tracecompass.internal.lttng2.ust.core.trace.layout.LttngUst20EventLayout;
 import org.eclipse.tracecompass.internal.lttng2.ust.core.trace.layout.LttngUst27EventLayout;
 import org.eclipse.tracecompass.internal.lttng2.ust.core.trace.layout.LttngUst28EventLayout;
+import org.eclipse.tracecompass.internal.lttng2.ust.core.trace.layout.LttngUst29EventLayout;
 import org.eclipse.tracecompass.lttng2.ust.core.analysis.debuginfo.UstDebugInfoBinaryAspect;
 import org.eclipse.tracecompass.lttng2.ust.core.analysis.debuginfo.UstDebugInfoFunctionAspect;
 import org.eclipse.tracecompass.lttng2.ust.core.analysis.debuginfo.UstDebugInfoSourceAspect;
@@ -109,7 +110,9 @@ public class LttngUstTrace extends CtfTmfTrace {
 
         if (TRACER_NAME.equals(tracerName)) {
             if (tracerMajor >= 2) {
-                if (tracerMinor >= 8) {
+                if (tracerMinor >= 9) {
+                    return LttngUst29EventLayout.getInstance();
+                } else if (tracerMinor >= 8) {
                     return LttngUst28EventLayout.getInstance();
                 } else if (tracerMinor >= 7) {
                     return LttngUst27EventLayout.getInstance();
This page took 0.027573 seconds and 5 git commands to generate.