LLVM-LOCSTATS(1)

πŸ’– LLVM-LOCSTATS πŸ’–

okay bestie, welcome to the llvm-locstats page from the LLVM manual β€” yes, that LLVM β€” and it's date night with your debug info. Let's go. πŸŽ€


✨ NAME ✨

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


🌸 SYNOPSIS 🌸

llvm-locstats [options] [filename]

πŸ¦‹ DESCRIPTION πŸ¦‹

So llvm-locstats is basically the bestie who hypes you up by translating. It works like a wrapper around llvm-dwarfdump, and what it does is it takes the stats that llvm-dwarfdump gives you about debug location and pretty prints them in a way that's, like, actually human-readable. no cap, it's giving translator era πŸ’…

Here's how to read the vibes:

  • The line 0% shows the number and the percentage of DIEs with no location information. literally nothing there 😭
  • 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 behavior πŸ‘‘
  • The line [50%,60%) shows the number and the percentage of DIEs where the location information covers between 50 and 60 percentage of its scope. halfway there, still iconic

πŸ’œ OPTIONS πŸ’œ

  • --only-variables β€” only crunch the location statistics for local variables. variables only, no plus-ones
  • --only-formal-parameters β€” only crunch the location statistics for formal parameters. parameters get the solo spotlight
  • --ignore-debug-entry-values β€” skip the location statistics on locations that contain the debug entry values DWARF operation. pretend you didn't see it
  • --draw-plot β€” make a histogram of the location buckets generated. requires matplotlib, so yes, you need that installed, bestie
  • --compare β€” compare the debug location coverage on two files that you provide, and draw a plot showing the difference. requires matplotlib again, same deal 🫢

⭐ EXIT STATUS ⭐

llvm-locstats returns 0 if the input file were parsed successfully. Otherwise, it returns 1. bestie said nope πŸ’€


πŸ”₯ EXAMPLE 1 πŸ”₯

Pretty print the location coverage on the standard output. Periodt.

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

look at that table go 😭 it ate and left no crumbs


🌈 EXAMPLE 2 🌈

Generate a plot as an image file. artistic 🎨

llvm-locstats --draw-plot file1.out

[image]


πŸ’… EXAMPLE 3 πŸ’…

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

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

[image]


🧚 SEE ALSO 🧚

  • llvm-dwarfdump(1) <llvm-dwarfdump.html> β€” the original source of the tea, go say hi

🫢 Author 🫢

Maintained by the LLVM Team (https://llvm.org/). the whole team, collectively slaying


2003-2026, LLVM Project


and that's the whole page bestie, mwah πŸ’– this was LLVM release 22, dated 2026-07-16, and yes the man page really does say LLVM-LOCSTATS(1) at the top and bottom β€” go read your debug locations, they miss you πŸ¦‹βœ¨

πŸ“¦ where this page comes from