lttng: Remove procname from callstack requirements
authorGeneviève Bastien <gbastien+lttng@versatic.net>
Tue, 20 Dec 2016 02:17:12 +0000 (21:17 -0500)
committerGenevieve Bastien <gbastien+lttng@versatic.net>
Thu, 30 Mar 2017 13:41:14 +0000 (09:41 -0400)
The analysis does not need the procname and it adds some overhead in a trace
with a lot of function calls. Though procname makes it prettier, it should not
prevent a user from seeing the callstack of a perfectly workable trace.

Change-Id: I3603b52f8559c40b86193d954ab94d9e65dc9bce
Signed-off-by: Geneviève Bastien <gbastien+lttng@versatic.net>
Reviewed-on: https://git.eclipse.org/r/87449
Reviewed-by: Hudson CI
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Tested-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
lttng/org.eclipse.tracecompass.lttng2.ust.core/META-INF/MANIFEST.MF
lttng/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/tracecompass/internal/lttng2/ust/core/callstack/LttngUstCallStackAnalysisRequirement.java
lttng/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/tracecompass/internal/lttng2/ust/core/callstack/LttngUstCallStackProvider.java

index c5d9abe412ab139b63d72d9b27f6bc98c25b3844..a108e18fd1bf358f177523958a990faf4eb228c8 100644 (file)
@@ -28,4 +28,5 @@ Import-Package: com.google.common.annotations;version="15.0.0",
  com.google.common.base,
  com.google.common.cache,
  com.google.common.collect,
- com.google.common.io
+ com.google.common.io,
+ org.apache.commons.lang3;version="3.1.0"
index 771e7070f656fb5a02e6a4bde1667a6c8c7a54b9..2025b4a85a89fdf8749e3ee4262af16d22d41aa1 100644 (file)
@@ -11,6 +11,7 @@ package org.eclipse.tracecompass.internal.lttng2.ust.core.callstack;
 import static org.eclipse.tracecompass.common.core.NonNullUtils.nullToEmptyString;
 
 import java.util.Collection;
+import java.util.Collections;
 import java.util.Set;
 
 import org.eclipse.jdt.annotation.NonNull;
@@ -44,9 +45,7 @@ public class LttngUstCallStackAnalysisRequirement extends TmfCompositeAnalysisRe
     }
 
     private static Collection<TmfAbstractAnalysisRequirement> getSubRequirements(ILttngUstEventLayout layout) {
-        Set<@NonNull String> requiredEventsFields = ImmutableSet.of(
-                layout.contextProcname(),
-                layout.contextVtid());
+        Set<@NonNull String> requiredEventsFields = Collections.singleton(layout.contextVtid());
 
         // Requirement for the cyg_profile events
         TmfAnalysisEventFieldRequirement entryReq = new TmfAnalysisEventFieldRequirement(
index 3486465acdf7f6ab5e253c3724fe6cb07ddf769b..ead41c602bb0b6923176b6b8c5f02df757a562db 100644 (file)
@@ -15,6 +15,7 @@ package org.eclipse.tracecompass.internal.lttng2.ust.core.callstack;
 
 import java.util.Set;
 
+import org.apache.commons.lang3.StringUtils;
 import org.eclipse.jdt.annotation.NonNull;
 import org.eclipse.jdt.annotation.NonNullByDefault;
 import org.eclipse.jdt.annotation.Nullable;
@@ -121,8 +122,7 @@ public class LttngUstCallStackProvider extends CallStackStateProvider {
             return false;
         }
         ITmfEventField content = ((CtfTmfEvent) event).getContent();
-        if (content.getField(fLayout.contextVtid()) == null ||
-                content.getField(fLayout.contextProcname()) == null) {
+        if (content.getField(fLayout.contextVtid()) == null) {
             return false;
         }
         return true;
@@ -178,8 +178,9 @@ public class LttngUstCallStackProvider extends CallStackStateProvider {
     public @Nullable String getThreadName(ITmfEvent event) {
         /* We checked earlier that the "procname" context is present */
         ITmfEventField content = event.getContent();
-        String procName = (String) content.getField(fLayout.contextProcname()).getValue();
+        ITmfEventField field = content.getField(fLayout.contextProcname());
+        String procName = field == null ? StringUtils.EMPTY : (String.valueOf(field.getValue()) + '-');
         long vtid = getThreadId(event);
-        return (procName + '-' + Long.toString(vtid));
+        return (procName + Long.toString(vtid));
     }
 }
This page took 0.032106 seconds and 5 git commands to generate.