LLVM-LOCSTATS(1)
π 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-locstatsreturns0if 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 π
llvm-dwarfdump(1)β the origin story, the blueprint, the mother. π«Ά
π AUTHOR π
Maintained by the LLVM Team (https://llvm.org/).
π COPYRIGHT π
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
- fedora 43: llvm11 11.1.0-14.fc41 Β· NCSA
- fedora 43: llvm11 11.1.0-14.fc41 Β· NCSA
- fedora 44: llvm11 11.1.0-14.fc41 Β· NCSA
- fedora 44: llvm11 11.1.0-14.fc41 Β· NCSA
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms