LLVM-LOCSTATS(1)

πŸ“¦
version 11.1.0 Β· 2 versions
, in fedora 43, fedora 44

πŸ’… LLVM-LOCSTATS

okay bestie, pull up a chair, because llvm-locstats is about to become your new fave. it's part of the LLVM fam, it lives in the manual as LLVM-LOCSTATS(1), and it does exactly one thing extremely well: it turns your DWARF debug location tea into actual readable numbers. πŸ«–βœ¨


✨ NAME ✨

llvm-locstats β€” calculate statistics on DWARF debug location. that's it. that's the whole job. and she ate. πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

llvm-locstats [options] [filename]

πŸ¦‹ DESCRIPTION πŸ¦‹

so the vibe is: llvm-locstats works like a wrapper around llvm-dwarfdump. like, it's the cute little sister holding the flashlight. πŸ”¦

what it does is it parses the llvm-dwarfdump statistics regarding debug location, and then pretty prints them in a way that is actually more human readable. no cap. it's giving translator energy. 🌈

okay now the important part, the bucket lore, because this is where people get confused and i refuse to let that be you:

  • the line 0% shows the number and the percentage of DIEs with no location information. (sad girl hours 😭)
  • the line 100% shows the information for DIEs where there is location information in all code section bytes β€” like, where the variable or parameter is in the scope. full coverage, main character, no crumbs left. πŸ‘‘
  • 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. mid, but honestly valid. 🫢

🌸 OPTIONS 🌸

  • --only-variables β€” calculate the location statistics only for local variables. parameters, you're sitting this one out bestie.
  • --only-formal-parameters β€” calculate the location statistics only for formal parameters. now it's the parameters' turn to shine.
  • --ignore-debug-entry-values β€” ignore the location statistics on locations containing the debug entry values DWARF operation. yes, exactly that. ignore it. we don't see it. πŸ™ˆ
  • --draw-plot β€” make a histogram of location buckets generated. ⚠️ requires matplotlib, so if you don't have it, no plot for you.
  • --compare β€” compare the debug location coverage on two files provided, and draw a plot showing the difference. ⚠️ also requires matplotlib.
fr fr, both plotting flags need matplotlib installed. don't come for me when it yells at you, i warned you. πŸ’€

πŸ’€ EXIT STATUS πŸ’€

  • llvm-locstats returns 0 if the input file were parsed successfully.
  • Otherwise, it returns 1.

that's the whole tea. zero is the slay, one is the oops. ✨


πŸ“ 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. gorgeous. no notes. πŸ’–


🧚 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 πŸ‘‘


πŸ’œ AUTHOR πŸ’œ

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


2003-2024, LLVM Project


okay that's the whole page bestie, and this manual is from the LLVM collection, version 11, dated 2024-07-18 β€” and no, i did not make that date up, that's literally the footer. go forth and get those location stats. you're gonna do amazing. periodt. πŸ’…πŸŽ€βœ¨

πŸ“¦ where this page comes from