diff options
| author | Xinliang David Li <davidxl@google.com> | 2015-11-23 20:47:38 +0000 |
|---|---|---|
| committer | Xinliang David Li <davidxl@google.com> | 2015-11-23 20:47:38 +0000 |
| commit | 6f7c19a494fdf8aecf5053e4201f222eb1fa4bed (patch) | |
| tree | 16f3ea4432e185a9285b43d8ddae679b11c079f5 /llvm/test/tools | |
| parent | 243ea6a7d6d90eb52d3e30cb4a2b73d3fd428f88 (diff) | |
| download | bcm5719-llvm-6f7c19a494fdf8aecf5053e4201f222eb1fa4bed.tar.gz bcm5719-llvm-6f7c19a494fdf8aecf5053e4201f222eb1fa4bed.zip | |
[PGO] Add --text option for llvm-profdata show|merge commands
The new option is similar to the SampleProfile dump option.
- dump raw/indexed format into text profile format
- merge the profile and output into text profile format.
Note that Value Profiling data text format is not yet designed.
That functionality will be added later.
Differential Revision: http://reviews.llvm.org/D14894
llvm-svn: 253913
Diffstat (limited to 'llvm/test/tools')
| -rw-r--r-- | llvm/test/tools/llvm-profdata/Inputs/basic.proftext | 40 | ||||
| -rw-r--r-- | llvm/test/tools/llvm-profdata/text-dump.test | 21 |
2 files changed, 61 insertions, 0 deletions
diff --git a/llvm/test/tools/llvm-profdata/Inputs/basic.proftext b/llvm/test/tools/llvm-profdata/Inputs/basic.proftext new file mode 100644 index 00000000000..e8c4d82eef2 --- /dev/null +++ b/llvm/test/tools/llvm-profdata/Inputs/basic.proftext @@ -0,0 +1,40 @@ +foo +10 +2 +499500 +179900 + +main +16650 +4 +1 +1000 +1000000 +499500 + +foo2 +10 +2 +500500 +180100 + +foo +10 +2 +499500 +179900 + +main +16650 +4 +1 +1000 +1000000 +499500 + +foo2 +10 +2 +500500 +180100 + diff --git a/llvm/test/tools/llvm-profdata/text-dump.test b/llvm/test/tools/llvm-profdata/text-dump.test new file mode 100644 index 00000000000..94a78d9dbac --- /dev/null +++ b/llvm/test/tools/llvm-profdata/text-dump.test @@ -0,0 +1,21 @@ +Basic tests for testing text dump functions. + +RUN: llvm-profdata show --all-functions -counts --text %p/Inputs/basic.proftext > %t-basic.proftext1 +RUN: llvm-profdata merge -o %t-basic.proftext2 --text %p/Inputs/basic.proftext + +RUN: llvm-profdata merge -binary -o %t-basic.profdata1 %t-basic.proftext1 +RUN: llvm-profdata merge -o %t-basic.profdata2 %t-basic.proftext2 + +RUN: llvm-profdata show --all-functions -counts %t-basic.profdata1 > %t-basic.dump3 +RUN: llvm-profdata show --all-functions -counts %t-basic.profdata2 > %t-basic.dump4 + +RUN: llvm-profdata merge -text -o %t-basic.proftext5 %t-basic.profdata1 +RUN: llvm-profdata merge -text -o %t-basic.proftext6 %t-basic.profdata2 + +RUN: diff %t-basic.dump3 %t-basic.dump4 +RUN: diff %t-basic.proftext5 %t-basic.proftext6 + +RUN: not llvm-profdata merge -gcc -o %t-basic-profdata3 %t-basic.proftext2 2>&1 | FileCheck %s --check-prefix=UNKNOWN +UNKNOWN: Unknown + + |

