Djordje Todorovic | 2ef18fb | 2019-10-02 07:00:01 +0000 | [diff] [blame] | 1 | llvm-locstats - calculate statistics on DWARF debug location |
| 2 | ============================================================ |
| 3 | |
| 4 | .. program:: llvm-locstats |
| 5 | |
| 6 | SYNOPSIS |
| 7 | -------- |
| 8 | |
| 9 | :program:`llvm-locstats` [*options*] [*filename*] |
| 10 | |
| 11 | DESCRIPTION |
| 12 | ----------- |
| 13 | |
| 14 | :program:`llvm-locstats` works like a wrapper around :program:`llvm-dwarfdump`. |
| 15 | It parses :program:`llvm-dwarfdump` statistics regarding debug location by |
| 16 | pretty printing it in a more human readable way. |
| 17 | |
| 18 | The line 0% shows the number and the percentage of DIEs with no location |
| 19 | information, but the line 100% shows the information for DIEs where there is |
| 20 | location information in all code section bytes (where the variable or parameter |
Kristina Bessonova | 1cc4b60 | 2019-12-11 20:52:49 +0300 | [diff] [blame] | 21 | is in the scope). The line [50%,60%) shows the number and the percentage of DIEs |
| 22 | where the location information is between 50 and 60 percentage of its scope |
Djordje Todorovic | 2ef18fb | 2019-10-02 07:00:01 +0000 | [diff] [blame] | 23 | covered. |
| 24 | |
| 25 | OPTIONS |
| 26 | ------- |
| 27 | |
Djordje Todorovic | a3ebc40 | 2020-01-13 12:31:28 +0100 | [diff] [blame] | 28 | .. option:: --only-variables |
Djordje Todorovic | 2ef18fb | 2019-10-02 07:00:01 +0000 | [diff] [blame] | 29 | |
Djordje Todorovic | a3ebc40 | 2020-01-13 12:31:28 +0100 | [diff] [blame] | 30 | calculate the location statistics only for local variables |
Djordje Todorovic | 2ef18fb | 2019-10-02 07:00:01 +0000 | [diff] [blame] | 31 | |
Djordje Todorovic | a3ebc40 | 2020-01-13 12:31:28 +0100 | [diff] [blame] | 32 | .. option:: --only-formal-parameters |
Djordje Todorovic | 2ef18fb | 2019-10-02 07:00:01 +0000 | [diff] [blame] | 33 | |
Djordje Todorovic | a3ebc40 | 2020-01-13 12:31:28 +0100 | [diff] [blame] | 34 | calculate the location statistics only for formal parameters |
Djordje Todorovic | 2ef18fb | 2019-10-02 07:00:01 +0000 | [diff] [blame] | 35 | |
Djordje Todorovic | a3ebc40 | 2020-01-13 12:31:28 +0100 | [diff] [blame] | 36 | .. option:: --ignore-debug-entry-values |
Djordje Todorovic | 2ef18fb | 2019-10-02 07:00:01 +0000 | [diff] [blame] | 37 | |
Djordje Todorovic | a3ebc40 | 2020-01-13 12:31:28 +0100 | [diff] [blame] | 38 | ignore the location statistics on locations containing the |
| 39 | debug entry values DWARF operation |
Djordje Todorovic | 2ef18fb | 2019-10-02 07:00:01 +0000 | [diff] [blame] | 40 | |
Djordje Todorovic | ada9646 | 2020-01-15 11:50:59 +0100 | [diff] [blame] | 41 | .. option:: --draw-plot |
| 42 | |
| 43 | make histogram of location buckets generated (requires |
| 44 | matplotlib) |
| 45 | |
Djordje Todorovic | 3b8ef78 | 2020-01-15 13:00:14 +0100 | [diff] [blame] | 46 | .. option:: --compare |
| 47 | |
| 48 | compare the debug location coverage on two files provided, and draw |
| 49 | a plot showing the difference (requires matplotlib) |
| 50 | |
Djordje Todorovic | 2ef18fb | 2019-10-02 07:00:01 +0000 | [diff] [blame] | 51 | EXIT STATUS |
| 52 | ----------- |
| 53 | |
| 54 | :program:`llvm-locstats` returns 0 if the input file were parsed |
| 55 | successfully. Otherwise, it returns 1. |
| 56 | |
Djordje Todorovic | ada9646 | 2020-01-15 11:50:59 +0100 | [diff] [blame] | 57 | EXAMPLE 1 |
Djordje Todorovic | 2ef18fb | 2019-10-02 07:00:01 +0000 | [diff] [blame] | 58 | -------------- |
| 59 | |
Djordje Todorovic | ada9646 | 2020-01-15 11:50:59 +0100 | [diff] [blame] | 60 | Pretty print the location coverage on the standard output. |
| 61 | |
Djordje Todorovic | 2ef18fb | 2019-10-02 07:00:01 +0000 | [diff] [blame] | 62 | .. code-block:: none |
| 63 | |
Djordje Todorovic | ada9646 | 2020-01-15 11:50:59 +0100 | [diff] [blame] | 64 | llvm-locstats a.out |
| 65 | |
| 66 | ================================================= |
| 67 | Debug Location Statistics |
| 68 | ================================================= |
| 69 | cov% samples percentage(~) |
| 70 | ------------------------------------------------- |
| 71 | 0% 1 16% |
| 72 | (0%,10%) 0 0% |
| 73 | [10%,20%) 0 0% |
| 74 | [20%,30%) 0 0% |
| 75 | [30%,40%) 0 0% |
| 76 | [40%,50%) 0 0% |
| 77 | [50%,60%) 1 16% |
| 78 | [60%,70%) 0 0% |
| 79 | [70%,80%) 0 0% |
| 80 | [80%,90%) 1 16% |
| 81 | [90%,100%) 0 0% |
| 82 | 100% 3 50% |
| 83 | ================================================= |
| 84 | -the number of debug variables processed: 6 |
| 85 | -PC ranges covered: 81% |
| 86 | ------------------------------------------------- |
| 87 | -total availability: 83% |
| 88 | ================================================= |
| 89 | |
| 90 | EXAMPLE 2 |
| 91 | -------------- |
| 92 | |
| 93 | Generate a plot as an image file. |
| 94 | |
| 95 | .. code-block:: none |
| 96 | |
| 97 | llvm-locstats --draw-plot file1.out |
| 98 | |
| 99 | .. image:: locstats-draw-plot.png |
| 100 | :align: center |
Djordje Todorovic | 2ef18fb | 2019-10-02 07:00:01 +0000 | [diff] [blame] | 101 | |
Djordje Todorovic | 3b8ef78 | 2020-01-15 13:00:14 +0100 | [diff] [blame] | 102 | EXAMPLE 3 |
| 103 | -------------- |
| 104 | |
| 105 | Generate a plot as an image file showing the difference in the debug location |
| 106 | coverage. |
| 107 | |
| 108 | .. code-block:: none |
| 109 | |
| 110 | llvm-locstats --compare file1.out file1.withentryvals.out |
| 111 | |
| 112 | .. image:: locstats-compare.png |
| 113 | :align: center |
| 114 | |
Djordje Todorovic | 2ef18fb | 2019-10-02 07:00:01 +0000 | [diff] [blame] | 115 | SEE ALSO |
| 116 | -------- |
| 117 | |
| 118 | :manpage:`llvm-dwarfdump(1)` |