LLVM-LOCSTATS(1)
π
LLVM-LOCSTATS(1) β the llvm-locstats manual page
okay so bestie, welcome to LLVM-LOCSTATS(1), part of the LLVM manual set β¨ this is the page that teaches you how to get the tea on your DWARF debug location coverage. it's giving "I just want to know how much of my code actually has location info" and honestly? iconic.
πΈ NAME πΈ
llvm-locstats β calculate statistics on DWARF debug location
like, it literally does what it says on the tin. no cap. π«Ά
β¨ SYNOPSIS β¨
llvm-locstats [options] [filename]
π¦ DESCRIPTION π¦
okay so here's the vibe: llvm-locstats works like a wrapper around llvm-dwarfdump. it parses llvm-dwarfdump statistics regarding debug location and pretty prints it in a more human-readable way. that's the whole personality. π
now the buckets, and this part is lowkey important so pay attention:
- the line
0%shows the number and the percentage of DIEs with no location information - the line
100%shows the information for DIEs where there is location information in all code section bytes (where the variable or parameter is in the scope) - 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 it's basically a glow-up report card for your debug info. main character energy. π
π 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 histogram of location buckets generated (requiresmatplotlib) π₯--compareβ compare the debug location coverage on two files provided, and draw a plot showing the difference (requiresmatplotlib) β
heads up bestie: both--draw-plotand--comparerequirematplotlib. no matplotlib, no plot. that's the rule. π
π EXIT STATUS π
llvm-locstats returns 0 if the input file were parsed successfully. otherwise, it returns 1. simple as. π
π 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. the way it just sits there all organized. we love a structured queen. πβ¨
π§ EXAMPLE 2 π§
generate a plot as an image file.
llvm-locstats --draw-plot file1.out
[image]
yes bestie, the plot is the payoff. πΌοΈ
π 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]
comparison plots?? we're literally doing side-by-side analysis now. obsessed. π¦
π SEE ALSO π
go read that one too, iykyk. π«Ά
π AUTHOR π
maintained by the LLVM Team (https://llvm.org/). they're the parents of this whole ecosystem fr fr.
π COPYRIGHT π
2003-2026, LLVM Project
okay that's the whole page, bestie! π this was LLVM-LOCSTATS(1), from LLVM β version 23, dated 2026-10-06 β and honestly? she ate. go forth and check your debug location coverage, and remember: no location info is a choice, and not a slay one. π β¨π
π¦ where this page comes from
- centos-stream 9: llvm 23.1.3-1.el9 Β· Apache-2.0 WITH LLVM-exception OR NCSA
- centos-stream 9: llvm 23.1.3-1.el9 Β· Apache-2.0 WITH LLVM-exception OR NCSA
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms