LLVM-LOCSTATS(1)

πŸ’… LLVM-LOCSTATS(1) β€” like, the whole glow-up

okay so first thing bestie, this is a page from the LLVM manual collection, and it's all about llvm-locstats. yes the title up top says LLVM-LOCSTATS(1) but that's just the official little name tag, we're gonna actually understand it now 🫢


✨ NAME ✨

llvm-locstats β€” it calculates statistics on DWARF debug location. that's it, that's the vibe. numbers about where your debug info actually lives πŸ’€


🌸 SYNOPSIS 🌸

llvm-locstats [options] [filename]

that's the whole shape of it. options, maybe a filename, done. iconic honestly.


πŸ¦‹ DESCRIPTION πŸ¦‹

so llvm-locstats lowkey works like a wrapper around llvm-dwarfdump. it parses the llvm-dwarfdump statistics regarding debug location and pretty prints them in a way more human readable way. it's giving translator, it's giving "I got you", no cap πŸ’–

here's the part where you actually need to pay attention, bestie, because the buckets are the whole personality of this tool:

  • the line 0% shows the number and the percentage of DIEs with no location information at all. like, zero. nada. πŸ™ˆ
  • the line 100% shows the information for DIEs where there is location information in all code section bytes β€” that means 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.

so yeah, the ranges are literally the coverage brackets. the closer to 100%, the more your variable is actually findable. periodt.


πŸ’œ OPTIONS πŸ’œ

  • --only-variables β€” calculate the location statistics only for local variables. just the locals, nothing else, mind your business ✨
  • --only-formal-parameters β€” calculate the location statistics only for formal parameters. parameters-only era πŸŽ€
  • --ignore-debug-entry-values β€” ignore the location statistics on locations containing the debug entry values DWARF operation. skipping that whole category, respectfully πŸ™…
  • --draw-plot β€” make a histogram of the location buckets generated. heads up bestie: this requires matplotlib 🌈
  • --compare β€” compare the debug location coverage on the two files provided, and draw a plot showing the difference. also requires matplotlib πŸ”₯
fr fr, if you run the plot ones without matplotlib installed, that's on you, not me πŸ’€

⭐ EXIT STATUS ⭐

llvm-locstats returns 0 if the input file were parsed successfully. otherwise, it returns 1. binary queen, she either slays or she doesn't 🫢


πŸ“ EXAMPLE 1 πŸ“

pretty print the location coverage on the standard output:

llvm-locstats a.out

and it comes out looking like this, look at her go:

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

six variables processed, 81% PC ranges covered, 83% total availability. she ate and left no crumbs 🍽️


🧚 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 🌈

llvm-dwarfdump(1) <llvm-dwarfdump.html> β€” go say hi to the tool this one wraps around, they're literally besties 🫢


πŸŽ€ Author πŸŽ€

maintained by the LLVM Team (https://llvm.org/). they keep the lights on, respect πŸ’–

2003-2026, LLVM Project


okay that's the whole page, you're basically a DWARF location statistician now, iykyk πŸ’…

this cutie is from LLVM version 15, dated 2026-09-09 β€” screenshot it, frame it, put it on your wall, mwah πŸ˜­πŸ’œ

πŸ“¦ where this page comes from