LLVM-LOCSTATS(1)

πŸŽ€ NAME πŸŽ€

okay so bestie, welcome to LLVM-LOCSTATS(1) β€” the manual page for llvm-locstats, aka your new fave tool for calculating statistics on DWARF debug location. It’s giving debug-info detective energy, fr fr. πŸ’…

✨ SYNOPSIS ✨

llvm-locstats [options] [filename]

πŸ¦‹ DESCRIPTION πŸ¦‹

llvm-locstats works like a wrapper around llvm-dwarfdump. It parses llvm-dwarfdump statistics regarding debug location by pretty printing it in a more human readable way. No cap, it’s just here to make the numbers make sense. 🫢

The 0% line shows the number and the percentage of DIEs with no location information, but the 100% line shows the information for DIEs where there is location information in all code section bytes (where the variable or parameter is in the scope). The line [50%,60%) shows the number and the percentage of DIEs where the location information is between 50 and 60 percentage of its scope covered. Iconic breakdown behavior, honestly. 🌸

πŸ’– OPTIONS πŸ’–

  • --only-variables β€” calculate the location statistics only for local variables. Just the locals, bestie. πŸ“
  • --only-formal-parameters β€” calculate the location statistics only for formal parameters. Formal only, very fancy. πŸŽ€
  • --ignore-debug-entry-values β€” ignore the location statistics on locations containing the debug entry values DWARF operation. We’re not looking at those entry values today. πŸ™ˆ
  • --draw-plot β€” make histogram of location buckets generated (requires matplotlib). Plot era! πŸ“Šβœ¨
  • --compare β€” compare the debug location coverage on two files provided, and draw a plot showing the difference (requires matplotlib). Side-by-side slay. πŸ’…

πŸ”₯ EXIT STATUS πŸ”₯

llvm-locstats returns 0 if the input file were parsed successfully. Otherwise, it returns 1. Simple as that. πŸ’€

🌈 EXAMPLE 1 🌈

Pretty print the location coverage on the standard output.

          llvm-locstats a.out

            =================================================
                      Debug Location Statistics
            =================================================
                  cov%          samples       percentage(~)
            -------------------------------------------------
               0%                    1              16%
               (0%,10%)              0               0%
               [10%,20%)             0               0%
               [20%,30%)             0               0%
               [30%,40%)             0               0%
               [40%,50%)             0               0%
               [50%,60%)             1              16%
               [60%,70%)             0               0%
               [70%,80%)             0               0%
               [80%,90%)             1              16%
               [90%,100%)            0               0%
               100%                  3              50%
            =================================================
            -the number of debug variables processed: 6
            -PC ranges covered: 81%
            -------------------------------------------------
            -total availability: 83%
            =================================================

πŸ¦‹ EXAMPLE 2 πŸ¦‹

Generate a plot as an image file.

llvm-locstats --draw-plot file1.out
[image]

🧚 EXAMPLE 3 🧚

Generate a plot as an image file showing the difference in the debug location coverage.

llvm-locstats --compare file1.out file1.withentryvals.out
[image]

⭐ SEE ALSO ⭐

πŸ‘‘ AUTHOR πŸ‘‘

Maintained by the LLVM Team (https://llvm.org/). πŸ’œ

2003-2023, LLVM Project


πŸ’– cute sign-off: page 15, dated 2023-07-14, from LLVM, manual LLVM-LOCSTATS(1) β€” mwah, bestie πŸ’–

πŸ“¦ where this page comes from