<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi Oza,<div class=""><br class=""></div><div class="">The mechanics of the patch are clear. What's not clear to me is why dso-specific .profraw files are helpful for code coverage, since merged .profraw's should work just as well.</div><div class=""><br class=""></div><div class=""><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">Have you encountered issues using merged .profraws? </span>Could you clarify what's meant by backtracking and instrumenting [the] final binary?</div><div class=""><br class=""></div><div class="">thanks,</div><div class="">vedant<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Sep 22, 2021, at 9:36 PM, Oza, Hiral <<a href="mailto:Hiral.Oza@netapp.com" class="">Hiral.Oza@netapp.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta charset="UTF-8" class=""><div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Hello Vedant,<o:p class=""></o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">> could you share some of the use cases for this feature? > What were the pros/cons of any alternatives you considered (e.g. the %m/%c modes)?<o:p class=""></o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">We are taking coverage of shared libraries (i.e. Linux .so) and dumping coverage into files corresponding to SO’s filename.<o:p class=""></o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">With this proposed patch, will get coverage as below for sample code (pls refer<span class="Apple-converted-space"> </span><span class="diff-banner-path">compiler-rt/test/profile/Linux/</span><span class="diff-banner-file">instrprof-shared-nProfraws.test)</span>:<o:p class=""></o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; text-indent: 36pt;" class="">libhi.so -> will dump into libhi.so.profraw<o:p class=""></o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; text-indent: 36pt;" class="">libhello.so -> will dump into libhellp.so.profraw<o:p class=""></o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; text-indent: 36pt;" class="">main.out -> will dump into main.out.profraw<o:p class=""></o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Regarding ‘%m or %c: (from<span class="Apple-converted-space"> </span><a href="https://clang.llvm.org/docs/SourceBasedCodeCoverage.html" style="color: rgb(5, 99, 193); text-decoration: underline;" class="">https://clang.llvm.org/docs/SourceBasedCodeCoverage.html</a>): %m is expands instrumented binary’s signature (and with “%Nm” dumps into poll of N profraws) and %c seems very different from proposed “%n”.<o:p class=""></o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Basically with proposed patch (i.e. using “%n”) one can get one-to-one mapping of Shared Library and generated .profraw.<o:p class=""></o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">This makes backtracking and instrumenting final-binary based on feedback easy.<o:p class=""></o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Please let me know in case of further queries or any changes in proposed patch.<o:p class=""></o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="">Thank you.<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="">-Hiral<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div class=""><div style="border-style: solid none none; border-top-width: 1pt; border-top-color: rgb(225, 225, 225); padding: 3pt 0cm 0cm;" class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><b class=""><span lang="EN-US" class="">From:</span></b><span lang="EN-US" class=""><span class="Apple-converted-space"> </span>cfe-dev <<a href="mailto:cfe-dev-bounces@lists.llvm.org" style="color: rgb(5, 99, 193); text-decoration: underline;" class="">cfe-dev-bounces@lists.llvm.org</a>><span class="Apple-converted-space"> </span><b class="">On Behalf Of<span class="Apple-converted-space"> </span></b>Oza, Hiral via cfe-dev<br class=""><b class="">Sent:</b><span class="Apple-converted-space"> </span>Wednesday, 22 September, 2021 18:56<br class=""><b class="">To:</b><span class="Apple-converted-space"> </span><a href="mailto:cfe-dev@lists.llvm.org" style="color: rgb(5, 99, 193); text-decoration: underline;" class="">cfe-dev@lists.llvm.org</a>; llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" style="color: rgb(5, 99, 193); text-decoration: underline;" class="">llvm-dev@lists.llvm.org</a>><br class=""><b class="">Subject:</b><span class="Apple-converted-space"> </span>[cfe-dev] compiler-rt RFE to support creating profraw for each Shared Library<o:p class=""></o:p></span></div></div></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><table class="MsoNormalTable" border="1" cellspacing="0" cellpadding="0" align="left" width="200" style="width: 150pt; background-color: rgb(0, 103, 197);"><tbody class=""><tr class=""><td nowrap="" style="padding: 6pt;" class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><b class=""><span style="font-size: 10pt; font-family: Arial, sans-serif; color: yellow;" class="">NetApp Security WARNING</span></b><span style="font-size: 10pt; font-family: Arial, sans-serif; color: yellow;" class="">: This is an external email. Do not click links or open attachments unless you recognize the sender and know the content is safe.</span><span class=""><o:p class=""></o:p></span></div></td></tr></tbody></table><p class="MsoNormal" style="margin: 0cm 0cm 12pt; font-size: 11pt; font-family: Calibri, sans-serif;"><span style="" class=""><br class=""><br class=""></span><span class=""><o:p class=""></o:p></span></p><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Greetings!<o:p class=""></o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Please review our patch compiler-rt RFE patch here --<span class="Apple-converted-space"> </span><a href="https://reviews.llvm.org/D110232" style="color: rgb(5, 99, 193); text-decoration: underline;" class="">https://reviews.llvm.org/D110232</a><o:p class=""></o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">This patch is about creating profraw for each Shared Library.<o:p class=""></o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><patch_info><o:p class=""></o:p></div><pre style="margin: 0cm; font-size: 10pt; font-family: "Courier New";" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif;" class="">SBCC RFE: Support SBCC for Shared Library<o:p class=""></o:p></span></pre><pre style="margin: 0cm; font-size: 10pt; font-family: "Courier New";" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></span></pre><pre style="margin: 0cm; font-size: 10pt; font-family: "Courier New";" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif;" class="">SBCC RFE: Support SBCC for Shared Library<o:p class=""></o:p></span></pre><pre style="margin: 0cm; font-size: 10pt; font-family: "Courier New";" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif;" class="">Using '%n' format parameter for profile name templates, to insert the full<o:p class=""></o:p></span></pre><pre style="margin: 0cm; font-size: 10pt; font-family: "Courier New";" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif;" class="">path of the current shared object into profile file names.<o:p class=""></o:p></span></pre><pre style="margin: 0cm; font-size: 10pt; font-family: "Courier New";" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></span></pre><pre style="margin: 0cm; font-size: 10pt; font-family: "Courier New";" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif;" class="">Internally using a linked list to gather all profile dumping functions<o:p class=""></o:p></span></pre><pre style="margin: 0cm; font-size: 10pt; font-family: "Courier New";" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif;" class="">(there is one defined in each shared object) so they can be invoked with a<o:p class=""></o:p></span></pre><pre style="margin: 0cm; font-size: 10pt; font-family: "Courier New";" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif;" class="">single function call. Ensure the resulting directory paths are created<o:p class=""></o:p></span></pre><pre style="margin: 0cm; font-size: 10pt; font-family: "Courier New";" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif;" class="">prior to dumping.<o:p class=""></o:p></span></pre><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""></patch_info><o:p class=""></o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Thank you in advance for your kind review.<o:p class=""></o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">-Hiral</div></div></div></div></blockquote></div><br class=""></div></body></html>