LLVM-LOCSTATS(1)

πŸ“¦ version 23.1.3, in centos-stream 9

πŸ’… LLVM-LOCSTATS(1) β€” the llvm-locstats manual page

okay so bestie, welcome to LLVM-LOCSTATS(1), part of the LLVM manual set ✨ this is the page that teaches you how to get the tea on your DWARF debug location coverage. it's giving "I just want to know how much of my code actually has location info" and honestly? iconic.


🌸 NAME 🌸

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

like, it literally does what it says on the tin. no cap. 🫢


✨ SYNOPSIS ✨

llvm-locstats [options] [filename]

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the vibe: llvm-locstats works like a wrapper around llvm-dwarfdump. it parses llvm-dwarfdump statistics regarding debug location and pretty prints it in a more human-readable way. that's the whole personality. πŸ’–

now the buckets, and this part is lowkey important so pay attention:

  • the line 0% shows the number and the percentage of DIEs with no location information
  • 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 it's basically a glow-up report card for your debug info. main character energy. πŸ‘‘


πŸŽ€ 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 histogram of location buckets generated (requires matplotlib) πŸ”₯
  • --compare β€” compare the debug location coverage on two files provided, and draw a plot showing the difference (requires matplotlib) ⭐
heads up bestie: both --draw-plot and --compare require matplotlib. no matplotlib, no plot. that's the rule. 😭

πŸ’€ EXIT STATUS πŸ’€

llvm-locstats returns 0 if the input file were parsed successfully. otherwise, it returns 1. simple as. πŸ’…


πŸ“ EXAMPLE 1 πŸ“

pretty print the location coverage on the standard output.

   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. the way it just sits there all organized. we love a structured queen. πŸ“Šβœ¨


🧚 EXAMPLE 2 🧚

generate a plot as an image file.

   llvm-locstats --draw-plot file1.out

[image]

yes bestie, the plot is the payoff. πŸ–ΌοΈ


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

comparison plots?? we're literally doing side-by-side analysis now. obsessed. πŸ¦‹


πŸ‘‘ SEE ALSO πŸ‘‘

llvm-dwarfdump(1)

go read that one too, iykyk. 🫢


πŸ’œ AUTHOR πŸ’œ

maintained by the LLVM Team (https://llvm.org/). they're the parents of this whole ecosystem fr fr.


2003-2026, LLVM Project


okay that's the whole page, bestie! πŸ’– this was LLVM-LOCSTATS(1), from LLVM β€” version 23, dated 2026-10-06 β€” and honestly? she ate. go forth and check your debug location coverage, and remember: no location info is a choice, and not a slay one. πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from