LLVM-LOCSTATS(1)

πŸ“¦
version 12.0.1 Β· 4 versions
, in fedora 43, fedora 44

πŸ’… llvm-locstats β€” the manual page, but make it cute

okay bestie, welcome to llvm-locstats (from the LLVM manual, section 1) β€” the little tool that does the math on your DWARF debug location info so you don't have to squint at raw numbers. ✨


🌸 NAME 🌸

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


πŸŽ€ SYNOPSIS πŸŽ€

llvm-locstats [options] [filename]

πŸ¦‹ DESCRIPTION πŸ¦‹

So here's the tea: llvm-locstats is basically a glow-up wrapper around llvm-dwarfdump. 🫢 It parses the debug location statistics that llvm-dwarfdump spits out and pretty prints them in a way that's actually human readable. It's giving translator. It's giving I got you.

Now, the buckets. Let's decode them:

  • The 0% line shows you the number and the percentage of DIEs with no location information at all. 😭
  • The 100% line shows the info for DIEs where there is location information in all code section bytes (like, where the variable or parameter is actually in the scope). πŸ‘‘
  • The [50%,60%) line shows the number and the percentage of DIEs where the location information covers between 50 and 60 percentage of its scope. Math but make it cute.

✨ 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 a histogram of the location buckets generated (requires matplotlib) πŸ“Š
  • --compare β€” compare the debug location coverage on two files you provide, and draw a plot showing the difference (requires matplotlib) πŸ”₯

πŸ’€ EXIT STATUS πŸ’€

llvm-locstats returns 0 if the input file was parsed successfully. Otherwise it returns 1. No in-between, bestie, it's a binary situation.


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

🧚 EXAMPLE 2 🧚

Generate a plot as an image file.

llvm-locstats --draw-plot file1.out

[image]


πŸ“ 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]


πŸ‘‘ SEE ALSO πŸ‘‘

llvm-dwarfdump(1) β€” go say hi, it's the whole reason this works πŸ’œ


πŸ’– AUTHOR πŸ’–

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


2003-2024, LLVM Project


no cap, that's the whole page. every flag, every bucket, every percentage β€” all accounted for. πŸ’…

and that's a wrap, bestie!! this page is page 12, dated 2024-07-18, from the LLVM manual β€” you ate that, go run some stats πŸ¦‹βœ¨πŸ’–

πŸ“¦ where this page comes from