LLVM-LOCSTATS(1)

πŸ“¦
version 16.0.6 Β· 3 versions
, in ubuntu noble

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

okay so you know how llvm-dwarfdump is out here giving you numbers but like... numbers that make your eyes glaze over? this is the glow-up version. this is the LLVM man page for llvm-locstats, from the LLVM-LOCSTATS(1) corner of the universe, and it's about to be your new obsession fr fr.


🌸 NAME 🌸

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

no cap, that's the whole job. she counts. she reports. she slays.


✨ SYNOPSIS ✨

llvm-locstats [options] [filename]

yep that's it. give her some options, maybe hand her a filename, and let her cook πŸ”₯


πŸ¦‹ DESCRIPTION πŸ¦‹

so llvm-locstats is basically the bestie wrapper around llvm-dwarfdump. like, it does NOT do the heavy lifting herself β€” she takes the statistics from llvm-dwarfdump regarding debug location and pretty prints them in a way that's, like, actually human readable? iconic behaviour honestly. πŸ’–

here's the vibe of the output buckets, listen closely because this part matters:

  • The 0% line shows you the number and the percentage of DIEs with no location information. like, zero. nada. the variable said "i'm not telling you where i live." πŸ«₯
  • The 100% line is the main character β€” it shows the info for DIEs where there IS location information in all code section bytes (that's when the variable or parameter is in the scope). full coverage, ate, no crumbs. πŸ‘‘
  • The [50%,60%) line shows the number and percentage of DIEs where the location information covers between 50 and 60 percentage of its scope. so like, partially there. trying her best. we respect it. 🌈

and yeah, every bucket in between works the same way β€” number of samples, plus the percentage. easy.


πŸŽ€ OPTIONS πŸŽ€

  • --only-variables β€” calculate the location statistics only for local variables. girls only, local vars only πŸ’…
  • --only-formal-parameters β€” calculate the location statistics only for formal parameters. different girlies, different stats ✨
  • --ignore-debug-entry-values β€” ignore the location statistics on locations containing the debug entry values DWARF operation. like, we're pretending that operation doesn't exist, okay? she's not in the group chat rn πŸ™ˆ
  • --draw-plot β€” make a histogram of the location buckets generated. heads up bestie: this requires matplotlib πŸ“Š
  • --compare β€” compare the debug location coverage on two files provided, and draw a plot showing the difference. also requires matplotlib. two files enter, one plot leaves 😀
not me needing matplotlib twice in the same option list. if you don't have it installed these two flags are gonna be a whole situation, so plan accordingly.

πŸ’€ EXIT STATUS πŸ’€

  • llvm-locstats returns 0 if the input file were parsed successfully. slay, we love a happy ending 🫢
  • Otherwise, it returns 1. it's giving... the file did not parse. sad. 😭

🌟 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 little table. she's beauty, she's grace. πŸŽ€


🌸 EXAMPLE 2 🌸

Generate a plot as an image file.

llvm-locstats --draw-plot file1.out
[image]

boom. picture. matplotlib did that. ✨


πŸ¦‹ 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]

a diff plot?? the way that --compare just ate and left no crumbs πŸ”₯


πŸ‘€ SEE ALSO πŸ‘€


πŸ’– AUTHOR πŸ’–

Maintained by the LLVM Team (https://llvm.org/). the whole squad keeping this thing alive, periodt.


2003-2024, LLVM Project


and that's the whole page bestie β€” brought to you by LLVM 15, dated 2024-04-14, in the LLVM-LOCSTATS(1) era. go forth, measure your debug locations, and remember: 100% coverage is the goal, but 83% total availability is still a serve. mwah πŸ’…πŸ’–βœ¨

πŸ“¦ where this page comes from