LLVM-LOCSTATS(1)

πŸ’… LLVM-LOCSTATS β€” the llvm-locstats era

okay bestie, so this is the manual page for llvm-locstats, part of the LLVM fam, and it's literally the girl who counts up your DWARF debug location stats and makes them make sense. no cap. πŸŽ€


✨ NAME ✨

llvm-locstats β€” calculate statistics on DWARF debug location


πŸ¦‹ SYNOPSIS πŸ¦‹

llvm-locstats [options] [filename]

🌸 DESCRIPTION 🌸

okay so llvm-locstats is basically a wrapper around llvm-dwarfdump. it parses the llvm-dwarfdump statistics about debug location and pretty prints them in a way that's actually human readable. it's giving translator, it's giving glow-up. πŸ’–

the line 0% shows the number and the percentage of DIEs with no location information, but the line 100% shows the info for DIEs where there's location information in all code section bytes (where the variable or parameter is in the scope). and the line [50%,60%) shows the number and the percentage of DIEs where the location information is between 50 and 60 percent of its scope covered. periodt. πŸ‘‘


πŸ’… OPTIONS πŸ’…

  • --only-variables β€” calculate the location statistics only for local variables
  • --only-formal-parameters β€” calculate the location statistics only for formal parameters
  • --ignore-debug-entry-values β€” ignore the location statistics on locations containing the debug entry values DWARF operation
  • --draw-plot β€” make a histogram of the location buckets that got generated (requires matplotlib)
  • --compare β€” compare the debug location coverage on two files provided, and draw a plot showing the difference (requires matplotlib)

πŸ”₯ EXIT STATUS πŸ”₯

llvm-locstats returns 0 if the input file was parsed successfully. otherwise? it returns 1. 😭


⭐ EXAMPLE 1 ⭐

pretty print the location coverage on the standard output. yes ma'am:

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. slay:

llvm-locstats --draw-plot file1.out

[image]


🧚 EXAMPLE 3 🧚

generate a plot as an image file showing the difference in the debug location coverage. iconic:

llvm-locstats --compare file1.out file1.withentryvals.out

[image]


πŸ‘‘ SEE ALSO πŸ‘‘

llvm-dwarfdump(1)


πŸ’œ AUTHOR πŸ’œ

maintained by the LLVM Team (https://llvm.org/). they're the blueprint, fr fr.


2003-2025, LLVM Project


lowkey obsessed with you for reading the whole thing bestie 🫢

okay that's a wrap! this was LLVM 20, dated 2025-09-03, and it's been real. go count some debug locations, you main character πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from