Page MenuHomePhabricator

[llvm-dwarfdump] Add additional stats fields

Authored by djtodoro on Aug 21 2019, 5:06 AM.



The additional fields will be parsed by the llvm-locstats tool in order to produce more human readable output of the debug location quality generated.

Diff Detail


Event Timeline

djtodoro created this revision.Aug 21 2019, 5:06 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 21 2019, 5:06 AM
vsk added a comment.Aug 21 2019, 10:27 AM

Have you considered representing scope coverage using a map from decile to the number of variables in that decile? The map can contain two special keys for 0 and 100 if you'd like, and could be emitted as JSON directly. I expect that will simplify the code substantially (both here and in the locstats utility) and offer more granular reports.

@vsk Thanks for your comments!

I agree that a map will be good idea.
Since we agree this the right way to proceed with this, I will start cleaning and improving the code.

djtodoro updated this revision to Diff 217373.Aug 27 2019, 5:06 AM

-Use std::vector to map more debug location categories in order to have more granular reports

djtodoro updated this revision to Diff 217379.Aug 27 2019, 5:31 AM

-Refactor the LocationStats struct

djtodoro updated this revision to Diff 218062.Aug 30 2019, 3:22 AM

-Fix the location stats output

vsk added a comment.Sep 3 2019, 1:19 PM

Looks mostly good to me!

54 ↗(On Diff #218062)

Feel free to fix these spelling issues in a separate nfc commit right away.

154 ↗(On Diff #218062)

Please define and use a helper function to get the coverage bucket, given BytesCovered & BytesInScope.

djtodoro marked 2 inline comments as done.Sep 5 2019, 7:41 AM
djtodoro added inline comments.
54 ↗(On Diff #218062)

Sure. I have committed that with the rL370861.

djtodoro updated this revision to Diff 218919.Sep 5 2019, 7:43 AM
djtodoro retitled this revision from WIP: [llvm-dwarfdump] Add additional stats fields to [llvm-dwarfdump] Add additional stats fields.

-Define and use a lambda expression to get the coverage bucket

vsk accepted this revision.Sep 5 2019, 2:32 PM

Thanks, lgtm!

This revision is now accepted and ready to land.Sep 5 2019, 2:32 PM

@vsk Thanks a lot for the review!

This revision was automatically updated to reflect the committed changes.