LLVM-LOCSTATS(1)

πŸ’– LLVM-LOCSTATS πŸ’–

okay bestie, welcome to llvm-locstats from the LLVM manual, section 1 (that's the general commands girlies, iykyk) πŸ’…


✨ NAME ✨

llvm-locstats β€” the girl who does math on your DWARF debug location πŸ“Šβœ¨


🌸 SYNOPSIS 🌸

llvm-locstats [options] [filename]

πŸ¦‹ DESCRIPTION πŸ¦‹

so basically, llvm-locstats is lowkey a wrapper around llvm-dwarfdump 🫢 it parses the stats that llvm-dwarfdump gives you about debug location and pretty-prints them in a way that's actually human readable, because bestie, the raw output is giving cryptic πŸ’€

here's the tea on the buckets:

  • the 0% line? that's the number and the percentage of DIEs with no location information like at all, not a crumb πŸ₯²
  • the 100% line? that's the DIEs where there IS location information in all code section bytes β€” as in, where the variable or parameter is actually in the scope πŸ‘‘ full coverage, main character energy
  • and the [50%,60%) line (and all her lil friends) shows the number and percentage of DIEs where the location information covers between 50 and 60 percentage of its scope πŸ’«

✨ OPTIONS ✨

  • --only-variables β€” only do the location statistics for local variables, that's it, nothing else 🌸
  • --only-formal-parameters β€” only do the location statistics for formal parameters πŸŽ€
  • --ignore-debug-entry-values β€” skip the location statistics for locations that contain the debug entry values DWARF operation, we're ignoring her πŸ™ˆ
  • --draw-plot β€” make a histogram of the location buckets generated (heads up bestie, this one requires matplotlib) πŸ“ˆ
  • --compare β€” compare the debug location coverage across two files you provide, and draw a plot showing the difference (again, requires matplotlib) πŸ†š

πŸ’€ EXIT STATUS πŸ’€

llvm-locstats returns 0 if the input file was parsed successfully πŸŽ‰ otherwise it returns 1 😭


⭐ EXAMPLE 1 ⭐

pretty print the location coverage straight to standard output, no filter, raw vibes:

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

πŸŽ€ EXAMPLE 2 πŸŽ€

generate a plot as an image file, cute little picture moment:

llvm-locstats --draw-plot file1.out

[image]


🌈 EXAMPLE 3 🌈

generate a plot as an image file that shows the difference in the debug location coverage β€” the side-by-side slay:

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

[image]


πŸ‘‘ SEE ALSO πŸ‘‘

llvm-dwarfdump(1) β€” her sister, go say hi 🫢


πŸ’œ AUTHOR πŸ’œ

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


2003-2025, LLVM Project


okay that's the whole page bestie, no cap πŸ’– this was LLVM-LOCSTATS(1) from the LLVM manual, version 14, dated 2025-05-22 β€” go forth and stat your debug locations, you absolute icon πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from