lttng: Update statedump event names for UST 2.8
authorAlexandre Montplaisir <alexmonthy@efficios.com>
Thu, 5 May 2016 18:11:47 +0000 (14:11 -0400)
committerAlexandre Montplaisir <alexmonthy@efficios.com>
Mon, 9 May 2016 21:00:44 +0000 (17:00 -0400)
LTTng 2.8 RC2 changes the name of the "soinfo" event to "bin_info".
Also, its "sopath" field becomes just "path".

No point supporting the older names since it was never part of a
released version.

See https://lists.lttng.org/pipermail/lttng-dev/2016-April/025764.html

Update corresponding tests to use the new DEBUG_INFO3 which has
the updated event names.

Change-Id: Ibfe5701d7cc281d2a055f36eb5f0a1a90caab6ec
Signed-off-by: Alexandre Montplaisir <alexmonthy@efficios.com>
Reviewed-on: https://git.eclipse.org/r/72241
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.tests/src/org/eclipse/tracecompass/lttng2/ust/core/tests/analysis/debuginfo/UstDebugInfoAnalysisModuleTest.java
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/LttngUst28EventLayout.java

index 76140ab587094a85deadf3af4f22af1f45864b6e..e1daa201822809255be7d0374d67d058d8b3fada 100644 (file)
@@ -9,22 +9,33 @@
 
 package org.eclipse.tracecompass.lttng2.ust.core.tests.analysis.debuginfo;
 
+import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
+import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
+import java.util.ArrayList;
 import java.util.Collection;
+import java.util.List;
 
 import org.eclipse.jdt.annotation.NonNull;
 import org.eclipse.tracecompass.internal.lttng2.ust.core.analysis.debuginfo.UstDebugInfoBinaryFile;
 import org.eclipse.tracecompass.lttng2.ust.core.analysis.debuginfo.UstDebugInfoAnalysisModule;
+import org.eclipse.tracecompass.lttng2.ust.core.analysis.debuginfo.UstDebugInfoBinaryAspect;
+import org.eclipse.tracecompass.lttng2.ust.core.trace.LttngUstEvent;
 import org.eclipse.tracecompass.lttng2.ust.core.trace.LttngUstTrace;
 import org.eclipse.tracecompass.statesystem.core.ITmfStateSystem;
 import org.eclipse.tracecompass.testtraces.ctf.CtfTestTrace;
 import org.eclipse.tracecompass.tmf.core.analysis.requirements.TmfAnalysisRequirement;
+import org.eclipse.tracecompass.tmf.core.event.ITmfEvent;
 import org.eclipse.tracecompass.tmf.core.exceptions.TmfAnalysisException;
 import org.eclipse.tracecompass.tmf.core.exceptions.TmfTraceException;
+import org.eclipse.tracecompass.tmf.core.request.ITmfEventRequest.ExecutionType;
+import org.eclipse.tracecompass.tmf.core.request.TmfEventRequest;
+import org.eclipse.tracecompass.tmf.core.signal.TmfSignalManager;
+import org.eclipse.tracecompass.tmf.core.signal.TmfTraceOpenedSignal;
 import org.eclipse.tracecompass.tmf.ctf.core.event.CtfTmfEvent;
 import org.eclipse.tracecompass.tmf.ctf.core.tests.shared.CtfTmfTestTraceUtils;
 import org.junit.After;
