Recommit [SampleFDO] Expose an interface to return the size of a section
authorWei Mi <wmi@google.com>
Sat, 21 Sep 2019 17:23:55 +0000 (17:23 +0000)
committerWei Mi <wmi@google.com>
Sat, 21 Sep 2019 17:23:55 +0000 (17:23 +0000)
commiteee532cd5f908f1ade1752781ce82abbde74047b
treedc525782242ce8f6917ad7f36f252ea34f2dfd5b
parent63f6066b53d5094945fc47f382480290520b1605
Recommit [SampleFDO] Expose an interface to return the size of a section
or the size of the profile for profile in ExtBinary format.

Fix a test failure on Mac.

[SampleFDO] Expose an interface to return the size of a section or the
size of the profile for profile in ExtBinary format.

Sometimes we want to limit the size of the profile by stripping some functions
with low sample count or by stripping some function names with small text size
from profile symbol list. That requires the profile reader to have the
interfaces returning the size of a section or the size of total profile. The
patch add those interfaces.

At the same time, add some dump facility to show the size of each section.

Differential revision: https://reviews.llvm.org/D67726

llvm-svn: 372478
llvm/include/llvm/ProfileData/SampleProf.h
llvm/include/llvm/ProfileData/SampleProfReader.h
llvm/lib/ProfileData/SampleProfReader.cpp
llvm/test/tools/llvm-profdata/show-prof-size.test [new file with mode: 0644]
llvm/tools/llvm-profdata/llvm-profdata.cpp