LLVM-LOCSTATS(1)

πŸ’… LLVM-LOCSTATS(1) β€” bestie's guide to debug location stats ✨

okay so this is llvm-locstats, and it lives in the LLVM manual set (section 1, if you're keeping score πŸŽ€). think of it as the ✨aesthetic✨ glow-up of llvm-dwarfdump statistics, and honestly it ate.


✨ NAME ✨

llvm-locstats β€” calculate statistics on DWARF debug location πŸ’–


🌸 SYNOPSIS 🌸

llvm-locstats [options] [filename]

πŸ¦‹ DESCRIPTION πŸ¦‹

So llvm-locstats is basically a wrapper around llvm-dwarfdump, no cap. It parses the llvm-dwarfdump statistics about debug location and pretty prints them in a way more human-readable way. It's giving translator, it's giving "let me make this make sense for you".

Now the buckets, because this is the part where people get confused and I refuse to let that be you:

  • the line 0% shows the number and the percentage of DIEs with no location information β€” like, zero, nothing, ghosted πŸ‘»
  • the line 100% shows the information for DIEs where there is location information in all code section bytes (that's where the variable or parameter is in the scope) β€” full coverage, main character energy πŸ‘‘
  • 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

periodt. that's the whole vibe check.


πŸ’… 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 generated (requires matplotlib) πŸ“Š
  • --compare β€” compare the debug location coverage on the two files provided, and draw a plot showing the difference (requires matplotlib) πŸ”₯
heads up bestie: --draw-plot and --compare both require matplotlib. don't come for me if it's not installed, I warned you 😭

⭐ EXIT STATUS ⭐

llvm-locstats returns 0 if the input file were parsed successfully. Otherwise, it returns 1. That's it, that's the whole drama πŸ’€


πŸŽ€ EXAMPLE 1 πŸŽ€

Pretty print the location coverage on the standard output. iconic behaviour:

llvm-locstats a.out

and it gives you:

  =================================================
            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%
  =================================================

look at those numbers slaying in a grid, we love to see it 🌈


🌟 EXAMPLE 2 🌟

Generate a plot as an image file. yes, an actual image, we're being artistic:

llvm-locstats --draw-plot file1.out

[image]

(that's the plot. it's beautiful. you had to be there πŸ’œ)


🧚 EXAMPLE 3 🧚

Generate a plot as an image file showing the difference in the debug location coverage. comparison era, we're analyzing:

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

[image]


πŸ” SEE ALSO πŸ”

  • llvm-dwarfdump(1) <llvm-dwarfdump.html> β€” the og, the source of the stats, go say hi πŸ¦‹

πŸ‘‘ Author

Maintained by the LLVM Team (https://llvm.org/). they're literally the parents of this whole thing, respect.

2003-2026, LLVM Project


k that's the whole page, go run it on something and feel smart about it fr fr πŸ“

✨ cute sign-off ✨ β€” this masterpiece comes from LLVM, version 23, dated 2026-10-20. screenshot it, frame it, tell your friends πŸ’…πŸŽ€
πŸ“¦ where this page comes from
  • arch rolling: llvm 23.1.4-1 Β· Apache-2.0 WITH LLVM-exception
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms