LLVM-LOCSTATS(1)
π LLVM-LOCSTATS(1) β bestie's guide to debug location stats β¨
okay so this is llvm-locstats, and it lives in the LLVM manual set (section 1, if you're keeping score π). think of it as the β¨aestheticβ¨ glow-up of llvm-dwarfdump statistics, and honestly it ate.
β¨ NAME β¨
llvm-locstats β calculate statistics on DWARF debug location π
πΈ SYNOPSIS πΈ
llvm-locstats [options] [filename]
π¦ DESCRIPTION π¦
So llvm-locstats is basically a wrapper around llvm-dwarfdump, no cap. It parses the llvm-dwarfdump statistics about debug location and pretty prints them in a way more human-readable way. It's giving translator, it's giving "let me make this make sense for you".
Now the buckets, because this is the part 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 β like, zero, nothing, ghosted π» - the line
100%shows the information for DIEs where there is location information in all code section bytes (that's 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
periodt. that's the whole vibe check.
π 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 (requiresmatplotlib) π--compareβ compare the debug location coverage on the two files provided, and draw a plot showing the difference (requiresmatplotlib) π₯
heads up bestie:--draw-plotand--compareboth requirematplotlib. don't come for me if it's not installed, I warned you π
β EXIT STATUS β
llvm-locstats returns 0 if the input file were parsed successfully. Otherwise, it returns 1. That's it, that's the whole drama π
π EXAMPLE 1 π
Pretty print the location coverage on the standard output. iconic behaviour:
llvm-locstats a.out
and it gives you:
=================================================
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 those numbers slaying in a grid, we love to see it π
π EXAMPLE 2 π
Generate a plot as an image file. yes, an actual image, we're being artistic:
llvm-locstats --draw-plot file1.out
[image]
(that's the plot. it's beautiful. you had to be there π)
π§ EXAMPLE 3 π§
Generate a plot as an image file showing the difference in the debug location coverage. comparison era, we're analyzing:
llvm-locstats --compare file1.out file1.withentryvals.out
[image]
π SEE ALSO π
llvm-dwarfdump(1)<llvm-dwarfdump.html> β the og, the source of the stats, go say hi π¦
π Author
Maintained by the LLVM Team (https://llvm.org/). they're literally the parents of this whole thing, respect.
π Copyright
2003-2026, LLVM Project
k that's the whole page, go run it on something and feel smart about it fr fr π
β¨ cute sign-off β¨ β this masterpiece comes from LLVM, version 23, dated 2026-10-20. screenshot it, frame it, tell your friends π π
π¦ where this page comes from
- arch rolling: llvm 23.1.4-1 Β· Apache-2.0 WITH LLVM-exception
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms