Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeneviève Bastien2019-07-31 11:24:25 -0400
committerGenevieve Bastien2019-08-01 09:49:40 -0400
commit1122cc964aa2f35fcdd2d8c189e9d7e18cd4babb (patch)
treec27dff3179b1ba0fc2eb65fc8b07829af9df6c8b
parent24a162268ab467a45e4d51663ef200d7f430a720 (diff)
downloadorg.eclipse.tracecompass.incubator-1122cc964aa2f35fcdd2d8c189e9d7e18cd4babb.tar.gz
org.eclipse.tracecompass.incubator-1122cc964aa2f35fcdd2d8c189e9d7e18cd4babb.tar.xz
org.eclipse.tracecompass.incubator-1122cc964aa2f35fcdd2d8c189e9d7e18cd4babb.zip
uftrace: Fix parsing recent traces and symbols
The symbol regex needs to support more symbol types and there may be comments in files. Also perf-cpuX.dat files were added recently and they cannot be parsed like the other .dat files. They are currently ignored. [fixed] support comments and symbol types in ufTrace symbol files Change-Id: Iccaa71ebe71e06f6c9a7b552fbb72f923be3f858 Signed-off-by: Geneviève Bastien <gbastien+lttng@versatic.net> Reviewed-on: https://git.eclipse.org/r/146865 Tested-by: CI Bot Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com> Tested-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
-rw-r--r--tracetypes/org.eclipse.tracecompass.incubator.uftrace.core/src/org/eclipse/tracecompass/incubator/internal/uftrace/core/trace/SymParser.java5
-rw-r--r--tracetypes/org.eclipse.tracecompass.incubator.uftrace.core/src/org/eclipse/tracecompass/incubator/internal/uftrace/core/trace/Uftrace.java10
2 files changed, 14 insertions, 1 deletions
diff --git a/tracetypes/org.eclipse.tracecompass.incubator.uftrace.core/src/org/eclipse/tracecompass/incubator/internal/uftrace/core/trace/SymParser.java b/tracetypes/org.eclipse.tracecompass.incubator.uftrace.core/src/org/eclipse/tracecompass/incubator/internal/uftrace/core/trace/SymParser.java
index a52bd6e4..4eb597d4 100644
--- a/tracetypes/org.eclipse.tracecompass.incubator.uftrace.core/src/org/eclipse/tracecompass/incubator/internal/uftrace/core/trace/SymParser.java
+++ b/tracetypes/org.eclipse.tracecompass.incubator.uftrace.core/src/org/eclipse/tracecompass/incubator/internal/uftrace/core/trace/SymParser.java
@@ -32,7 +32,7 @@ import org.apache.commons.io.LineIterator;
*
*/
public class SymParser {
- private static final Pattern REGEX = Pattern.compile("^([a-fA-F\\d]+)\\s+([PTptw])\\s*(.*)$"); //$NON-NLS-1$
+ private static final Pattern REGEX = Pattern.compile("^([a-fA-F\\d]+)\\s+([ABbCcDdGgiNPpRrSsTtUuVvWw\\-\\?])\\s*(.*)$"); //$NON-NLS-1$
/**
* Symbol for
@@ -81,6 +81,9 @@ public class SymParser {
SymParser sp = new SymParser();
while (iter.hasNext()) {
String line = iter.next();
+ if (line.startsWith("#")) {
+ continue;
+ }
Matcher match = REGEX.matcher(line);
if (!match.matches()) {
throw new IllegalArgumentException("invalid " + line); //$NON-NLS-1$
diff --git a/tracetypes/org.eclipse.tracecompass.incubator.uftrace.core/src/org/eclipse/tracecompass/incubator/internal/uftrace/core/trace/Uftrace.java b/tracetypes/org.eclipse.tracecompass.incubator.uftrace.core/src/org/eclipse/tracecompass/incubator/internal/uftrace/core/trace/Uftrace.java
index 985dd028..9f5d2715 100644
--- a/tracetypes/org.eclipse.tracecompass.incubator.uftrace.core/src/org/eclipse/tracecompass/incubator/internal/uftrace/core/trace/Uftrace.java
+++ b/tracetypes/org.eclipse.tracecompass.incubator.uftrace.core/src/org/eclipse/tracecompass/incubator/internal/uftrace/core/trace/Uftrace.java
@@ -152,6 +152,11 @@ public class Uftrace extends TmfTrace implements ITmfPropertiesProvider,
String extension = FilenameUtils.getExtension(file.getName());
if (extension.equals("dat")) { //$NON-NLS-1$
try {
+ // TODO: Also support the perf-cpu data. For now, it
+ // does not contain uftrace data
+ if (file.getName().startsWith("perf-cpu")) { //$NON-NLS-1$
+ continue;
+ }
DatParser dp = new DatParser(file);
// read first event (really check magic number header)
dp.iterator().next();
@@ -197,6 +202,11 @@ public class Uftrace extends TmfTrace implements ITmfPropertiesProvider,
String name = child.getName();
try {
if (name.endsWith(".dat")) { //$NON-NLS-1$
+ // TODO: Also support the perf-cpu data. For now, it does
+ // not contain uftrace data
+ if (name.startsWith("perf-cpu")) { //$NON-NLS-1$
+ continue;
+ }
fSize += child.length();
fDats.add(new DatParser(child));
} else if (name.endsWith(".map")) { //$NON-NLS-1$

Back to the top