LLVM-LOCSTATS(1)
π LLVM-LOCSTATS(1) β like, the whole glow-up
okay so first thing bestie, this is a page from the LLVM manual collection, and it's all about llvm-locstats. yes the title up top says LLVM-LOCSTATS(1) but that's just the official little name tag, we're gonna actually understand it now π«Ά
β¨ NAME β¨
llvm-locstats β it calculates statistics on DWARF debug location. that's it, that's the vibe. numbers about where your debug info actually lives π
πΈ SYNOPSIS πΈ
llvm-locstats [options] [filename]
that's the whole shape of it. options, maybe a filename, done. iconic honestly.
π¦ DESCRIPTION π¦
so llvm-locstats lowkey works like a wrapper around llvm-dwarfdump. it parses the llvm-dwarfdump statistics regarding debug location and pretty prints them in a way more human readable way. it's giving translator, it's giving "I got you", no cap π
here's the part where you actually need to pay attention, bestie, because the buckets are the whole personality of this tool:
- the line
0%shows the number and the percentage of DIEs with no location information at all. like, zero. nada. π - the line
100%shows the information for DIEs where there is location information in all code section bytes β that means where the variable or parameter is in the scope. full coverage, main character energy π - 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.
so yeah, the ranges are literally the coverage brackets. the closer to 100%, the more your variable is actually findable. periodt.
π OPTIONS π
--only-variablesβ calculate the location statistics only for local variables. just the locals, nothing else, mind your business β¨--only-formal-parametersβ calculate the location statistics only for formal parameters. parameters-only era π--ignore-debug-entry-valuesβ ignore the location statistics on locations containing the debug entry values DWARF operation. skipping that whole category, respectfully π--draw-plotβ make a histogram of the location buckets generated. heads up bestie: this requiresmatplotlibπ--compareβ compare the debug location coverage on the two files provided, and draw a plot showing the difference. also requiresmatplotlibπ₯
fr fr, if you run the plot ones without matplotlib installed, that's on you, not me π
β EXIT STATUS β
llvm-locstats returns 0 if the input file were parsed successfully. otherwise, it returns 1. binary queen, she either slays or she doesn't π«Ά
π EXAMPLE 1 π
pretty print the location coverage on the standard output:
llvm-locstats a.out
and it comes out looking like this, look at her go:
=================================================
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%
=================================================
six variables processed, 81% PC ranges covered, 83% total availability. she ate and left no crumbs π½οΈ
π§ 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) <llvm-dwarfdump.html> β go say hi to the tool this one wraps around, they're literally besties π«Ά
π Author π
maintained by the LLVM Team (https://llvm.org/). they keep the lights on, respect π
π Copyright π
2003-2026, LLVM Project
okay that's the whole page, you're basically a DWARF location statistician now, iykyk π
this cutie is from LLVM version 15, dated 2026-09-09 β screenshot it, frame it, put it on your wall, mwah ππ
π¦ where this page comes from
- ubuntu stonking: llvm-18 1:18.1.8-20ubuntu11 Β· APACHE-2-LLVM-EXCEPTIONS
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms