[SampleFDO] Expose an interface to return the size of a section or the size
authorWei Mi <wmi@google.com>
Fri, 20 Sep 2019 23:24:50 +0000 (23:24 +0000)
committerWei Mi <wmi@google.com>
Fri, 20 Sep 2019 23:24:50 +0000 (23:24 +0000)
commitf118852046a1d255ed8c65c6b5db320e8cea53a0
treeb35a22fbe1d944338582a4fe4a102de3654c2606
parent6c0894b58ac8cbf12383f18789ac5a161a18f141
[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.

llvm-svn: 372439
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