summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools
diff options
context:
space:
mode:
authorDean Michael Berris <dberris@google.com>2017-01-25 07:14:43 +0000
committerDean Michael Berris <dberris@google.com>2017-01-25 07:14:43 +0000
commitd09bf194fa35aeda39b8079c05f0121195ac53d4 (patch)
tree175411eb4a4173c09c0b4d478bf38a4d768f1ac5 /llvm/test/tools
parent77807d93af093e8806ec87db6240f67da48838ee (diff)
downloadbcm5719-llvm-d09bf194fa35aeda39b8079c05f0121195ac53d4.tar.gz
bcm5719-llvm-d09bf194fa35aeda39b8079c05f0121195ac53d4.zip
Implemented color coding and Vertex labels in XRay Graph
Summary: A patch to enable the llvm-xray graph subcommand to color edges and vertices based on statistics and to annotate vertices with statistics. Depends on D27243 Reviewers: dblaikie, dberris Reviewed By: dberris Subscribers: mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D28225 llvm-svn: 293031
Diffstat (limited to 'llvm/test/tools')
-rw-r--r--llvm/test/tools/llvm-xray/X86/Inputs/simple-instrmap.yaml12
-rw-r--r--llvm/test/tools/llvm-xray/X86/graph-color-simple-case.yaml75
-rw-r--r--llvm/test/tools/llvm-xray/X86/graph-deduce-tail-call.yaml2
-rw-r--r--llvm/test/tools/llvm-xray/X86/graph-simple-case.yaml2
4 files changed, 89 insertions, 2 deletions
diff --git a/llvm/test/tools/llvm-xray/X86/Inputs/simple-instrmap.yaml b/llvm/test/tools/llvm-xray/X86/Inputs/simple-instrmap.yaml
index e9c9f2e8d3c..c1f6915646a 100644
--- a/llvm/test/tools/llvm-xray/X86/Inputs/simple-instrmap.yaml
+++ b/llvm/test/tools/llvm-xray/X86/Inputs/simple-instrmap.yaml
@@ -7,4 +7,16 @@
- { id: 2, address: 0x3, function: 0x2, kind: function-exit, always-instrument: true}
- { id: 3, address: 0x3, function: 0x3, kind: function-enter, always-instrument: true}
- { id: 3, address: 0x4, function: 0x3, kind: function-exit, always-instrument: true}
+- { id: 4, address: 0x4, function: 0x4, kind: function-enter, always-instrument: true}
+- { id: 4, address: 0x5, function: 0x4, kind: function-exit, always-instrument: true}
+- { id: 5, address: 0x5, function: 0x5, kind: function-enter, always-instrument: true}
+- { id: 5, address: 0x6, function: 0x5, kind: function-exit, always-instrument: true}
+- { id: 6, address: 0x6, function: 0x6, kind: function-enter, always-instrument: true}
+- { id: 6, address: 0x7, function: 0x6, kind: function-exit, always-instrument: true}
+- { id: 7, address: 0x7, function: 0x7, kind: function-enter, always-instrument: true}
+- { id: 7, address: 0x8, function: 0x7, kind: function-exit, always-instrument: true}
+- { id: 8, address: 0x8, function: 0x8, kind: function-enter, always-instrument: true}
+- { id: 8, address: 0x9, function: 0x8, kind: function-exit, always-instrument: true}
+- { id: 9, address: 0x9, function: 0x9, kind: function-enter, always-instrument: true}
+- { id: 9, address: 0xA, function: 0x9, kind: function-exit, always-instrument: true}
...
diff --git a/llvm/test/tools/llvm-xray/X86/graph-color-simple-case.yaml b/llvm/test/tools/llvm-xray/X86/graph-color-simple-case.yaml
new file mode 100644
index 00000000000..e1d0d9ad52c
--- /dev/null
+++ b/llvm/test/tools/llvm-xray/X86/graph-color-simple-case.yaml
@@ -0,0 +1,75 @@
+#RUN: llvm-xray graph %s -o - -m %S/Inputs/simple-instrmap.yaml -t yaml -e sum -c sum \
+#RUN: | FileCheck %s -check-prefix=EDGE
+#RUN: llvm-xray graph %s -o - -m %S/Inputs/simple-instrmap.yaml -t yaml -v sum -b sum \
+#RUN: | FileCheck %s -check-prefix=VERTEX
+---
+header:
+ version: 1
+ type: 0
+ constant-tsc: true
+ nonstop-tsc: true
+ cycle-frequency: 1
+records:
+ - { type: 0, func-id: 1, cpu: 1, thread: 111, kind: function-enter, tsc: 10000 }
+ - { type: 0, func-id: 1, cpu: 1, thread: 111, kind: function-exit, tsc: 10010 }
+ - { type: 0, func-id: 2, cpu: 1, thread: 111, kind: function-enter, tsc: 10100 }
+ - { type: 0, func-id: 2, cpu: 1, thread: 111, kind: function-exit, tsc: 10120 }
+ - { type: 0, func-id: 3, cpu: 1, thread: 111, kind: function-enter, tsc: 10200 }
+ - { type: 0, func-id: 3, cpu: 1, thread: 111, kind: function-exit, tsc: 10230 }
+ - { type: 0, func-id: 4, cpu: 1, thread: 111, kind: function-enter, tsc: 10300 }
+ - { type: 0, func-id: 4, cpu: 1, thread: 111, kind: function-exit, tsc: 10340 }
+ - { type: 0, func-id: 5, cpu: 1, thread: 111, kind: function-enter, tsc: 10400 }
+ - { type: 0, func-id: 5, cpu: 1, thread: 111, kind: function-exit, tsc: 10450 }
+ - { type: 0, func-id: 6, cpu: 1, thread: 111, kind: function-enter, tsc: 10500 }
+ - { type: 0, func-id: 6, cpu: 1, thread: 111, kind: function-exit, tsc: 10560 }
+ - { type: 0, func-id: 7, cpu: 1, thread: 111, kind: function-enter, tsc: 10600 }
+ - { type: 0, func-id: 7, cpu: 1, thread: 111, kind: function-exit, tsc: 10670 }
+ - { type: 0, func-id: 8, cpu: 1, thread: 111, kind: function-enter, tsc: 10700 }
+ - { type: 0, func-id: 8, cpu: 1, thread: 111, kind: function-exit, tsc: 10780 }
+ - { type: 0, func-id: 9, cpu: 1, thread: 111, kind: function-enter, tsc: 10800 }
+ - { type: 0, func-id: 9, cpu: 1, thread: 111, kind: function-exit, tsc: 10890 }
+---
+
+
+#EDGE: digraph xray {
+#EDGE-DAG: F0 -> F7 [label="7.{{[0-9]*}}e+01" color="#B00100"];
+#EDGE-DAG: F0 -> F2 [label="2.{{[0-9]*}}e+01" color="#FD9965"];
+#EDGE-DAG: F0 -> F9 [label="9.{{[0-9]*}}e+01" color="#7F0000"];
+#EDGE-DAG: F0 -> F4 [label="4.{{[0-9]*}}e+01" color="#E8543b"];
+#EDGE-DAG: F0 -> F6 [label="6.{{[0-9]*}}e+01" color="#C5140a"];
+#EDGE-DAG: F0 -> F1 [label="1.{{[0-9]*}}e+01" color="#FDC58c"];
+#EDGE-DAG: F0 -> F8 [label="8.{{[0-9]*}}e+01" color="#990101"];
+#EDGE-DAG: F0 -> F3 [label="3.{{[0-9]*}}e+01" color="#F5744d"];
+#EDGE-DAG: F0 -> F5 [label="5.{{[0-9]*}}e+01" color="#D83323"];
+#EDGE-DAG: F7 [label="@(7)"];
+#EDGE-DAG: F2 [label="@(2)"];
+#EDGE-DAG: F9 [label="@(9)"];
+#EDGE-DAG: F4 [label="@(4)"];
+#EDGE-DAG: F6 [label="@(6)"];
+#EDGE-DAG: F1 [label="@(1)"];
+#EDGE-DAG: F8 [label="@(8)"];
+#EDGE-DAG: F3 [label="@(3)"];
+#EDGE-DAG: F5 [label="@(5)"];
+#EDGE-NEXT: }
+#
+#VERTEX: digraph xray {
+#VERTEX-DAG: node [shape=record];
+#VERTEX-DAG: F0 -> F7 [label=""];
+#VERTEX-DAG: F0 -> F2 [label=""];
+#VERTEX-DAG: F0 -> F9 [label=""];
+#VERTEX-DAG: F0 -> F4 [label=""];
+#VERTEX-DAG: F0 -> F6 [label=""];
+#VERTEX-DAG: F0 -> F1 [label=""];
+#VERTEX-DAG: F0 -> F8 [label=""];
+#VERTEX-DAG: F0 -> F3 [label=""];
+#VERTEX-DAG: F0 -> F5 [label=""];
+#VERTEX-DAG: F7 [label="{@(7)|7.{{[0-9]*}}e+01}" color="#B00100"];
+#VERTEX-DAG: F2 [label="{@(2)|2.{{[0-9]*}}e+01}" color="#FD9965"];
+#VERTEX-DAG: F9 [label="{@(9)|9.{{[0-9]*}}e+01}" color="#7F0000"];
+#VERTEX-DAG: F4 [label="{@(4)|4.{{[0-9]*}}e+01}" color="#E8543b"];
+#VERTEX-DAG: F6 [label="{@(6)|6.{{[0-9]*}}e+01}" color="#C5140a"];
+#VERTEX-DAG: F1 [label="{@(1)|1.{{[0-9]*}}e+01}" color="#FDC58c"];
+#VERTEX-DAG: F8 [label="{@(8)|8.{{[0-9]*}}e+01}" color="#990101"];
+#VERTEX-DAG: F3 [label="{@(3)|3.{{[0-9]*}}e+01}" color="#F5744d"];
+#VERTEX-DAG: F5 [label="{@(5)|5.{{[0-9]*}}e+01}" color="#D83323"];
+#VERTEX-NEXT: }
diff --git a/llvm/test/tools/llvm-xray/X86/graph-deduce-tail-call.yaml b/llvm/test/tools/llvm-xray/X86/graph-deduce-tail-call.yaml
index c2732d6472b..1654f672110 100644
--- a/llvm/test/tools/llvm-xray/X86/graph-deduce-tail-call.yaml
+++ b/llvm/test/tools/llvm-xray/X86/graph-deduce-tail-call.yaml
@@ -1,5 +1,5 @@
#RUN: llvm-xray graph %s -o - -m %S/Inputs/simple-instrmap.yaml -t yaml -d \
-#RUN: | FileCheck %s -check-prefix=COUNT
+#RUN: | FileCheck %s -check-prefix=EMPTY
#RUN: llvm-xray graph %s -o - -m %S/Inputs/simple-instrmap.yaml -t yaml -d -e count \
#RUN: | FileCheck %s -check-prefix=COUNT
#
diff --git a/llvm/test/tools/llvm-xray/X86/graph-simple-case.yaml b/llvm/test/tools/llvm-xray/X86/graph-simple-case.yaml
index 02ab22241e9..0b465d09134 100644
--- a/llvm/test/tools/llvm-xray/X86/graph-simple-case.yaml
+++ b/llvm/test/tools/llvm-xray/X86/graph-simple-case.yaml
@@ -1,5 +1,5 @@
#RUN: llvm-xray graph %s -o - -m %S/Inputs/simple-instrmap.yaml -t yaml \
-#RUN: | FileCheck %s -check-prefix=COUNT
+#RUN: | FileCheck %s -check-prefix=EMPTY
#RUN: llvm-xray graph %s -o - -m %S/Inputs/simple-instrmap.yaml -t yaml -e count \
#RUN: | FileCheck %s -check-prefix=COUNT
#
OpenPOWER on IntegriCloud