Moshtaghi, Alireza
2015-May-20 01:20 UTC
[LLVMdev] why is coverage map and profile names mixed?
Hi I'm referencing the method: Lib/Transforms/Instrumentation/InstrProfiling.cpp:InstrProfiling::lowerCoverageData() At the end of the function, why is the variable being placed in __llvm_prf_names section? Shouldn't it be placed in __llvm_covmap section? Thanks Ali -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150520/0c2cab1d/attachment.html>
Justin Bogner
2015-May-20 04:50 UTC
[LLVMdev] why is coverage map and profile names mixed?
"Moshtaghi, Alireza" <Alireza.Moshtaghi at netapp.com> writes:> I’m referencing the method: Lib/Transforms/Instrumentation/ > InstrProfiling.cpp:InstrProfiling::lowerCoverageData() At the end of > the function, why is the variable being placed in __llvm_prf_names > section? Shouldn’t it be placed in __llvm_covmap section?All of the names that coverage references are in the __llvm_prf_names section today. This is shared with the profile data's references to names: since a coverage mapping without profile data isn't useful, it reasonable to expect these names are already there. The logic in lowerCoverageData moves any names that aren't found in the profile data into the __llvm_prf_names, where the names that were found are already expected to be. This is basically just a workaround for the fact that functions that aren't emitted may still have a coverage mapping, but there won't be any profile data for them.
Moshtaghi, Alireza
2015-May-20 19:48 UTC
[LLVMdev] why is coverage map and profile names mixed?
My problem is that the instrumented code gets too big and I need to strip the coverage mapping. Would it make any functional difference if I save these variables in __llvm_covmap? Thanks Ali On 5/19/15, 9:50 PM, "Justin Bogner" <mail at justinbogner.com> wrote:>"Moshtaghi, Alireza" <Alireza.Moshtaghi at netapp.com> writes: >> I¹m referencing the method: Lib/Transforms/Instrumentation/ >> InstrProfiling.cpp:InstrProfiling::lowerCoverageData() At the end of >> the function, why is the variable being placed in __llvm_prf_names >> section? Shouldn¹t it be placed in __llvm_covmap section? > >All of the names that coverage references are in the __llvm_prf_names >section today. This is shared with the profile data's references to >names: since a coverage mapping without profile data isn't useful, it >reasonable to expect these names are already there. > >The logic in lowerCoverageData moves any names that aren't found in the >profile data into the __llvm_prf_names, where the names that were found >are already expected to be. This is basically just a workaround for the >fact that functions that aren't emitted may still have a coverage >mapping, but there won't be any profile data for them.