This is an archive of the discontinued LLVM Phabricator instance.

[llvm-profdata] Profile dump for compact binary format
ClosedPublic

Authored by wenlei on Jul 23 2019, 11:47 AM.

Details

Summary

Fix "llvm-profdata show" so it can work with compact binary format profile. The change is to mark all functions "used" so SampleProfileReaderCompactBinary::read will read in all profiles available for dumping. The function names will be MD5 hash for compact binary format.

Diff Detail

Repository
rL LLVM

Event Timeline

wenlei created this revision.Jul 23 2019, 11:47 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 23 2019, 11:47 AM
wmi added a comment.Jul 24 2019, 9:22 AM

Thanks for the patch.

llvm/include/llvm/ProfileData/SampleProfReader.h
284 ↗(On Diff #211344)

We may not need markAllFuncToUse. We can just set UseAllFuncs to False inside of collectFuncsToUse.

A related thing is that is it better to set UseAllFuncs to True by default and only set UseAllFuncs to False in collectFuncsToUse? The reason is we have some out-of-tree tools which needs to read profiles of all functions, so it will be easier for them by setting UseAllFuncs to True by default.

wenlei updated this revision to Diff 211571.Jul 24 2019, 11:24 AM

address feedback

wenlei marked an inline comment as done.Jul 24 2019, 11:29 AM
wenlei added inline comments.
llvm/include/llvm/ProfileData/SampleProfReader.h
284 ↗(On Diff #211344)

Thanks for the suggestion, Wei. Agreed it's better to have the flag default to true. Updated.

wmi accepted this revision.Jul 24 2019, 1:49 PM

LGTM. Thanks!

This revision is now accepted and ready to land.Jul 24 2019, 1:49 PM
This revision was automatically updated to reflect the committed changes.