Re:?==?utf-8?q? [PATCH]?==?utf-8?q? D65585: WIP:?==?utf-8?q? [llvm-locstats] Add the llvm-locstats tool

Djordje Todorovic via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 1 10:25:46 PDT 2019


Hi David,

Thanks for the comment.

I agree that the llvm-dwarfdump already has similar stats, but maybe it is worth of having a tool (maybe this can exist like a llvm-dwarfdump subtool) that reports some kind of verbose output and calculation on the debug location generated. If we want to have some observation only on the location list we can just add a new option to the subtool (i.e. the one for ignoring entry values), rather then putting new fields in to the existing llvm-dwarfdump statistic.

Best regards,
Djordje
 
-------- Original Message -------- 
Subject: Re: [PATCH] D65585: WIP: [llvm-locstats] Add the llvm-locstats tool 
Date: Thursday, August 1, 2019 18:26 CEST 
From: David Blaikie <dblaikie at gmail.com> 
To: reviews+D65585+public+c79915da151b1549 at reviews.llvm.org 
CC: djordje.todorovic at rt-rk.com, Adrian Prantl <aprantl at apple.com>, 	Vedant Kumar <vsk at apple.com>, Michał Górny <mgorny at gentoo.org>, 	llvm-commits <llvm-commits at lists.llvm.org>, Paul Robinson <paul.robinson at sony.com>, 	David Stenberg <david.stenberg at ericsson.com>, nikola.prica at rt-rk.com, asowda at cisco.com, 	petar.jovanovic at mips.com, Fangrui Song <maskray at google.com>, yuanfang.chen at sony.com, 	Eric Christopher <echristo at gmail.com>, Reid Kleckner <rnk at google.com>, 	Jonas Devlieghere <jonas at devlieghere.com>, orlando.hyams at sony.com, 	Mikael Holmén <mikael.holmen at ericsson.com>, 	Jeremy Morse <jeremy.morse.llvm at gmail.com>, chirag at raincode.com, cHackz0x12 at gmail.com, 	mattias.v.eriksson at ericsson.com, 	Bjorn Pettersson <bjorn.a.pettersson at ericsson.com>, Son Tuan VU <sontuan.vu119 at gmail.com>, 	Carlos Alberto Enciso <international.phantom at gmail.com>, ewan at codeplay.com, jun.l at samsung.com
References: <differential-rev-PHID-DREV-blbq6rsasausmevevs34-req at reviews.llvm.org>
 
 
 
> Sounds a lot like the existing statistics support in llvm-dwarfdump. Might
> be worth comparing/contrasting the two to understand the purpose of this
> new thing? (and/or integrate the functionality you'd like into the existing
> llvm-dwarfdump statistics support)
> 
> On Thu, Aug 1, 2019 at 9:07 AM Djordje Todorovic via Phabricator <
> reviews at reviews.llvm.org> wrote:
> 
> > djtodoro created this revision.
> > djtodoro added reviewers: aprantl, vsk.
> > djtodoro added a project: debug-info.
> > Herald added subscribers: llvm-commits, mgorny.
> > Herald added a project: LLVM.
> >
> > As we discussed, I am sharing the patch that introduces the llvm-locstats
> > tool.
> >
> > (I am copying the summary from the README from
> > https://github.com/djolertrk/llvm-locstats).
> >
> > This tool calculates and reports verbose output for the debug location
> > coverage of a binary.
> >
> > It is very similar to a tool (locstats) from the Elfutils package, but the
> > tool is not being maintained and released for a long time.
> >
> > The llvm-locstats for each variable or formal parameter DIE computes what
> > percentage from the code section bytes, where it is in scope, it has
> > location description. There are options to ignore inlined instances or/and
> > entry value locations. The line 0 shows the number (and the percentage) of
> > DIEs with no location information, but the line 100 shows the number (and
> > the percentage) of DIEs where there is location information in all code
> > section bytes (where the variable or parameter is in the scope). The line
> > 51..59 shows the number (and the percentage) of DIEs where the location
> > information is in between 51 and 59 percentage of its scope covered.
> > ...
> > **Using the tool**
> >
> > Running the tool on a simple test case:
> > bin/llvm-locstats test
> >
> >   =================================================
> >             Debug Location Statistics
> >   =================================================
> >     cov%          samples       percentage
> >   -------------------------------------------------
> >       0                1              25%
> >       1..9             0               0%
> >       11..19           0               0%
> >       21..29           0               0%
> >       31..39           0               0%
> >       41..49           0               0%
> >       51..59           0               0%
> >       61..69           0               0%
> >       71..79           0               0%
> >       81..89           0               0%
> >       91..99           0               0%
> >       100              3              75%
> >   =================================================
> >     -the number of debug variables processed: 4
> >     -the average coverage per var: ~ 75%
> >   =================================================
> >
> > //Running the tool on the GDB 7.11 binary://
> > bin/llvm-locstats gdb
> >
> >   =================================================
> >             Debug Location Statistics
> >   =================================================
> >     cov%          samples       percentage
> >   -------------------------------------------------
> >       0             8495               8%
> >       1..9          3037               3%
> >       11..19        3015               3%
> >       21..29        2769               2%
> >       31..39        2802               2%
> >       41..49        2766               2%
> >       51..59        3141               3%
> >       61..69        3173               3%
> >       71..79        3923               3%
> >       81..89        4948               5%
> >       91..99        7354               7%
> >       100          53433              54%
> >   =================================================
> >     -the number of debug variables processed: 98856
> >     -the average coverage per var: ~ 76%
> >   =================================================
> >
> > //Running the tool on the GDB 7.11 binary by ignoring debug entry values://
> > bin/llvm-locstats --ignore-entry-values gdb
> >
> >   =================================================
> >             Debug Location Statistics
> >   =================================================
> >     cov%          samples       percentage
> >   -------------------------------------------------
> >       0             8765               8%
> >       1..9          3948               3%
> >       11..19        4436               4%
> >       21..29        4152               4%
> >       31..39        4107               4%
> >       41..49        3846               3%
> >       51..59        4490               4%
> >       61..69        4140               4%
> >       71..79        4998               5%
> >       81..89        7072               7%
> >       91..99       15478              15%
> >       100          33424              33%
> >   =================================================
> >     -the number of debug variables processed: 98856
> >     -the average coverage per var: ~ 69%
> >   =================================================
> >
> >
> > https://reviews.llvm.org/D65585
> >
> > Files:
> >   llvm/tools/llvm-locstats/CMakeLists.txt
> >   llvm/tools/llvm-locstats/LLVMBuild.txt
> >   llvm/tools/llvm-locstats/llvm-locstats.cpp
> >
> >
 
 



More information about the llvm-commits mailing list