@@ -41,8 +52,7 @@ import com.google.common.collect.Iterables;
  */
 public class UstDebugInfoAnalysisModuleTest {
 
-    // TODO Change to real traces
-    private static final @NonNull CtfTestTrace TEST_TRACE = CtfTestTrace.DEBUG_INFO;
+    private static final @NonNull CtfTestTrace TEST_TRACE = CtfTestTrace.DEBUG_INFO3;
     private static final @NonNull CtfTestTrace INVALID_TRACE = CtfTestTrace.CYG_PROFILE;
 
     private LttngUstTrace fTrace;
@@ -130,6 +140,55 @@ public class UstDebugInfoAnalysisModuleTest {
         assertNotNull(ss);
     }
 
+    /**
+     * Test that the binary callsite aspect resolves correctly for some
+     * user-defined tracepoints in the trace.
+     *
+     * These should be available even without the binaries with debug symbols
+     * being present on the system.
+     */
+    @Test
+    public void testBinaryCallsites() {
+        assertNotNull(fTrace);
+        /*
+         * Fake a "trace opened" signal, so that the relevant analyses are
+         * started.
+         */
+        TmfTraceOpenedSignal signal = new TmfTraceOpenedSignal(this, fTrace, null);
+        TmfSignalManager.dispatchSignal(signal);
+
+        /* Send a request to get the 3 events we are interested in */
+        List<@NonNull LttngUstEvent> events = new ArrayList<>();
+        TmfEventRequest request = new TmfEventRequest(LttngUstEvent.class, 287, 3, ExecutionType.FOREGROUND) {
+            @Override
+            public void handleData(ITmfEvent event) {
+                super.handleData(event);
+                events.add((LttngUstEvent) event);
+            }
+        };
+        fTrace.sendRequest(request);
+        try {
+            request.waitForCompletion();
+        } catch (InterruptedException e) {
+            fail(e.getMessage());
+        }
+
+        /* Tests that the aspects are resolved correctly */
+        final UstDebugInfoBinaryAspect aspect = UstDebugInfoBinaryAspect.INSTANCE;
+
+        String actual = checkNotNull(aspect.resolve(events.get(0))).toString();
+        String expected = "/home/alexandre/src/lttng-project/lttng/trace-utils/dynamicLinking/libhello.so+0x15ae";
+        assertEquals(expected, actual);
+
+        actual = checkNotNull(aspect.resolve(events.get(1))).toString();
+        expected = "/home/alexandre/src/lttng-project/lttng/trace-utils/dynamicLinking/libhello.so+0x1680";
+        assertEquals(expected, actual);
+
+        actual = checkNotNull(aspect.resolve(events.get(2))).toString();
+        expected = "/home/alexandre/src/lttng-project/lttng/trace-utils/dynamicLinking/libhello.so+0x1745";
+        assertEquals(expected, actual);
+    }
+
     /**
      * Test the {@link UstDebugInfoAnalysisModule#getAllBinaries} method.
      */
@@ -138,18 +197,59 @@ public class UstDebugInfoAnalysisModuleTest {
         executeModule();
         Collection<UstDebugInfoBinaryFile> actualBinaries = fModule.getAllBinaries();
         Collection<UstDebugInfoBinaryFile> expectedBinaries = ImmutableList.<UstDebugInfoBinaryFile> builder()
-                .add(new UstDebugInfoBinaryFile("/home/alexandre/src/lttng/examples/test_app_debuginfo/libhello.so", "77e5df951d3c960de71aa816dace97d0769c6357"))
-                .add(new UstDebugInfoBinaryFile("/home/alexandre/src/lttng/examples/test_app_debuginfo/main.out", "a6048c2a073213db0815a08cccd8d7bc17999a12"))
-                .add(new UstDebugInfoBinaryFile("/lib/x86_64-linux-gnu/ld-2.21.so", "903bb7a6deefd966dceec4566c70444c727ed294"))
-                .add(new UstDebugInfoBinaryFile("/lib/x86_64-linux-gnu/libc-2.21.so", "8acd43cf74a9756cd727b8516b08679ee071a92d"))
-                .add(new UstDebugInfoBinaryFile("/lib/x86_64-linux-gnu/libdl-2.21.so", "f974b99c0c327670ef882ba13912e995a12c6402"))
-                .add(new UstDebugInfoBinaryFile("/lib/x86_64-linux-gnu/libpthread-2.21.so", "a37a144bcbee86a9e02dff5021a111ede6a1f212"))
-                .add(new UstDebugInfoBinaryFile("/lib/x86_64-linux-gnu/librt-2.21.so", "cb26cb6169cbaa9da2e38a70bcf7d57a8047ccf3"))
-                .add(new UstDebugInfoBinaryFile("/usr/lib/x86_64-linux-gnu/liburcu-bp.so.3.0.0", "b89e6022fa66afaea454ac9825bd2d1d8aabcc2f"))
-                .add(new UstDebugInfoBinaryFile("/usr/lib/x86_64-linux-gnu/liburcu-cds.so.3.0.0", "20adc09068db509a8ee159e5a5cab1642c45aaad"))
-                .add(new UstDebugInfoBinaryFile("/usr/local/lib/liblttng-ust-dl.so.0.0.0", "6b2b70024b39672b34268974ec84d65dcd91bd91"))
-                .add(new UstDebugInfoBinaryFile("/usr/local/lib/liblttng-ust-tracepoint.so.0.0.0", "46ef60f7a1b42cbb97dae28ae2231a7e84f0bc05"))
-                .add(new UstDebugInfoBinaryFile("/usr/local/lib/liblttng-ust.so.0.0.0", "48e2b74b240d06d86b5730d666fa0af8337fbe99"))
+                .add(new UstDebugInfoBinaryFile("/home/alexandre/src/lttng-project/lttng/trace-utils/dynamicLinking/libhello.so" ,"c9ac43c6b4251b0789ada66931e33487d65f64a6"))
+                .add(new UstDebugInfoBinaryFile("/home/alexandre/src/lttng-project/lttng/trace-utils/dynamicLinking/main.out" ,"0ec3294d0cacff93ec30b7161ff21efcd4cdd327"))
+                .add(new UstDebugInfoBinaryFile("/lib/x86_64-linux-gnu/ld-2.23.so" ,"edfa6d46e00ca97f349fdd3333d88493d442932c"))
+                .add(new UstDebugInfoBinaryFile("/lib/x86_64-linux-gnu/libc-2.23.so" ,"369de0e1d833caa693af17f17c83ba937f0a4dad"))
+                .add(new UstDebugInfoBinaryFile("/lib/x86_64-linux-gnu/libdl-2.23.so" ,"a2adf3615338d49c702c41eb83a99ab743d2b574"))
+                .add(new UstDebugInfoBinaryFile("/lib/x86_64-linux-gnu/libgcc_s.so.1" ,"68220ae2c65d65c1b6aaa12fa6765a6ec2f5f434"))
+                .add(new UstDebugInfoBinaryFile("/lib/x86_64-linux-gnu/libglib-2.0.so.0.4800.0" ,"8b553ecf9133c50f36a7345a4924c5b97e9daa11"))
+                .add(new UstDebugInfoBinaryFile("/lib/x86_64-linux-gnu/liblzma.so.5.0.0" ,"15aed4855920e5a0fb8791b683eb88c7e1199260"))
+                .add(new UstDebugInfoBinaryFile("/lib/x86_64-linux-gnu/libm-2.23.so" ,"5c4078c04888a418f3db0868702ecfdb35b3ad8b"))
+                .add(new UstDebugInfoBinaryFile("/lib/x86_64-linux-gnu/libpcre.so.3.13.2" ,"390b2228e9a1071bb0be285d77b6669cb37ce628"))
+                .add(new UstDebugInfoBinaryFile("/lib/x86_64-linux-gnu/libpthread-2.23.so" ,"b77847cc9cacbca3b5753d0d25a32e5795afe75b"))
+                .add(new UstDebugInfoBinaryFile("/lib/x86_64-linux-gnu/libresolv-2.23.so" ,"81ef82040e9877e63adca93b365f52a4bb831ee1"))
+                .add(new UstDebugInfoBinaryFile("/lib/x86_64-linux-gnu/librt-2.23.so" ,"a779dbcb3a477dc0c8d09b60fac7335d396c19df"))
+                .add(new UstDebugInfoBinaryFile("/lib/x86_64-linux-gnu/libselinux.so.1" ,"62a57085aa17036efdcecf6655d9e7be566f6948"))
+                .add(new UstDebugInfoBinaryFile("/lib/x86_64-linux-gnu/libz.so.1.2.8" ,"340b7b463f981b8a0fb3451751f881df1b0c2f74"))
+                .add(new UstDebugInfoBinaryFile("/usr/lib/x86_64-linux-gnu/indicator-transfer/indicator-transfer-service" ,"01c605bcf38d068d77a6e0a02cede6a50c5750b5"))
+                .add(new UstDebugInfoBinaryFile("/usr/lib/x86_64-linux-gnu/indicator-transfer/libbuteo-transfers.so" ,"a3a54ba90d7b7b67e0be9baaae3b91675b630a09"))
+                .add(new UstDebugInfoBinaryFile("/usr/lib/x86_64-linux-gnu/indicator-transfer/libdmtransfers.so" ,"ad8ebd563d733818f9f4a399b8d34c1b7e846f3d"))
+                .add(new UstDebugInfoBinaryFile("/usr/lib/x86_64-linux-gnu/libQt5Core.so.5.5.1" ,"478d22fbdf6a3e0ec3b499bd2bb8e97dbed84fb6"))
+                .add(new UstDebugInfoBinaryFile("/usr/lib/x86_64-linux-gnu/libQt5Xml.so.5.5.1" ,"3a16f2feccfdbca6a40d9bd43ae5a966bca065c7"))
+                .add(new UstDebugInfoBinaryFile("/usr/lib/x86_64-linux-gnu/libaccounts-glib.so.0.1.3" ,"3aaeb6f74d07bd2331fa1664a90b11ca5cc1b71e"))
+                .add(new UstDebugInfoBinaryFile("/usr/lib/x86_64-linux-gnu/libaccounts-qt5.so.1.2.0" ,"c4c36b5efb4dd5f92a53ed0a2844239f564328d7"))
+                .add(new UstDebugInfoBinaryFile("/usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.58.0" ,"8cebf2501fd917f393ef1390777415fca9289878"))
+                .add(new UstDebugInfoBinaryFile("/usr/lib/x86_64-linux-gnu/libboost_system.so.1.58.0" ,"bb484981ddf4152bb6f02ad3a700ec21ca3805e2"))
+                .add(new UstDebugInfoBinaryFile("/usr/lib/x86_64-linux-gnu/libclick-0.4.so.0.4.0" ,"79609d999eab77f934f6d7d296074ea54f1410e8"))
+                .add(new UstDebugInfoBinaryFile("/usr/lib/x86_64-linux-gnu/libffi.so.6.0.4" ,"9d9c958f1f4894afef6aecd90d1c430ea29ac34f"))
+                .add(new UstDebugInfoBinaryFile("/usr/lib/x86_64-linux-gnu/libgee-0.8.so.2.5.1" ,"96aff01de4c5e4817d483de7278c8cc9c6d02001"))
+                .add(new UstDebugInfoBinaryFile("/usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.4800.0" ,"01d955da82f10209b515f362b2352d5a0d0b5330"))
+                .add(new UstDebugInfoBinaryFile("/usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.0.4800.0" ,"a9190276f6246d3a44ba820510ef7d469ea556b1"))
+                .add(new UstDebugInfoBinaryFile("/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.4800.0" ,"bce3f25958a5b88c9493990daf0c90a787444c28"))
+                .add(new UstDebugInfoBinaryFile("/usr/lib/x86_64-linux-gnu/libicudata.so.55.1" ,"233845f0cd27642c4b2cc43979c8801b52bc00a9"))
+                .add(new UstDebugInfoBinaryFile("/usr/lib/x86_64-linux-gnu/libicui18n.so.55.1" ,"7bf3774116dbb992ffcc2156b6f5c44f0a328f00"))
+                .add(new UstDebugInfoBinaryFile("/usr/lib/x86_64-linux-gnu/libicuuc.so.55.1" ,"323e4878073bb4e0d7b174ae24e383ec5e05d68a"))
+                .add(new UstDebugInfoBinaryFile("/usr/lib/x86_64-linux-gnu/libindicator-transfer.so.0.0.2" ,"4e472120f2a19343e1ff5928459edcb4a6c0b1e2"))
+                .add(new UstDebugInfoBinaryFile("/usr/lib/x86_64-linux-gnu/libjson-glib-1.0.so.0.102.0" ,"55c87753a67b0c24922bd091f042b9d8bd4995dc"))
+                .add(new UstDebugInfoBinaryFile("/usr/lib/x86_64-linux-gnu/liblttng-ust-dl.so.0.0.0" ,"450c14d5a7a72780b2d88a3cf73d2e12c2774676"))
+                .add(new UstDebugInfoBinaryFile("/usr/lib/x86_64-linux-gnu/liblttng-ust-tracepoint.so.0.0.0" ,"e70e1748e137bb59b542e15e0722455b998355fc"))
+                .add(new UstDebugInfoBinaryFile("/usr/lib/x86_64-linux-gnu/liblttng-ust.so.0.0.0" ,"101115876419ead3a8bd9a9a08a6d92984015b99"))
+                .add(new UstDebugInfoBinaryFile("/usr/lib/x86_64-linux-gnu/libmirclient.so.9" ,"b4c1509382d3ef5f7458db59710b4d30dad86b5d"))
+                .add(new UstDebugInfoBinaryFile("/usr/lib/x86_64-linux-gnu/libmircommon.so.5" ,"25b5830854701533323f15195ae9e501ad7f772b"))
+                .add(new UstDebugInfoBinaryFile("/usr/lib/x86_64-linux-gnu/libmirprotobuf.so.3" ,"2f6b1a56f1ac43ae001dffde4dc1a24bfee04dec"))
+                .add(new UstDebugInfoBinaryFile("/usr/lib/x86_64-linux-gnu/libpcre16.so.3.13.2" ,"2cc13260733c5b35f311725fca88219b338d5390"))
+                .add(new UstDebugInfoBinaryFile("/usr/lib/x86_64-linux-gnu/libprotobuf-lite.so.9.0.1" ,"625eb54ba7ccc3af18d3193e22cbe9f23dfb88e5"))
+                .add(new UstDebugInfoBinaryFile("/usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6" ,"d9782ba023caec26b15d8676e3a5d07b55e121ef"))
+                .add(new UstDebugInfoBinaryFile("/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21" ,"662f4598d7854c6731f13802486e477a7bdb09c7"))
+                .add(new UstDebugInfoBinaryFile("/usr/lib/x86_64-linux-gnu/libubuntu-app-launch.so.2.0.0" ,"1e5753f4feda98548bd230eb07b81e330f419463"))
+                .add(new UstDebugInfoBinaryFile("/usr/lib/x86_64-linux-gnu/liburcu-bp.so.4.0.0" ,"d208fcd0e6e6968b8110d9c487f63ae1a400e7c2"))
+                .add(new UstDebugInfoBinaryFile("/usr/lib/x86_64-linux-gnu/liburcu-cds.so.4.0.0" ,"177fbd0a1b21145ad2f29bf41ba9f45e43b1ae4a"))
+                .add(new UstDebugInfoBinaryFile("/usr/lib/x86_64-linux-gnu/liburl-dispatcher.so.1.0.0" ,"58e7febb6e33418eee311c0bad19aace5cba0fd1"))
+                .add(new UstDebugInfoBinaryFile("/usr/lib/x86_64-linux-gnu/libxkbcommon.so.0.0.0" ,"29ebf0cc0837b321e6a751b9b7d43ae9f8f3f0c0"))
+                .add(new UstDebugInfoBinaryFile("/usr/lib/x86_64-linux-gnu/libxml2.so.2.9.3" ,"a155c7bc345d0e0b711be09120204bd88f475f9e"))
+                .add(new UstDebugInfoBinaryFile("/usr/lib/x86_64-linux-gnu/libzeitgeist-2.0.so.0.0.0" ,"211049ef6c5ed6e7bbcdc75c0a25d1f11755151d"))
+                .add(new UstDebugInfoBinaryFile("/usr/lib/x86_64-linux-gnu/url-dispatcher/url-dispatcher" ,"694fcf16ee9241e66a33de671d10f854312e0c87"))
                 .build();
 
         assertTrue(actualBinaries.containsAll(expectedBinaries));
index 3d1b831faa82f2ce69315e4afcb738c2c1579cdd..90bba3bd3b2902fd08214b55fbfb164cbe0fb977 100644 (file)
@@ -78,7 +78,7 @@ public class UstDebugInfoStateProvider extends AbstractTmfStateProvider {
     private static final int DL_BUILD_ID_INDEX = 2;
     private static final int DL_DEBUG_LINK_INDEX = 3;
     private static final int DL_DLCLOSE_INDEX = 4;
-    private static final int STATEDUMP_SOINFO_INDEX = 5;
+    private static final int STATEDUMP_BIN_INFO_INDEX = 5;
     private static final int STATEDUMP_BUILD_ID_INDEX = 6;
     private static final int STATEDUMP_DEBUG_LINK_INDEX = 7;
 
@@ -116,7 +116,7 @@ public class UstDebugInfoStateProvider extends AbstractTmfStateProvider {
         builder.put(layout.eventDlBuildId(), DL_BUILD_ID_INDEX);
         builder.put(layout.eventDlDebugLink(), DL_DEBUG_LINK_INDEX);
         builder.put(layout.eventDlClose(), DL_DLCLOSE_INDEX);
-        builder.put(layout.eventStatedumpSoInfo(), STATEDUMP_SOINFO_INDEX);
+        builder.put(layout.eventStatedumpBinInfo(), STATEDUMP_BIN_INFO_INDEX);
         builder.put(layout.eventStateDumpBuildId(), STATEDUMP_BUILD_ID_INDEX);
         builder.put(layout.eventStateDumpDebugLink(), STATEDUMP_DEBUG_LINK_INDEX);
         return builder.build();
@@ -151,7 +151,7 @@ public class UstDebugInfoStateProvider extends AbstractTmfStateProvider {
         try {
             switch (intIndex) {
             case DL_DLOPEN_INDEX:
-            case STATEDUMP_SOINFO_INDEX:
+            case STATEDUMP_BIN_INFO_INDEX:
             {
                 handleOpen(event, vpid, ss);
                 break;
@@ -195,7 +195,7 @@ public class UstDebugInfoStateProvider extends AbstractTmfStateProvider {
     private void handleOpen(ITmfEvent event, final Long vpid, final ITmfStateSystemBuilder ss) throws AttributeNotFoundException {
         Long baddr = (Long) event.getContent().getField(fLayout.fieldBaddr()).getValue();
         Long memsz = (Long) event.getContent().getField(fLayout.fieldMemsz()).getValue();
-        String sopath = (String) event.getContent().getField(fLayout.fieldSopath()).getValue();
+        String sopath = (String) event.getContent().getField(fLayout.fieldPath()).getValue();
 
         long endAddr = baddr.longValue() + memsz.longValue();
         int addrQuark = ss.getQuarkAbsoluteAndAdd(vpid.toString(), baddr.toString());
index 7360a84df1ea21bf68f3732c0133933e48250226..40548264efb4e1702958cf2c61015055b7122671 100644 (file)
@@ -45,8 +45,8 @@ public class LttngUst28EventLayout extends LttngUst27EventLayout {
         return "lttng_ust_statedump:end";
     }
 
-    public String eventStatedumpSoInfo() {
-        return "lttng_ust_statedump:soinfo";
+    public String eventStatedumpBinInfo() {
+        return "lttng_ust_statedump:bin_info";
     }
 
     public String eventStateDumpBuildId() {
@@ -82,8 +82,8 @@ public class LttngUst28EventLayout extends LttngUst27EventLayout {
         return "memsz";
     }
 
-    public String fieldSopath() {
-        return "sopath";
+    public String fieldPath() {
+        return "path";
     }
 
     public String fieldBuildId() {
This page took 0.04165 seconds and 5 git commands to generate.