Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeneviève Bastien2018-06-22 14:26:27 -0400
committerGenevieve Bastien2018-07-05 15:54:02 -0400
commit3e95806c6b3d6dcefbad4dad6a4b2c339796a93c (patch)
tree3f08ce5dfbd7296ce171a0f249add2f2e6b68ae6
parent0828db344f34d1d743be4bc1614fbfa9f3a6c2e8 (diff)
downloadorg.eclipse.tracecompass.incubator-3e95806c6b3d6dcefbad4dad6a4b2c339796a93c.tar.gz
org.eclipse.tracecompass.incubator-3e95806c6b3d6dcefbad4dad6a4b2c339796a93c.tar.xz
org.eclipse.tracecompass.incubator-3e95806c6b3d6dcefbad4dad6a4b2c339796a93c.zip
ftrace: Support the ftrace function graph
Add an XML analysis for the ftrace function graph tracer, in raw textual format from trace-cmd. Change-Id: Ib2f4bec987ef38d015a051765c117523c91b3bb1 Signed-off-by: Geneviève Bastien <gbastien+lttng@versatic.net> Reviewed-on: https://git.eclipse.org/r/124914 Tested-by: CI Bot Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
-rw-r--r--doc/org.eclipse.tracecompass.incubator.ftrace.doc.user/doc/User-Guide.mediawiki20
-rw-r--r--doc/org.eclipse.tracecompass.incubator.ftrace.doc.user/doc/images/FuncGraph.pngbin0 -> 172232 bytes
-rw-r--r--doc/org.eclipse.tracecompass.incubator.ftrace.doc.user/doc/images/kernelAnalyses.pngbin0 -> 203190 bytes
-rw-r--r--tracetypes/org.eclipse.tracecompass.incubator.ftrace.core.tests/META-INF/MANIFEST.MF2
-rw-r--r--tracetypes/org.eclipse.tracecompass.incubator.ftrace.core.tests/res/trace-func-graph200
-rw-r--r--tracetypes/org.eclipse.tracecompass.incubator.ftrace.core.tests/src/org/eclipse/tracecompass/incubator/ftrace/core/tests/trace/FtraceTraceTest.java21
-rw-r--r--tracetypes/org.eclipse.tracecompass.incubator.ftrace.core/build.properties3
-rw-r--r--tracetypes/org.eclipse.tracecompass.incubator.ftrace.core/plugin.xml6
-rw-r--r--tracetypes/org.eclipse.tracecompass.incubator.ftrace.core/src/org/eclipse/tracecompass/incubator/internal/ftrace/core/event/GenericFtraceField.java14
-rw-r--r--tracetypes/org.eclipse.tracecompass.incubator.ftrace.core/src/org/eclipse/tracecompass/incubator/internal/ftrace/core/event/IGenericFtraceConstants.java4
-rw-r--r--tracetypes/org.eclipse.tracecompass.incubator.ftrace.core/xml_analyses/FunctionGraph.xml57
11 files changed, 316 insertions, 11 deletions
diff --git a/doc/org.eclipse.tracecompass.incubator.ftrace.doc.user/doc/User-Guide.mediawiki b/doc/org.eclipse.tracecompass.incubator.ftrace.doc.user/doc/User-Guide.mediawiki
index 5c50877a..538d9c9d 100644
--- a/doc/org.eclipse.tracecompass.incubator.ftrace.doc.user/doc/User-Guide.mediawiki
+++ b/doc/org.eclipse.tracecompass.incubator.ftrace.doc.user/doc/User-Guide.mediawiki
@@ -1,7 +1,21 @@
= ftrace =
-Support is currently limited to event tracing. The expected format is the human readable raw format.
+Trace Compass supports the raw textual format of various ftrace plugins.
+
+== Supported ftrace features ==
+
+=== Event tracing ===
+
+ftrace traces with kernel events are kernel traces and all analyses available with other kernel traces in Trace Compass are made available for those traces: Kernel resources and threads analyses, I/O, memory, critical path, etc.
+
+[[Image:images/kernelAnalyses.png]]
+
+=== function graph ===
+
+The function graph plugin of trace allows to record the function entry and exits of various kernel functions. With this kind of trace, we can obtain a callstack / flame chart / flame graph for the various threads on the machine.
+
+[[Image:images/FuncGraph.png]]
== Generating a trace ==
@@ -40,4 +54,6 @@ The recorded trace would contain only ''sched_switch'' and ''sched_wakeup'' even
# trace-cmd report -R
-The ''-R'' argument is needed to get the raw format. \ No newline at end of file
+The ''-R'' argument is needed to get the raw format.
+
+See the [https://linux.die.net/man/1/trace-cmd trace-cmd documentation] for more tracing options. \ No newline at end of file
diff --git a/doc/org.eclipse.tracecompass.incubator.ftrace.doc.user/doc/images/FuncGraph.png b/doc/org.eclipse.tracecompass.incubator.ftrace.doc.user/doc/images/FuncGraph.png
new file mode 100644
index 00000000..eb4cb624
--- /dev/null
+++ b/doc/org.eclipse.tracecompass.incubator.ftrace.doc.user/doc/images/FuncGraph.png
Binary files differ
diff --git a/doc/org.eclipse.tracecompass.incubator.ftrace.doc.user/doc/images/kernelAnalyses.png b/doc/org.eclipse.tracecompass.incubator.ftrace.doc.user/doc/images/kernelAnalyses.png
new file mode 100644
index 00000000..00bea313
--- /dev/null
+++ b/doc/org.eclipse.tracecompass.incubator.ftrace.doc.user/doc/images/kernelAnalyses.png
Binary files differ
diff --git a/tracetypes/org.eclipse.tracecompass.incubator.ftrace.core.tests/META-INF/MANIFEST.MF b/tracetypes/org.eclipse.tracecompass.incubator.ftrace.core.tests/META-INF/MANIFEST.MF
index 9e985fce..21ad551e 100644
--- a/tracetypes/org.eclipse.tracecompass.incubator.ftrace.core.tests/META-INF/MANIFEST.MF
+++ b/tracetypes/org.eclipse.tracecompass.incubator.ftrace.core.tests/META-INF/MANIFEST.MF
@@ -5,6 +5,8 @@ Bundle-Vendor: %Bundle-Vendor
Bundle-SymbolicName: org.eclipse.tracecompass.incubator.ftrace.core.tests
Bundle-Version: 0.0.1.qualifier
Bundle-Localization: plugin
+Bundle-Activator: org.eclipse.tracecompass.incubator.ftrace.core.tests.ActivatorTest
+Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.core.resources,
diff --git a/tracetypes/org.eclipse.tracecompass.incubator.ftrace.core.tests/res/trace-func-graph b/tracetypes/org.eclipse.tracecompass.incubator.ftrace.core.tests/res/trace-func-graph
new file mode 100644
index 00000000..7e49c7d3
--- /dev/null
+++ b/tracetypes/org.eclipse.tracecompass.incubator.ftrace.core.tests/res/trace-func-graph
@@ -0,0 +1,200 @@
+cpus=8
+ trace-cmd-11809 [003] 11658.899115: funcgraph_entry: func=0xffffffffba5ddc00 depth=0
+ trace-cmd-11810 [007] 11658.899115: funcgraph_entry: func=0xffffffffba5d6b90 depth=0
+ sleep-11811 [005] 11658.899115: funcgraph_entry: func=0xffffffffbaabd8a0 depth=0
+ trace-cmd-11810 [007] 11658.899116: funcgraph_entry: func=0xffffffffbaac16a0 depth=1
+ trace-cmd-11810 [007] 11658.899117: funcgraph_exit: func=0xffffffffbaac16a0 calltime=0xa9a8c8a5227 rettime=0xa9a8c8a5299 overrun=0x0 depth=1
+ sleep-11811 [005] 11658.899117: funcgraph_entry: func=0xffffffffbac01fb0 depth=0
+ trace-cmd-11809 [003] 11658.899117: funcgraph_entry: func=0xffffffffbac01fb0 depth=0
+ sleep-11811 [005] 11658.899117: funcgraph_entry: func=0xffffffffba47ed50 depth=1
+ trace-cmd-11810 [007] 11658.899118: funcgraph_exit: func=0xffffffffba5d6b90 calltime=0xa9a8c8a4f43 rettime=0xa9a8c8a55e7 overrun=0x0 depth=0
+ sleep-11811 [005] 11658.899118: funcgraph_entry: func=0xffffffffba4e8fb0 depth=2
+ trace-cmd-11809 [003] 11658.899118: funcgraph_entry: func=0xffffffffba47ed50 depth=1
+ sleep-11811 [005] 11658.899118: funcgraph_entry: func=0xffffffffba4e8f50 depth=3
+ trace-cmd-11810 [007] 11658.899118: funcgraph_entry: func=0xffffffffba65c5b0 depth=0
+ trace-cmd-11809 [003] 11658.899118: funcgraph_entry: func=0xffffffffba4e8fb0 depth=2
+ sleep-11811 [005] 11658.899118: funcgraph_exit: func=0xffffffffba4e8f50 calltime=0xa9a8c8a5883 rettime=0xa9a8c8a58d6 overrun=0x0 depth=3
+ trace-cmd-11810 [007] 11658.899119: funcgraph_entry: func=0xffffffffba65c410 depth=1
+ sleep-11811 [005] 11658.899119: funcgraph_exit: func=0xffffffffba4e8fb0 calltime=0xa9a8c8a5771 rettime=0xa9a8c8a5a4a overrun=0x0 depth=2
+ trace-cmd-11809 [003] 11658.899119: funcgraph_entry: func=0xffffffffba4e8f50 depth=3
+ sleep-11811 [005] 11658.899119: funcgraph_exit: func=0xffffffffba47ed50 calltime=0xa9a8c8a564a rettime=0xa9a8c8a5b53 overrun=0x0 depth=1
+ trace-cmd-11810 [007] 11658.899119: funcgraph_exit: func=0xffffffffba65c410 calltime=0xa9a8c8a5afb rettime=0xa9a8c8a5b6a overrun=0x0 depth=1
+ trace-cmd-11809 [003] 11658.899119: funcgraph_exit: func=0xffffffffba4e8f50 calltime=0xa9a8c8a5bc8 rettime=0xa9a8c8a5c59 overrun=0x0 depth=3
+ sleep-11811 [005] 11658.899119: funcgraph_entry: func=0xffffffffba4bc840 depth=1
+ trace-cmd-11810 [007] 11658.899119: funcgraph_exit: func=0xffffffffba65c5b0 calltime=0xa9a8c8a58e9 rettime=0xa9a8c8a5cc5 overrun=0x0 depth=0
+ sleep-11811 [005] 11658.899120: funcgraph_entry: func=0xffffffffba4bc780 depth=2
+ trace-cmd-11809 [003] 11658.899120: funcgraph_exit: func=0xffffffffba4e8fb0 calltime=0xa9a8c8a59fe rettime=0xa9a8c8a5dee overrun=0x0 depth=2
+ trace-cmd-11810 [007] 11658.899120: funcgraph_entry: func=0xffffffffbaabc100 depth=0
+ sleep-11811 [005] 11658.899120: funcgraph_entry: func=0xffffffffbaac1480 depth=3
+ trace-cmd-11810 [007] 11658.899120: funcgraph_entry: func=0xffffffffba4e6a70 depth=1
+ sleep-11811 [005] 11658.899120: funcgraph_exit: func=0xffffffffbaac1480 calltime=0xa9a8c8a5fce rettime=0xa9a8c8a600e overrun=0x0 depth=3
+ trace-cmd-11809 [003] 11658.899120: funcgraph_exit: func=0xffffffffba47ed50 calltime=0xa9a8c8a5842 rettime=0xa9a8c8a600e overrun=0x0 depth=1
+ sleep-11811 [005] 11658.899121: funcgraph_entry: func=0xffffffffba4bc610 depth=3
+ trace-cmd-11810 [007] 11658.899121: funcgraph_exit: func=0xffffffffba4e6a70 calltime=0xa9a8c8a60f4 rettime=0xa9a8c8a6163 overrun=0x0 depth=1
+ sleep-11811 [005] 11658.899121: funcgraph_exit: func=0xffffffffba4bc610 calltime=0xa9a8c8a6202 rettime=0xa9a8c8a6247 overrun=0x0 depth=3
+ trace-cmd-11809 [003] 11658.899121: funcgraph_entry: func=0xffffffffba4bc840 depth=1
+ trace-cmd-11810 [007] 11658.899121: funcgraph_exit: func=0xffffffffbaabc100 calltime=0xa9a8c8a5f68 rettime=0xa9a8c8a62bb overrun=0x0 depth=0
+ sleep-11811 [005] 11658.899121: funcgraph_entry: func=0xffffffffbaac1330 depth=3
+ trace-cmd-11809 [003] 11658.899121: funcgraph_entry: func=0xffffffffba4bc780 depth=2
+ sleep-11811 [005] 11658.899121: funcgraph_exit: func=0xffffffffbaac1330 calltime=0xa9a8c8a6421 rettime=0xa9a8c8a646c overrun=0x0 depth=3
+ trace-cmd-11810 [007] 11658.899121: funcgraph_entry: func=0xffffffffbaac16c0 depth=0
+ sleep-11811 [005] 11658.899122: funcgraph_exit: func=0xffffffffba4bc780 calltime=0xa9a8c8a5eb1 rettime=0xa9a8c8a6566 overrun=0x0 depth=2
+ trace-cmd-11809 [003] 11658.899122: funcgraph_entry: func=0xffffffffbaac1480 depth=3
+ trace-cmd-11810 [007] 11658.899122: funcgraph_exit: func=0xffffffffbaac16c0 calltime=0xa9a8c8a65b4 rettime=0xa9a8c8a661d overrun=0x0 depth=0
+ sleep-11811 [005] 11658.899122: funcgraph_exit: func=0xffffffffba4bc840 calltime=0xa9a8c8a5db3 rettime=0xa9a8c8a668b overrun=0x0 depth=1
+ trace-cmd-11809 [003] 11658.899122: funcgraph_exit: func=0xffffffffbaac1480 calltime=0xa9a8c8a670a rettime=0xa9a8c8a6768 overrun=0x0 depth=3
+ sleep-11811 [005] 11658.899122: funcgraph_entry: func=0xffffffffba4bc840 depth=1
+ trace-cmd-11810 [007] 11658.899122: funcgraph_entry: func=0xffffffffba62c190 depth=0
+ sleep-11811 [005] 11658.899122: funcgraph_entry: func=0xffffffffba4bc780 depth=2
+ trace-cmd-11809 [003] 11658.899123: funcgraph_entry: func=0xffffffffba4bc610 depth=3
+ trace-cmd-11810 [007] 11658.899123: funcgraph_exit: func=0xffffffffba62c190 calltime=0xa9a8c8a6927 rettime=0xa9a8c8a698d overrun=0x0 depth=0
+ sleep-11811 [005] 11658.899123: funcgraph_entry: func=0xffffffffbaac1480 depth=3
+ sleep-11811 [005] 11658.899123: funcgraph_exit: func=0xffffffffbaac1480 calltime=0xa9a8c8a6a9c rettime=0xa9a8c8a6ade overrun=0x0 depth=3
+ trace-cmd-11809 [003] 11658.899123: funcgraph_exit: func=0xffffffffba4bc610 calltime=0xa9a8c8a6a6c rettime=0xa9a8c8a6adb overrun=0x0 depth=3
+ sleep-11811 [005] 11658.899123: funcgraph_entry: func=0xffffffffba4bc610 depth=3
+ trace-cmd-11809 [003] 11658.899123: funcgraph_entry: func=0xffffffffbaac1330 depth=3
+ sleep-11811 [005] 11658.899124: funcgraph_entry: func=0xffffffffba4bc5c0 depth=4
+ trace-cmd-11809 [003] 11658.899124: funcgraph_exit: func=0xffffffffbaac1330 calltime=0xa9a8c8a6d76 rettime=0xa9a8c8a6dd2 overrun=0x0 depth=3
+ sleep-11811 [005] 11658.899124: funcgraph_entry: func=0xffffffffba4a3d50 depth=5
+ trace-cmd-11809 [003] 11658.899124: funcgraph_exit: func=0xffffffffba4bc780 calltime=0xa9a8c8a654b rettime=0xa9a8c8a6f1c overrun=0x0 depth=2
+ sleep-11811 [005] 11658.899124: funcgraph_entry: func=0xffffffffba4a3860 depth=6
+ trace-cmd-11809 [003] 11658.899124: funcgraph_exit: func=0xffffffffba4bc840 calltime=0xa9a8c8a63a8 rettime=0xa9a8c8a705a overrun=0x0 depth=1
+ sleep-11811 [005] 11658.899124: funcgraph_entry: func=0xffffffffbaac1480 depth=7
+ sleep-11811 [005] 11658.899125: funcgraph_exit: func=0xffffffffbaac1480 calltime=0xa9a8c8a7184 rettime=0xa9a8c8a71cb overrun=0x0 depth=7
+ trace-cmd-11809 [003] 11658.899125: funcgraph_entry: func=0xffffffffba4bc840 depth=1
+ trace-cmd-11809 [003] 11658.899125: funcgraph_entry: func=0xffffffffba4bc780 depth=2
+ sleep-11811 [005] 11658.899125: funcgraph_entry: func=0xffffffffba4aa2c0 depth=7
+ trace-cmd-11809 [003] 11658.899125: funcgraph_entry: func=0xffffffffbaac1480 depth=3
+ sleep-11811 [005] 11658.899126: funcgraph_entry: func=0xffffffffba4a55b0 depth=8
+ trace-cmd-11810 [007] 11658.899126: funcgraph_entry: func=0xffffffffba4038e0 depth=0
+ trace-cmd-11809 [003] 11658.899126: funcgraph_exit: func=0xffffffffbaac1480 calltime=0xa9a8c8a7552 rettime=0xa9a8c8a75b2 overrun=0x0 depth=3
+ sleep-11811 [005] 11658.899126: funcgraph_exit: func=0xffffffffba4a55b0 calltime=0xa9a8c8a75f3 rettime=0xa9a8c8a7654 overrun=0x0 depth=8
+ trace-cmd-11809 [003] 11658.899126: funcgraph_entry: func=0xffffffffba4bc610 depth=3
+ sleep-11811 [005] 11658.899126: funcgraph_entry: func=0xffffffffba4a8420 depth=8
+ trace-cmd-11810 [007] 11658.899126: funcgraph_entry: func=0xffffffffba635f80 depth=1
+ trace-cmd-11810 [007] 11658.899127: funcgraph_entry: func=0xffffffffba635d10 depth=2
+ trace-cmd-11809 [003] 11658.899127: funcgraph_entry: func=0xffffffffba4bc5c0 depth=4
+ sleep-11811 [005] 11658.899127: funcgraph_exit: func=0xffffffffba4a8420 calltime=0xa9a8c8a7859 rettime=0xa9a8c8a797c overrun=0x0 depth=8
+ sleep-11811 [005] 11658.899127: funcgraph_entry: func=0xffffffffba4a9e40 depth=8
+ trace-cmd-11809 [003] 11658.899127: funcgraph_entry: func=0xffffffffba4a3d50 depth=5
+ trace-cmd-11810 [007] 11658.899127: funcgraph_entry: func=0xffffffffba648de0 depth=3
+ sleep-11811 [005] 11658.899127: funcgraph_entry: func=0xffffffffba4a55b0 depth=9
+ sleep-11811 [005] 11658.899128: funcgraph_exit: func=0xffffffffba4a55b0 calltime=0xa9a8c8a7c95 rettime=0xa9a8c8a7ce8 overrun=0x0 depth=9
+ trace-cmd-11809 [003] 11658.899128: funcgraph_entry: func=0xffffffffba4a3860 depth=6
+ trace-cmd-11810 [007] 11658.899128: funcgraph_entry: func=0xffffffffba648c00 depth=4
+ sleep-11811 [005] 11658.899128: funcgraph_exit: func=0xffffffffba4a9e40 calltime=0xa9a8c8a7b7b rettime=0xa9a8c8a7e01 overrun=0x0 depth=8
+ trace-cmd-11809 [003] 11658.899128: funcgraph_entry: func=0xffffffffbaac1480 depth=7
+ trace-cmd-11810 [007] 11658.899128: funcgraph_entry: func=0xffffffffba612cb0 depth=5
+ sleep-11811 [005] 11658.899128: funcgraph_exit: func=0xffffffffba4aa2c0 calltime=0xa9a8c8a73df rettime=0xa9a8c8a7f01 overrun=0x0 depth=7
+ sleep-11811 [005] 11658.899128: funcgraph_entry: func=0xffffffffbaac16a0 depth=7
+ trace-cmd-11809 [003] 11658.899129: funcgraph_exit: func=0xffffffffbaac1480 calltime=0xa9a8c8a7fed rettime=0xa9a8c8a8050 overrun=0x0 depth=7
+ trace-cmd-11810 [007] 11658.899129: funcgraph_entry: func=0xffffffffbaabc100 depth=6
+ sleep-11811 [005] 11658.899129: funcgraph_exit: func=0xffffffffbaac16a0 calltime=0xa9a8c8a80f1 rettime=0xa9a8c8a8131 overrun=0x0 depth=7
+ sleep-11811 [005] 11658.899129: funcgraph_entry: func=0xffffffffba4a12d0 depth=7
+ trace-cmd-11810 [007] 11658.899129: funcgraph_entry: func=0xffffffffba4e6a70 depth=7
+ trace-cmd-11809 [003] 11658.899129: funcgraph_entry: func=0xffffffffba4aa2c0 depth=7
+ sleep-11811 [005] 11658.899129: funcgraph_exit: func=0xffffffffba4a12d0 calltime=0xa9a8c8a8306 rettime=0xa9a8c8a8377 overrun=0x0 depth=7
+ trace-cmd-11810 [007] 11658.899129: funcgraph_exit: func=0xffffffffba4e6a70 calltime=0xa9a8c8a83b0 rettime=0xa9a8c8a8411 overrun=0x0 depth=7
+ sleep-11811 [005] 11658.899130: funcgraph_entry: func=0xffffffffba4a2d60 depth=7
+ trace-cmd-11809 [003] 11658.899130: funcgraph_entry: func=0xffffffffba4a9e40 depth=8
+ sleep-11811 [005] 11658.899130: funcgraph_entry: func=0xffffffffba4a29d0 depth=8
+ trace-cmd-11810 [007] 11658.899130: funcgraph_exit: func=0xffffffffbaabc100 calltime=0xa9a8c8a81c1 rettime=0xa9a8c8a8568 overrun=0x0 depth=6
+ sleep-11811 [005] 11658.899130: funcgraph_entry: func=0xffffffffba4afb50 depth=9
+ trace-cmd-11810 [007] 11658.899130: funcgraph_entry: func=0xffffffffba60e7c0 depth=6
+ trace-cmd-11809 [003] 11658.899130: funcgraph_entry: func=0xffffffffba4a55b0 depth=9
+ sleep-11811 [005] 11658.899130: funcgraph_entry: func=0xffffffffba4af510 depth=10
+ trace-cmd-11810 [007] 11658.899131: funcgraph_exit: func=0xffffffffba60e7c0 calltime=0xa9a8c8a8869 rettime=0xa9a8c8a88c7 overrun=0x0 depth=6
+ sleep-11811 [005] 11658.899131: funcgraph_entry: func=0xffffffffba4addc0 depth=11
+ trace-cmd-11809 [003] 11658.899131: funcgraph_exit: func=0xffffffffba4a55b0 calltime=0xa9a8c8a88ae rettime=0xa9a8c8a891d overrun=0x0 depth=9
+ sleep-11811 [005] 11658.899131: funcgraph_exit: func=0xffffffffba4addc0 calltime=0xa9a8c8a89f6 rettime=0xa9a8c8a8a45 overrun=0x0 depth=11
+ trace-cmd-11810 [007] 11658.899131: funcgraph_entry: func=0xffffffffba62c370 depth=6
+ trace-cmd-11809 [003] 11658.899131: funcgraph_entry: func=0xffffffffba4a44d0 depth=9
+ sleep-11811 [005] 11658.899131: funcgraph_entry: func=0xffffffffba4a8c90 depth=11
+ trace-cmd-11810 [007] 11658.899132: funcgraph_exit: func=0xffffffffba62c370 calltime=0xa9a8c8a8bdd rettime=0xa9a8c8a8c3b overrun=0x0 depth=6
+ trace-cmd-11809 [003] 11658.899132: funcgraph_exit: func=0xffffffffba4a44d0 calltime=0xa9a8c8a8c29 rettime=0xa9a8c8a8c87 overrun=0x0 depth=9
+ sleep-11811 [005] 11658.899132: funcgraph_exit: func=0xffffffffba4a8c90 calltime=0xa9a8c8a8c6f rettime=0xa9a8c8a8d25 overrun=0x0 depth=11
+ trace-cmd-11810 [007] 11658.899132: funcgraph_exit: func=0xffffffffba612cb0 calltime=0xa9a8c8a800b rettime=0xa9a8c8a8dbb overrun=0x0 depth=5
+ trace-cmd-11809 [003] 11658.899132: funcgraph_entry: func=0xffffffffba4a55b0 depth=9
+ sleep-11811 [005] 11658.899132: funcgraph_entry: func=0xffffffffba4ae310 depth=11
+ trace-cmd-11810 [007] 11658.899132: funcgraph_entry: func=0xffffffffba633ab0 depth=5
+ sleep-11811 [005] 11658.899132: funcgraph_exit: func=0xffffffffba4ae310 calltime=0xa9a8c8a8f59 rettime=0xa9a8c8a8fa2 overrun=0x0 depth=11
+ trace-cmd-11809 [003] 11658.899133: funcgraph_exit: func=0xffffffffba4a55b0 calltime=0xa9a8c8a8f5f rettime=0xa9a8c8a9009 overrun=0x0 depth=9
+ sleep-11811 [005] 11658.899133: funcgraph_entry: func=0xffffffffba4acbb0 depth=11
+ trace-cmd-11810 [007] 11658.899133: funcgraph_entry: func=0xffffffffba468ad0 depth=6
+ sleep-11811 [005] 11658.899133: funcgraph_exit: func=0xffffffffba4acbb0 calltime=0xa9a8c8a916f rettime=0xa9a8c8a91e9 overrun=0x0 depth=11
+ trace-cmd-11809 [003] 11658.899133: funcgraph_exit: func=0xffffffffba4a9e40 calltime=0xa9a8c8a86be rettime=0xa9a8c8a920f overrun=0x0 depth=8
+ trace-cmd-11810 [007] 11658.899133: funcgraph_exit: func=0xffffffffba468ad0 calltime=0xa9a8c8a924d rettime=0xa9a8c8a92be overrun=0x0 depth=6
+ sleep-11811 [005] 11658.899133: funcgraph_entry: func=0xffffffffba4a88c0 depth=11
+ trace-cmd-11809 [003] 11658.899133: funcgraph_exit: func=0xffffffffba4aa2c0 calltime=0xa9a8c8a83a0 rettime=0xa9a8c8a9392 overrun=0x0 depth=7
+ sleep-11811 [005] 11658.899134: funcgraph_exit: func=0xffffffffba4a88c0 calltime=0xa9a8c8a93d5 rettime=0xa9a8c8a9459 overrun=0x0 depth=11
+ trace-cmd-11810 [007] 11658.899134: funcgraph_entry: func=0xffffffffba615210 depth=6
+ trace-cmd-11809 [003] 11658.899134: funcgraph_entry: func=0xffffffffba4a3100 depth=7
+ sleep-11811 [005] 11658.899134: funcgraph_exit: func=0xffffffffba4af510 calltime=0xa9a8c8a88c8 rettime=0xa9a8c8a9569 overrun=0x0 depth=10
+ trace-cmd-11810 [007] 11658.899134: funcgraph_exit: func=0xffffffffba615210 calltime=0xa9a8c8a95be rettime=0xa9a8c8a9653 overrun=0x0 depth=6
+ sleep-11811 [005] 11658.899134: funcgraph_entry: func=0xffffffffba4af510 depth=10
+ trace-cmd-11809 [003] 11658.899134: funcgraph_entry: func=0xffffffffba4b17f0 depth=8
+ sleep-11811 [005] 11658.899134: funcgraph_entry: func=0xffffffffba4addc0 depth=11
+ trace-cmd-11810 [007] 11658.899135: funcgraph_entry: func=0xffffffffba633950 depth=6
+ sleep-11811 [005] 11658.899135: funcgraph_exit: func=0xffffffffba4addc0 calltime=0xa9a8c8a9847 rettime=0xa9a8c8a988b overrun=0x0 depth=11
+ trace-cmd-11809 [003] 11658.899135: funcgraph_entry: func=0xffffffffba4b1770 depth=9
+ trace-cmd-11810 [007] 11658.899135: funcgraph_exit: func=0xffffffffba633950 calltime=0xa9a8c8a98e8 rettime=0xa9a8c8a9942 overrun=0x0 depth=6
+ sleep-11811 [005] 11658.899135: funcgraph_entry: func=0xffffffffba4a8c90 depth=11
+ sleep-11811 [005] 11658.899135: funcgraph_exit: func=0xffffffffba4a8c90 calltime=0xa9a8c8a9a46 rettime=0xa9a8c8a9ac8 overrun=0x0 depth=11
+ trace-cmd-11810 [007] 11658.899135: funcgraph_exit: func=0xffffffffba633ab0 calltime=0xa9a8c8a90c1 rettime=0xa9a8c8a9aab overrun=0x0 depth=5
+ trace-cmd-11809 [003] 11658.899135: funcgraph_entry: func=0xffffffffba4a8b60 depth=10
+ sleep-11811 [005] 11658.899136: funcgraph_entry: func=0xffffffffba4ae310 depth=11
+ trace-cmd-11810 [007] 11658.899136: funcgraph_exit: func=0xffffffffba648c00 calltime=0xa9a8c8a7e62 rettime=0xa9a8c8a9c9b overrun=0x0 depth=4
+ trace-cmd-11809 [003] 11658.899136: funcgraph_exit: func=0xffffffffba4a8b60 calltime=0xa9a8c8a9c60 rettime=0xa9a8c8a9ce4 overrun=0x0 depth=10
+ sleep-11811 [005] 11658.899136: funcgraph_entry: func=0xffffffffba4ae190 depth=12
+ trace-cmd-11810 [007] 11658.899136: funcgraph_exit: func=0xffffffffba648de0 calltime=0xa9a8c8a7cb8 rettime=0xa9a8c8a9e09 overrun=0x0 depth=3
+ trace-cmd-11809 [003] 11658.899136: funcgraph_entry: func=0xffffffffbaac1480 depth=10
+ sleep-11811 [005] 11658.899136: funcgraph_exit: func=0xffffffffba4ae190 calltime=0xa9a8c8a9e1d rettime=0xa9a8c8a9ea3 overrun=0x0 depth=12
+ sleep-11811 [005] 11658.899136: funcgraph_exit: func=0xffffffffba4ae310 calltime=0xa9a8c8a9ccf rettime=0xa9a8c8a9f89 overrun=0x0 depth=11
+ trace-cmd-11810 [007] 11658.899137: funcgraph_entry: func=0xffffffffba659c20 depth=3
+ trace-cmd-11809 [003] 11658.899137: funcgraph_exit: func=0xffffffffbaac1480 calltime=0xa9a8c8a9fa3 rettime=0xa9a8c8aa008 overrun=0x0 depth=10
+ sleep-11811 [005] 11658.899137: funcgraph_entry: func=0xffffffffba4acbb0 depth=11
+ trace-cmd-11810 [007] 11658.899137: funcgraph_entry: func=0xffffffffba659ab0 depth=4
+ sleep-11811 [005] 11658.899137: funcgraph_exit: func=0xffffffffba4acbb0 calltime=0xa9a8c8aa158 rettime=0xa9a8c8aa1b6 overrun=0x0 depth=11
+ trace-cmd-11809 [003] 11658.899137: funcgraph_entry: func=0xffffffffbaac1330 depth=10
+ sleep-11811 [005] 11658.899137: funcgraph_entry: func=0xffffffffba4a88c0 depth=11
+ trace-cmd-11810 [007] 11658.899137: funcgraph_entry: func=0xffffffffbaac16a0 depth=5
+ trace-cmd-11809 [003] 11658.899138: funcgraph_exit: func=0xffffffffbaac1330 calltime=0xa9a8c8aa2f6 rettime=0xa9a8c8aa361 overrun=0x0 depth=10
+ sleep-11811 [005] 11658.899138: funcgraph_exit: func=0xffffffffba4a88c0 calltime=0xa9a8c8aa371 rettime=0xa9a8c8aa3b3 overrun=0x0 depth=11
+ trace-cmd-11810 [007] 11658.899138: funcgraph_exit: func=0xffffffffbaac16a0 calltime=0xa9a8c8aa424 rettime=0xa9a8c8aa482 overrun=0x0 depth=5
+ sleep-11811 [005] 11658.899138: funcgraph_exit: func=0xffffffffba4af510 calltime=0xa9a8c8a974c rettime=0xa9a8c8aa4ae overrun=0x0 depth=10
+ trace-cmd-11809 [003] 11658.899138: funcgraph_exit: func=0xffffffffba4b1770 calltime=0xa9a8c8a9a91 rettime=0xa9a8c8aa515 overrun=0x0 depth=9
+ sleep-11811 [005] 11658.899138: funcgraph_entry: func=0xffffffffba4a9860 depth=10
+ trace-cmd-11810 [007] 11658.899138: funcgraph_entry: func=0xffffffffba6593a0 depth=5
+ sleep-11811 [005] 11658.899138: funcgraph_exit: func=0xffffffffba4a9860 calltime=0xa9a8c8aa67d rettime=0xa9a8c8aa6bb overrun=0x0 depth=10
+ trace-cmd-11809 [003] 11658.899138: funcgraph_exit: func=0xffffffffba4b17f0 calltime=0xa9a8c8a984e rettime=0xa9a8c8aa698 overrun=0x0 depth=8
+ sleep-11811 [005] 11658.899139: funcgraph_exit: func=0xffffffffba4afb50 calltime=0xa9a8c8a87a6 rettime=0xa9a8c8aa79e overrun=0x0 depth=9
+ trace-cmd-11810 [007] 11658.899139: funcgraph_exit: func=0xffffffffba6593a0 calltime=0xa9a8c8aa770 rettime=0xa9a8c8aa7ff overrun=0x0 depth=5
+ sleep-11811 [005] 11658.899139: funcgraph_exit: func=0xffffffffba4a29d0 calltime=0xa9a8c8a8647 rettime=0xa9a8c8aa8a1 overrun=0x0 depth=8
+ trace-cmd-11809 [003] 11658.899139: funcgraph_entry: func=0xffffffffba4b1610 depth=8
+ sleep-11811 [005] 11658.899139: funcgraph_entry: func=0xffffffffba4a2c20 depth=8
+ trace-cmd-11810 [007] 11658.899139: funcgraph_exit: func=0xffffffffba659ab0 calltime=0xa9a8c8aa27e rettime=0xa9a8c8aa9ad overrun=0x0 depth=4
+ trace-cmd-11809 [003] 11658.899139: funcgraph_exit: func=0xffffffffba4b1610 calltime=0xa9a8c8aa9c5 rettime=0xa9a8c8aaa27 overrun=0x0 depth=8
+ sleep-11811 [005] 11658.899139: funcgraph_entry: func=0xffffffffba4a2ba0 depth=9
+ trace-cmd-11810 [007] 11658.899139: funcgraph_exit: func=0xffffffffba659c20 calltime=0xa9a8c8aa0b1 rettime=0xa9a8c8aab1b overrun=0x0 depth=3
+ trace-cmd-11809 [003] 11658.899140: funcgraph_exit: func=0xffffffffba4a3100 calltime=0xa9a8c8a965c rettime=0xa9a8c8aabb1 overrun=0x0 depth=7
+ sleep-11811 [005] 11658.899140: funcgraph_entry: func=0xffffffffba4a1f30 depth=10
+ trace-cmd-11810 [007] 11658.899140: funcgraph_entry: func=0xffffffffba6499b0 depth=3
+ trace-cmd-11809 [003] 11658.899140: funcgraph_entry: func=0xffffffffbaac16a0 depth=7
+ sleep-11811 [005] 11658.899140: funcgraph_exit: func=0xffffffffba4a1f30 calltime=0xa9a8c8aad17 rettime=0xa9a8c8aad65 overrun=0x0 depth=10
+ trace-cmd-11810 [007] 11658.899140: funcgraph_entry: func=0xffffffffba647450 depth=4
+ sleep-11811 [005] 11658.899140: funcgraph_exit: func=0xffffffffba4a2ba0 calltime=0xa9a8c8aab98 rettime=0xa9a8c8aaecf overrun=0x0 depth=9
+ trace-cmd-11809 [003] 11658.899140: funcgraph_exit: func=0xffffffffbaac16a0 calltime=0xa9a8c8aae6e rettime=0xa9a8c8aaed0 overrun=0x0 depth=7
+ trace-cmd-11810 [007] 11658.899141: funcgraph_entry: func=0xffffffffba639890 depth=5
+ trace-cmd-11809 [003] 11658.899141: funcgraph_entry: func=0xffffffffba4a12d0 depth=7
+ trace-cmd-11810 [007] 11658.899141: funcgraph_entry: func=0xffffffffba612cb0 depth=6
+ <idle>-0 [001] 11658.899141: funcgraph_entry: func=0xffffffffba500440 depth=0
+ trace-cmd-11809 [003] 11658.899141: funcgraph_exit: func=0xffffffffba4a12d0 calltime=0xa9a8c8ab1b6 rettime=0xa9a8c8ab256 overrun=0x0 depth=7
+ sleep-11811 [005] 11658.899141: funcgraph_exit: func=0xffffffffba4a2c20 calltime=0xa9a8c8aaa82 rettime=0xa9a8c8ab27a overrun=0x0 depth=8
+ trace-cmd-11810 [007] 11658.899142: funcgraph_entry: func=0xffffffffbaabc100 depth=7
+ sleep-11811 [005] 11658.899142: funcgraph_exit: func=0xffffffffba4a2d60 calltime=0xa9a8c8a8531 rettime=0xa9a8c8ab3eb overrun=0x0 depth=7
+ trace-cmd-11809 [003] 11658.899142: funcgraph_entry: func=0xffffffffba4a2d60 depth=7
+ trace-cmd-11810 [007] 11658.899142: funcgraph_entry: func=0xffffffffba4e6a70 depth=8
+ sleep-11811 [005] 11658.899142: funcgraph_entry: func=0xffffffffba49fac0 depth=7
+ trace-cmd-11809 [003] 11658.899142: funcgraph_entry: func=0xffffffffba4a29d0 depth=8
+ trace-cmd-11810 [007] 11658.899142: funcgraph_exit: func=0xffffffffba4e6a70 calltime=0xa9a8c8ab67d rettime=0xa9a8c8ab6e1 overrun=0x0 depth=8
+ sleep-11811 [005] 11658.899143: funcgraph_exit: func=0xffffffffba49fac0 calltime=0xa9a8c8ab6b4 rettime=0xa9a8c8ab70d overrun=0x0 depth=7 \ No newline at end of file
diff --git a/tracetypes/org.eclipse.tracecompass.incubator.ftrace.core.tests/src/org/eclipse/tracecompass/incubator/ftrace/core/tests/trace/FtraceTraceTest.java b/tracetypes/org.eclipse.tracecompass.incubator.ftrace.core.tests/src/org/eclipse/tracecompass/incubator/ftrace/core/tests/trace/FtraceTraceTest.java
index 04e4f015..76d5dcbd 100644
--- a/tracetypes/org.eclipse.tracecompass.incubator.ftrace.core.tests/src/org/eclipse/tracecompass/incubator/ftrace/core/tests/trace/FtraceTraceTest.java
+++ b/tracetypes/org.eclipse.tracecompass.incubator.ftrace.core.tests/src/org/eclipse/tracecompass/incubator/ftrace/core/tests/trace/FtraceTraceTest.java
@@ -9,11 +9,16 @@
package org.eclipse.tracecompass.incubator.ftrace.core.tests.trace;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.tracecompass.incubator.ftrace.core.tests.ActivatorTest;
import org.eclipse.tracecompass.incubator.internal.ftrace.core.trace.FtraceTrace;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
/**
* Ftrace Trace Test Class
@@ -26,18 +31,24 @@ import static org.junit.Assert.assertEquals;
*/
public class FtraceTraceTest {
+ private static final String TRACE_PATH = "res";
+
/**
- * Test validation of ftrace trace
+ * Test validation of ftrace traces
*/
@Test
public void testValidate() {
+ IPath path = ActivatorTest.getAbsoluteFilePath(TRACE_PATH);
+ File file = path.toFile();
+ File[] traceFiles = file.listFiles();
+ assertTrue(traceFiles.length > 0);
FtraceTrace ftraceTrace = new FtraceTrace();
+ for (File f : traceFiles) {
+ IStatus status = ftraceTrace.validate(null, f.getAbsolutePath());
- IStatus status = ftraceTrace.validate(null, "res/trace-android-sched");
-
- assertEquals(0, status.getSeverity());
-
+ assertEquals("trace " + f, 0, status.getSeverity());
+ }
}
/**
diff --git a/tracetypes/org.eclipse.tracecompass.incubator.ftrace.core/build.properties b/tracetypes/org.eclipse.tracecompass.incubator.ftrace.core/build.properties
index e1a0e1e7..89bfeb3d 100644
--- a/tracetypes/org.eclipse.tracecompass.incubator.ftrace.core/build.properties
+++ b/tracetypes/org.eclipse.tracecompass.incubator.ftrace.core/build.properties
@@ -14,6 +14,7 @@ bin.includes = META-INF/,\
plugin.properties,\
plugin.xml,\
.,\
- icons/
+ icons/,\
+ xml_analyses/
additional.bundles = org.eclipse.jdt.annotation
jars.extra.classpath = platform:/plugin/org.eclipse.jdt.annotation
diff --git a/tracetypes/org.eclipse.tracecompass.incubator.ftrace.core/plugin.xml b/tracetypes/org.eclipse.tracecompass.incubator.ftrace.core/plugin.xml
index f3a08e5e..6837fa06 100644
--- a/tracetypes/org.eclipse.tracecompass.incubator.ftrace.core/plugin.xml
+++ b/tracetypes/org.eclipse.tracecompass.incubator.ftrace.core/plugin.xml
@@ -23,5 +23,11 @@
tracetype="org.eclipse.tracecompass.incubator.ftrace.core">
</type>
</extension>
+ <extension
+ point="org.eclipse.linuxtools.tmf.analysis.xml.core.files">
+ <xmlfile
+ file="xml_analyses/FunctionGraph.xml">
+ </xmlfile>
+ </extension>
</plugin>
diff --git a/tracetypes/org.eclipse.tracecompass.incubator.ftrace.core/src/org/eclipse/tracecompass/incubator/internal/ftrace/core/event/GenericFtraceField.java b/tracetypes/org.eclipse.tracecompass.incubator.ftrace.core/src/org/eclipse/tracecompass/incubator/internal/ftrace/core/event/GenericFtraceField.java
index 263c7592..c6d3b0c7 100644
--- a/tracetypes/org.eclipse.tracecompass.incubator.ftrace.core/src/org/eclipse/tracecompass/incubator/internal/ftrace/core/event/GenericFtraceField.java
+++ b/tracetypes/org.eclipse.tracecompass.incubator.ftrace.core/src/org/eclipse/tracecompass/incubator/internal/ftrace/core/event/GenericFtraceField.java
@@ -137,7 +137,7 @@ public class GenericFtraceField {
} else if (StringUtils.isNumeric(value)) {
fields.put(key, Long.parseUnsignedLong(value));
} else {
- fields.put(key, value);
+ fields.put(key, decodeString(value));
}
}
}
@@ -146,6 +146,18 @@ public class GenericFtraceField {
return null;
}
+ private static Object decodeString(String val) {
+ try {
+ if (val.startsWith("0x") || val.startsWith("0X")) { //$NON-NLS-1$ //$NON-NLS-2$
+ // Chances are this is an hexadecimal string. Parse the value
+ return Long.parseUnsignedLong(val.substring(2), 16);
+ }
+ } catch (NumberFormatException e) {
+ // Fall back to returning the string
+ }
+ return val;
+ }
+
/**
* Get the event content
*
diff --git a/tracetypes/org.eclipse.tracecompass.incubator.ftrace.core/src/org/eclipse/tracecompass/incubator/internal/ftrace/core/event/IGenericFtraceConstants.java b/tracetypes/org.eclipse.tracecompass.incubator.ftrace.core/src/org/eclipse/tracecompass/incubator/internal/ftrace/core/event/IGenericFtraceConstants.java
index 72f80113..87cdbe79 100644
--- a/tracetypes/org.eclipse.tracecompass.incubator.ftrace.core/src/org/eclipse/tracecompass/incubator/internal/ftrace/core/event/IGenericFtraceConstants.java
+++ b/tracetypes/org.eclipse.tracecompass.incubator.ftrace.core/src/org/eclipse/tracecompass/incubator/internal/ftrace/core/event/IGenericFtraceConstants.java
@@ -52,7 +52,7 @@ public interface IGenericFtraceConstants {
*/
Pattern FTRACE_PATTERN = Pattern.compile("^\\s*(?<comm>.*)-(?<pid>\\d+)(?:\\s+\\([^0-9]*(?<tgid>\\d+)?\\))?\\s+\\[(?<cpu>\\d+)\\](?:\\s+....)?\\s+(?<timestamp>[0-9]+(?<us>\\.[0-9]+)?): (?<name>\\w+:\\s+)+(?<data>.+)"); //$NON-NLS-1$
/**
- * comm group in {@link IFtraceConstants#FTRACE_PATTERN}
+ * comm group in {@link IGenericFtraceConstants#FTRACE_PATTERN}
*/
String FTRACE_COMM_GROUP = "comm"; //$NON-NLS-1$
/**
@@ -76,7 +76,7 @@ public interface IGenericFtraceConstants {
*/
String FTRACE_DATA_GROUP = "data"; //$NON-NLS-1$
/**
- * TGID group in {@link IFtraceConstants#FTRACE_PATTERN}
+ * TGID group in {@link IGenericFtraceConstants#FTRACE_PATTERN}
*/
String FTRACE_TGID_GROUP = "tgid"; //$NON-NLS-1$
}
diff --git a/tracetypes/org.eclipse.tracecompass.incubator.ftrace.core/xml_analyses/FunctionGraph.xml b/tracetypes/org.eclipse.tracecompass.incubator.ftrace.core/xml_analyses/FunctionGraph.xml
new file mode 100644
index 00000000..5710983e
--- /dev/null
+++ b/tracetypes/org.eclipse.tracecompass.incubator.ftrace.core/xml_analyses/FunctionGraph.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<tmfxml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="../../org.eclipse.tracecompass.tmf.analysis.xml.core/src/org/eclipse/tracecompass/tmf/analysis/xml/core/module/xmlDefinition.xsd">
+ <callstack id="org.eclipse.tracecompass.incubator.ftrace.function.graph">
+ <callstackGroup name="FTrace function graph">
+ <level path="Threads/*" />
+ <thread level="1" />
+ </callstackGroup>
+ <!-- callstack process="Views/*" thread="Threads/*" callstack="callstack"
+ / -->
+
+ <pattern version="1"
+ id="org.eclipse.tracecompass.incubator.ftrace.function.graph.pattern">
+ <head>
+ <traceType id="org.eclipse.tracecompass.incubator.ftrace.core" />
+ <label value="Function Graph" />
+ </head>
+
+ <patternHandler>
+
+ <action id="push_event">
+ <!-- Push the current event to the thread's callstack -->
+ <stateChange>
+ <stateAttribute type="constant" value="Threads" />
+ <stateAttribute type="eventField" value="pid" />
+ <stateAttribute type="constant" value="CallStack" />
+ <stateValue type="eventField" value="func" stack="push" />
+ </stateChange>
+ </action>
+
+ <action id="pop_event">
+ <!-- Pop the current event from the callstack -->
+ <stateChange>
+ <stateAttribute type="constant" value="Threads" />
+ <stateAttribute type="eventField" value="pid" />
+ <stateAttribute type="constant" value="CallStack" />
+ <stateValue type="eventField" value="func" stack="pop" />
+ </stateChange>
+ </action>
+
+ <!-- FSMs -->
+
+ <fsm id="functionGraph" initial="func_graph">
+ <state id="func_graph">
+ <!-- The state will stay here until we have a thread start event -->
+ <transition event="funcgraph_entry" target="func_graph"
+ action="push_event" />
+ <transition event="funcgraph_exit" target="func_graph"
+ action="pop_event" />
+ </state>
+ </fsm>
+
+ </patternHandler>
+ </pattern>
+ </callstack>
+
+</tmfxml>

Back to the top