diff options
| author | Djordje Todorovic <djordje.todorovic@rt-rk.com> | 2019-09-10 13:47:03 +0000 |
|---|---|---|
| committer | Djordje Todorovic <djordje.todorovic@rt-rk.com> | 2019-09-10 13:47:03 +0000 |
| commit | 54008972d17bf82ae36ccda7a2b20985c8a2821e (patch) | |
| tree | 3853ac9307ca949b960c0ce52f3ebf4a43255e21 /llvm/test | |
| parent | 7dfd0fb7f1cda3525d9c2fbdf680391b73479031 (diff) | |
| download | bcm5719-llvm-54008972d17bf82ae36ccda7a2b20985c8a2821e.tar.gz bcm5719-llvm-54008972d17bf82ae36ccda7a2b20985c8a2821e.zip | |
[utils] Implement the llvm-locstats tool
The tool reports verbose output for the DWARF debug location coverage.
The llvm-locstats for each variable or formal parameter DIE computes what
percentage from the code section bytes, where it is in scope, it has
location description. The line 0 shows the number (and the percentage) of
DIEs with no location information, but the line 100 shows the number (and
the percentage) of DIEs where there is location information in all code
section bytes (where the variable or parameter is in the scope). The line
50..59 shows the number (and the percentage) of DIEs where the location
information is in between 50 and 59 percentage of its scope covered.
The tool will be very useful for tracking improvements regarding the
"debugging optimized code" support with LLVM ecosystem.
Differential Revision: https://reviews.llvm.org/D66526
llvm-svn: 371520
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/tools/llvm-dwarfdump/X86/locstats.ll | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/llvm/test/tools/llvm-dwarfdump/X86/locstats.ll b/llvm/test/tools/llvm-dwarfdump/X86/locstats.ll index e88667390ea..1e776eed3ac 100644 --- a/llvm/test/tools/llvm-dwarfdump/X86/locstats.ll +++ b/llvm/test/tools/llvm-dwarfdump/X86/locstats.ll @@ -1,6 +1,9 @@ ; RUN: llc -debug-entry-values %s -o - -filetype=obj \ ; RUN: | llvm-dwarfdump -statistics - | FileCheck %s ; +; RUN: llc -debug-entry-values %s -o %t0.o -filetype=obj \ +; RUN: | llvm-locstats %t0.o | FileCheck %s --check-prefix=LOCSTATS +; ; CHECK: "entry value scope bytes covered":5 ; CHECK: "formal params scope bytes total":20 ; CHECK: "formal params scope bytes covered":20 @@ -84,6 +87,20 @@ ; CHECK: "vars (excluding the debug entry values) with 90-99% of its scope covered":0 ; CHECK: "vars (excluding the debug entry values) with 100% of its scope covered":1} ; +; Test the llvm-locstats output. +; LOCSTATS: 0% 1 16% +; LOCSTATS: 1-9% 0 0% +; LOCSTATS: 10-19% 0 0% +; LOCSTATS: 20-29% 0 0% +; LOCSTATS: 30-39% 0 0% +; LOCSTATS: 40-49% 0 0% +; LOCSTATS: 50-59% 1 16% +; LOCSTATS: 60-69% 0 0% +; LOCSTATS: 70-79% 0 0% +; LOCSTATS: 80-89% 1 16% +; LOCSTATS: 90-99% 0 0% +; LOCSTATS: 100% 3 50% +; ; The source code of the test case: ; extern void fn3(int *); ; extern void fn2 (int); |

