dwlocstat(1)
π¦ NAME π¦
Okay so this is dwlocstat(1), straight outta the General Commands Manual, and she is a tool for examining Dwarf location info coverage. That's the name, that's the game, no notes. π
β¨ SYNOPSIS β¨
dwlocstat [--dump=CLASSES] [--ignore=CLASSES] [--ignore-implicit-pointer] [{-p|--show-progress}] [--tabulate=START[:STEP][,...]] FILE...
dwlocstat [{--help|-?}] [--usage]
π DESCRIPTION π
okay so first things first, bestie: the page literally opens with the sentence "ltrace is a tool for examining Dwarf location info coverage." Yes. It says ltrace. That is a typo that lives in the original and we are keeping it because facts don't change around here β the tool is dwlocstat, periodt.
So what does she actually do? She goes through DIEs of the given binary's debug info that represent variables and function parameters. For each such DIE, she computes the coverage of that DIE's range β that's the list of addresses of the DIE's scope β by location expressions. And a location expression is just a description of where the given variable is located at a given location, like, e.g. a variable can be in a register. iconic.
Coverage is expressed as the percentage of covered addresses of the DIE's scope. If every single address of the DIE's scope is covered by at least one location expression, coverage is 100%. If none are covered at all, coverage is 0.0% (sharp zero, we love a sharp zero). The program assigns coverage to each relevant DIE, and then tabulates the data. The output might look something like this:
coverage% samples cumulative
0..10 1049/29% 1049/29%
11..20 67/1% 1116/31%
21..30 95/2% 1211/34%
31..40 84/2% 1295/36%
41..50 69/1% 1364/38%
51..60 100/2% 1464/41%
61..70 58/1% 1522/42%
71..80 85/2% 1607/45%
81..90 102/2% 1709/48%
91..100 1851/51% 3560/100%
So this is saying: there were 1049 variable or parameter DIEs whose coverage was less than or equal to 10%. Those 1049 DIEs comprise 29% of the total number of processed DIEs, which is 3560. And the way the tabulation is done can be adjusted with the option --tabulate β scroll down for the deets on how to adjust it. π«Ά
On top of all that, dwlocstat also lets you dump DIEs matching certain criteria, like all inlined DIEs. She can similarly exclude such DIEs from consideration. That's configurable with --dump and --ignore respectively. Again, details on the supported classes are below. π
π OPTIONS π
--tabulate=START[:STEP][,...]β the tabulation script. It's a series of comma-separated stops. Each line of tabulation output captures the percentages that are above the previous stop and below or at the next stop. Each stop can be either an integer 0-100, or the special mark0.0, which denotes DIEs where no addresses at all are covered. And bestie, this is not the same as plain0β plain0also describes DIEs that are covered so poorly that the percentage rounds down to zero. (Percentages round down, just fyi. π)
Several regularly spaced stops can be abbreviated with the shorthand notation START:STEP. STEP is an integer 0-100.
The default tabulation script is 10:10, and the output of that is what we showed you up above. As an example: the tabulation script 0.0,10:10,99 would have two extra lines β one for sharp zero, one for 100%. That covers the cases that either have no coverage at all, or are covered fully. slay.
--ignore=CLASS[,...]β DIEs that match the classes passed in this comma-separated list are not included in the analysis. The following classes are recognized:single_addrβ DIEs whose location expression is a soleDW_OP_addroperand. Those are generally global and static variables.artificialβ DIEs with the attributeDW_AT_artificial.inlinedβ DIEs with the attributeDW_AT_inline, or children of such a DIE.inlined_subroutineβ DIEs that areDW_TAG_inlined_subroutine, inlined (in the above sense) DIEs that areDW_TAG_subprogram, or children of such DIEs.no_coverageβ DIEs with coverage of0.0(see above).implicit_pointerβ DIEs that useDW_OP_GNU_implicit_pointer.immutableβ DIEs whose location expression describes an immutable object. Location expressions that don't useDW_OP_implicit_value,DW_OP_stack_valueare immutable.mutableβ DIEs whose location expression is not immutable. Note that a DIE can be both mutable and immutable. When the location expression is complex (usesDW_OP_bit_pieceorDW_OP_piece), each part can have a different mutability. Furthermore, if the full analysis ofDW_OP_GNU_implicit_pointeris disabled, the DIEs that use that operator are considered both mutable and immutable. it's giving both, and honestly? valid. π
--dump=CLASS[,...]β this shows references to DIEs (including the full path from the root of the CU) that match the classes passed in the argument. The possible classes and their meanings are the same as with the--ignoreoption. same energy, different verb. β¨--ignore-implicit-pointerβ when a location expression uses the operatorDW_OP_GNU_implicit_pointer, it gets handled a little differently. When an expression is encountered that uses this operator, and no other expression covers the address under consideration, that address is not counted as covered. Instead, the program checks whether the location expression at the DIE referenced by this operator covers this address. With this option,dwlocstatwill instead consider such addresses covered. choose your fighter, bestie.-p,--show-progressβ show each CU DIE as the file is processed. main character energy for every compilation unit. π
πΈ AUTHOR πΈ
Written by Petr Machata <pmachata@redhat.com>. we stan a legend. π«Ά
π REPORTING BUGS π
Report dwlocstat bugs to <https://github.com/pmachata/dwlocstat/issues> or by mail to <pmachata@redhat.com>. Found a bug? Tell her directly, she wants to hear it, fr fr. π
π COPYRIGHT π
Copyright Β© 2012 Red Hat, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
Portions are licensed under LGPLv3+: GNU LGPL version 3 or later <http://gnu.org/licenses/lgpl.html>.
π SEE ALSO π
and that's the whole page bestie π this is dwlocstat(1) from the General Commands Manual β the footer is literally just dwlocstat(1) again, no date drama, no version drama, we keep it simple. mwah. πβ¨
π¦ where this page comes from
- fedora 43: dwlocstat 0.1-0.32.20121105gitc55cb50.fc43 Β· GPL-3.0-or-later AND LGPL-3.0-or-later
- fedora 44: dwlocstat 0.1-0.33.20121105gitc55cb50.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later
- Copyright (C) 2010, 2011, 2012 Red Hat, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms