LLVM-LOCSTATS(1)

๐Ÿ’– LLVM-LOCSTATS ๐Ÿ’–

okay so bestie, welcome to llvm-locstats โ€” yes it's a real LLVM tool, yes it's lowercase with dashes, and yes it's about to make DWARF debug location data actually make sense to your eyeballs. this is the LLVM manual page, and i'm gonna walk you through every single bit of it, no cap. ๐Ÿซถ


๐ŸŒธ NAME ๐ŸŒธ

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

like literally, that's the whole job. it calculates stats. on DWARF debug location. slay. โœจ


๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

llvm-locstats [options] [filename]

that's it. that's the whole vibe. options optional, filename optional, chaos optional. ๐Ÿ’…


๐ŸŽ€ DESCRIPTION ๐ŸŽ€

okay so 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. that's the whole concept and honestly? iconic. it's giving "middle management but make it useful." ๐Ÿ‘‘

now the important part, because these bucket labels are lowkey the main character:

  • the line 0% shows the number and the percentage of DIEs with no location information
  • but the line 100% 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

so like, 0% = nothing, 100% = fully covered, and the bracket ranges in between = partial coverage. the math is mathing. ๐Ÿงฎโœจ


โœจ OPTIONS โœจ

  • --only-variables โ€” calculate the location statistics only for local variables. just the variables, bestie, nobody else invited. ๐Ÿ™ˆ
  • --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. we simply do not perceive them. ๐Ÿ’€
  • --draw-plot โ€” make histogram of location buckets generated (requires matplotlib). yes you need matplotlib, no it's not optional, yes i'm serious. ๐Ÿ”ฅ
  • --compare โ€” compare the debug location coverage on two files provided, and draw a plot showing the difference (requires matplotlib). two files, one plot, dramatic reveal. ๐ŸŒˆ

๐Ÿ’€ EXIT STATUS ๐Ÿ’€

llvm-locstats returns 0 if the input file were parsed successfully. otherwise, it returns 1.

that's it. 0 = we ate, 1 = we did not eat. no in-between. ๐Ÿ˜ญ


๐ŸŒŸ EXAMPLE 1 ๐ŸŒŸ

pretty print the location coverage on the standard output. look at this gorgeous little table:

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

the way this table just lines up?? obsessed. the buckets go 0%, (0%,10%), then [10%,20%) all the way up through [90%,100%), then 100% โ€” notice the first bucket after 0% uses parentheses and the rest use brackets, that's not a typo, that's the original, don't @ me. ๐ŸŽ€


๐Ÿ“ EXAMPLE 2 ๐Ÿ“

generate a plot as an image file.

   llvm-locstats --draw-plot file1.out

[image] ๐Ÿ–ผ๏ธโœจ (yes, --draw-plot requires matplotlib, we mentioned that, go install it bestie)


๐Ÿงš 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] ๐Ÿ–ผ๏ธ๐ŸŒˆ (and yep, --compare also requires matplotlib โ€” same deal)


๐Ÿ”ฅ SEE ALSO ๐Ÿ”ฅ

llvm-dwarfdump(1) <llvm-dwarfdump.html>

like, the parent tool. the source of the stats. go say hi. ๐Ÿซถ


๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

maintained by the LLVM Team (https://llvm.org/).

they're the moment. they're the blueprint. ๐Ÿ’œ


2003-2026, LLVM Project

periodt. ๐ŸŒธ


ok bestie that's the whole page โ€” every option, every bucket, every 0 and 1 exit code, every example, all of it, intact. i changed the vibe, not the facts. you're welcome. ๐Ÿ’…

โœจ mwah โœจ this manual page is from LLVM, version 21, dated 2026-05-15 โ€” that's the footer tea, and honestly it ate. ๐ŸŽ€๐Ÿฆ‹๐Ÿ’–

๐Ÿ“ฆ where this page comes from