<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"Book Antiqua";
panose-1:2 4 6 2 5 3 5 3 3 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p
{mso-style-priority:99;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
span.m5060004228053837857im
{mso-style-name:m_5060004228053837857im;}
span.EmailStyle19
{mso-style-type:personal-reply;
font-family:"Book Antiqua",serif;
color:#943634;
font-weight:normal;
font-style:normal;
text-decoration:none none;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-IE link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-family:"Book Antiqua",serif;color:#943634;mso-fareast-language:EN-US'>Perfect, thanks David, this is exactly the kind of information I need.<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua",serif;color:#943634;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua",serif;color:#943634;mso-fareast-language:EN-US'>Is this stated anywhere in the documentation? I have not been able to find such an explanation. I am also not getting unresolved symbols for ‘</span><span style='font-family:"Courier New";color:black;mso-fareast-language:EN-US'>__start___llvm_prf_<<i>name</i>></span><span style='font-family:"Book Antiqua",serif;color:#943634;mso-fareast-language:EN-US'>’ or ‘</span><span style='font-family:"Courier New";color:black;mso-fareast-language:EN-US'>__stop___llvm_prf_<<i>name</i>></span><span style='font-family:"Book Antiqua",serif;color:#943634;mso-fareast-language:EN-US'>’ - does the library use “weak” references to these? How does ‘</span><span style='font-family:"Courier New";color:black;mso-fareast-language:EN-US'>llvm-profdata</span><span style='font-family:"Book Antiqua",serif;color:#943634;mso-fareast-language:EN-US'>’ locate the ELF file for the program when it only has ‘</span><span style='font-family:"Courier New";color:black;mso-fareast-language:EN-US'>default.profraw</span><span style='font-family:"Book Antiqua",serif;color:#943634;mso-fareast-language:EN-US'>’ as input? on an embedded system with no file-system “paths” don’t make a lot of sense.<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua",serif;color:#943634;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua",serif;color:#943634;mso-fareast-language:EN-US'>My guess is that the profile library is not really used much by embedded targets, nor indeed the other instrumentation libraries.<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua",serif;color:#943634;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua",serif;color:#943634;mso-fareast-language:EN-US'>Thanks again for your help and I will define these symbols during linking and let you know how things pan out.<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua",serif;color:#943634;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua",serif;color:#943634;mso-fareast-language:EN-US'> MartinO<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua",serif;color:#943634;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><b><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif'>From:</span></b><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif'> Xinliang David Li [mailto:xinliangli@gmail.com] <br><b>Sent:</b> 25 July 2017 17:32<br><b>To:</b> Martin J. O'Riordan <MartinO@theheart.ie><br><b>Cc:</b> llvm-dev <llvm-dev@lists.llvm.org><br><b>Subject:</b> Re: [llvm-dev] PGO, zlib and 'default.profraw'<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>The order of those sections in memory does not matter. What needed is a way to tell the profile runtime where to find the start and end of the sections. On Linux, the linker defines symbols __start_<section_name> and __stop_<section_name>. If your linker does not do that, you can use linker script to provide the start and end:<o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><div><div><p class=MsoNormal> __start___llvm_prf_data = ADDR(__llvm_prf_data);<o:p></o:p></p></div><div><p class=MsoNormal> __start___llvm_prf_data = ADDR(__llvm_prf_data) + SIZEOF(__llvm_prf_data);<o:p></o:p></p></div><div><p class=MsoNormal>...<o:p></o:p></p></div></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>David<o:p></o:p></p></div></div><div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>On Tue, Jul 25, 2017 at 1:04 AM, Martin J. O'Riordan <<a href="mailto:MartinO@theheart.ie" target="_blank">MartinO@theheart.ie</a>> wrote:<o:p></o:p></p><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm'><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-family:"Book Antiqua",serif;color:black'>Hi David,</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-family:"Book Antiqua",serif;color:black'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-family:"Book Antiqua",serif;color:black'>When I use CMake to configure, ‘</span><span style='font-family:"Courier New";color:black'>zlib</span><span style='font-family:"Book Antiqua",serif;color:black'>’ and its header are detected - I build on CentOS 6.5 or CentOS 7. Since I run CMake from the command-line, I tried added ‘</span><span style='font-family:"Courier New";color:black'>-DLLVM_ENABLE_ZLIB=0</span><span style='font-family:"Book Antiqua",serif;color:black'>’ and ‘</span><span style='font-family:"Courier New";color:black'>-DLLVM_ENABLE_ZLIB=1</span><span style='font-family:"Book Antiqua",serif;color:black'>’ (using ‘</span><span style='font-family:"Courier New";color:black'>-DLLVM_ENABLE_ZLIB=ON</span><span style='font-family:"Book Antiqua",serif;color:black'>’ does not seem to work). Both ‘</span><span style='font-family:"Courier New";color:black'>clang</span><span style='font-family:"Book Antiqua",serif;color:black'>’ and ‘</span><span style='font-family:"Courier New";color:black'>llvm-profdata</span><span style='font-family:"Book Antiqua",serif;color:black'>’ (and all other tools and utilities) are configured and built together, in any event, they are both built with ‘</span><span style='font-family:"Courier New";color:black'>zlib</span><span style='font-family:"Book Antiqua",serif;color:black'>’ enabled or ‘</span><span style='font-family:"Courier New";color:black'>zlib</span><span style='font-family:"Book Antiqua",serif;color:black'>’ disabled.</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-family:"Book Antiqua",serif;color:black'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-family:"Book Antiqua",serif;color:black'>On Windows with VS2015 there is no ‘</span><span style='font-family:"Courier New";color:black'>zlib</span><span style='font-family:"Book Antiqua",serif;color:black'>’.</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-family:"Book Antiqua",serif;color:black'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-family:"Book Antiqua",serif;color:black'>But I think that there is something different causing the problem, possibly in the linking. When profiling instrumentation is enabled, there are 4 new sections introduced:</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt'><span style='font-family:"Courier New";color:black'>__llvm_prf_cnts</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt'><span style='font-family:"Courier New";color:black'>__llvm_prf_data</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt'><span style='font-family:"Courier New";color:black'>__llvm_prf_names</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt'><span style='font-family:"Courier New";color:black'>__llvm_prf_vnds</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-family:"Book Antiqua",serif;color:black'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-family:"Book Antiqua",serif;color:black'>Since our target is an heterogeneous multi-core embedded system, it requires the use of some elaborate linking techniques, and the LD scripts are carefully crafted for this purpose. We use ‘</span><span style='font-family:"Courier New";color:black'>ld</span><span style='font-family:"Book Antiqua",serif;color:black'>’ from Binutils v2.28. However, I do not know what these new sections mean to ‘</span><span style='font-family:"Courier New";color:black'>llvm-profdata</span><span style='font-family:"Book Antiqua",serif;color:black'>’ or how they should be laid out. I cannot find any reference to these sections in any of the in-tree targets for Binutils or for LLVM-LLD, so there is no guidance or examples on how they should be collated and ordered, or how they should be placed in the memory-map.</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-family:"Book Antiqua",serif;color:black'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-family:"Book Antiqua",serif;color:black'>What I did is added a very simple line to my existing LD script’s rule for collating ‘</span><span style='font-family:"Courier New";color:black'>.data</span><span style='font-family:"Book Antiqua",serif;color:black'>’ as:</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt'><span style='font-family:"Courier New";color:black'>SECTIONS</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt'><span style='font-family:"Courier New";color:black'>{</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt'><span style='font-family:"Courier New";color:black'> ...</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt'><span style='font-family:"Courier New";color:black'> .data:</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt'><span style='font-family:"Courier New";color:black'> {</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt'><span style='font-family:"Courier New";color:black'> ...</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt'><span style='font-family:"Courier New";color:black'> *(__llvm_prf_*)</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt'><span style='font-family:"Courier New";color:black'> ...</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt'><span style='font-family:"Courier New";color:black'> }</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt'><span style='font-family:"Courier New";color:black'> ...</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt'><span style='font-family:"Courier New";color:black'>}</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-family:"Book Antiqua",serif;color:black'>I’m guessing that this is too naïve and simplistic, and that something else is required, but I can’t find any sample LD scripts in either the LLD (v5.0) or Binutils (v2.28) sources. I was considering replacing the line:</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt'><span style='font-family:"Courier New";color:black'>*(__llvm_prf_*)</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-family:"Book Antiqua",serif;color:black'>with:</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt'><span style='font-family:"Courier New";color:black'>*(__llvm_prf_cnts)</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt'><span style='font-family:"Courier New";color:black'>*(__llvm_prf_data)</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt'><span style='font-family:"Courier New";color:black'>*(__llvm_prf_names)</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt'><span style='font-family:"Courier New";color:black'>*(__llvm_prf_vnds)</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-family:"Book Antiqua",serif;color:black'>but without knowing what is required, this is still just a wild guess.</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-family:"Book Antiqua",serif;color:black'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-family:"Book Antiqua",serif;color:black'>Any thoughts or recommendations on how these sections should be linked, and whether they need any special “</span><span style='font-family:"Courier New";color:black'>PROVIDE</span><span style='font-family:"Book Antiqua",serif;color:black'>” declarations? Or “</span><span style='font-family:"Courier New";color:black'>SORT</span><span style='font-family:"Book Antiqua",serif;color:black'>” clauses?</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-family:"Book Antiqua",serif;color:black'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-family:"Book Antiqua",serif;color:black'>Thanks,</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-family:"Book Antiqua",serif;color:black'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-family:"Book Antiqua",serif;color:black'> MartinO</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-family:"Book Antiqua",serif;color:black'> </span><o:p></o:p></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif'>From:</span></b><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif'> Martin J. O'Riordan [mailto:<a href="mailto:MartinO@theheart.ie" target="_blank">MartinO@theheart.ie</a>] <br><b>Sent:</b> 19 July 2017 15:56<br><b>To:</b> Xinliang David Li <<a href="mailto:xinliangli@gmail.com" target="_blank">xinliangli@gmail.com</a>><br><b>Cc:</b> llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>><br><b>Subject:</b> RE: [llvm-dev] PGO, zlib and 'default.profraw'</span><o:p></o:p></p></div></div><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-family:"Book Antiqua",serif'>Thanks. Yes, I build ‘clang’ and all the other tools and utilities together, so I am surprised that ‘clang’ would have ‘zlib’ enabled but not ‘llvm-profdata’. I will get back to this when I return on Monday, and I have a suspicion I may be doing something else wrong that I will formulate and ask next week.</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-family:"Book Antiqua",serif'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-family:"Book Antiqua",serif'>Thanks for your help,</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-family:"Book Antiqua",serif'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-family:"Book Antiqua",serif'> MartinO</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-family:"Book Antiqua",serif'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><a name="m_5060004228053837857______replyseparato"></a><b><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif'>From:</span></b><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif'> llvm-dev [<a href="mailto:llvm-dev-bounces@lists.llvm.org" target="_blank">mailto:llvm-dev-bounces@lists.llvm.org</a>] <b>On Behalf Of </b>Xinliang David Li via llvm-dev<br><b>Sent:</b> Tuesday, July 18, 2017 10:41 PM<br><b>To:</b> Martin J. O'Riordan <<a href="mailto:MartinO@theheart.ie" target="_blank">MartinO@theheart.ie</a>><br><b>Cc:</b> LLVM Developers <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>><br><b>Subject:</b> Re: [llvm-dev] PGO, zlib and 'default.profraw'</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>set LLVM_ENABLE_ZLIB=ON with cmake invocation. zlib should be installed and zlib.h header file needs to be in the header search path.<o:p></o:p></p><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Is your llvm-profdata tool built together with clang? <o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>David<o:p></o:p></p></div></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>On Tue, Jul 18, 2017 at 1:04 PM, Martin J. O'Riordan via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<o:p></o:p></p><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt'><p class=MsoNormal style='mso-margin-top-alt:auto;margin-bottom:12.0pt'>How can I build the profile reader with ZLIB support enabled? I configure and build all the tools together with 'clang', so I would have expected that all or none support ZLIB, or is this a cross-compiler configuration specific issue?<br><br>Thanks,<br><br> MartinO<br><br><span class=m5060004228053837857im>-----Original Message-----</span><br><span class=m5060004228053837857im>From: llvm-dev [mailto:<a href="mailto:llvm-dev-bounces@lists.llvm.org" target="_blank">llvm-dev-bounces@lists.llvm.org</a>] On Behalf Of Justin Bogner via llvm-dev</span><br><span class=m5060004228053837857im>Sent: 18 July 2017 19:37</span><br><span class=m5060004228053837857im>To: Xinliang David Li via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span><br><span class=m5060004228053837857im>Subject: Re: [llvm-dev] PGO, zlib and 'default.profraw'</span><o:p></o:p></p><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Can we improve the error message here? We should be able to check zlib::isAvailable and give an error like "profile uses zlib compression but the profile reader was built without zlib support" or so in this case.<br><br>Xinliang David Li via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> writes:<br>> The __llvm_prf_names section is compressed but your llvm-profdata tool<br>> is probably not built with zlib enabled.<br>><br>> To disable compression, use option -mllvm<span style='color:#943634'> </span>-enable-name-compression=false<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:black'>> </span>in your instrumentation build.<br>><br>> David<br>><br>> On Tue, Jul 18, 2017 at 7:05 AM, ORiordan, Martin via llvm-dev <<br>> <a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br>><br>>> We are trying to get PGO working for our embedded out-of-tree target,<br>>> but the utility ‘llvm-profdata’ does not like the data we are giving it.<br>>><br>>><br>>><br>>> Because this is not a hosted environment, we have to off-chip the<br>>> profiling data ourselves, and although the data looks okay, ‘llvm-profdata’<br>>> reports the following error:<br>>><br>>><br>>><br>>> *llvm-profdata show -all-functions -counts -detailed-summary -text<br>>> -static-func-full-module-prefix ~/Downloads/default.profraw*<br>>><br>>> error: ~/Downloads/default.profraw: Failed to uncompress data (zlib)<br>>><br>>><br>>><br>>> But even for a hosted system, it is not clear to me where ‘zlib’ gets<br>>> involved in compressing the data. The start of our data looks like:<br>>><br>>><br>>><br>>> *hexdump -C default.profraw*<br>>><br>>> 00000000 81 52 66 6f 72 70 6c ff 04 00 00 00 00 00 00<br>>><br>>> 00 |.Rforpl.........|<br>>><br>>> 00000010 3c 00 00 00 00 00 00 00 28 01 00 00 00 00 00<br>>><br>>> 00 |<.......(.......|<br>>><br>>><br>>><br>>> Which looks valid for Little-Endian, 32-bit and LLVM v4.0.<br>>><br>>><br>>><br>>> What do we need to do to prepare this raw data from the device into<br>>> the form that ‘llvm-profdata’ needs to see?<br>>><br>>><br>>><br>>> Thanks,<br>>><br>>><br>>><br>>> MartinO<br>>><br>>><br>>><br>>><br>>><br>>> --------------------------------------------------------------<br>>> Intel Research and Development Ireland Limited Registered in Ireland<br>>> Registered Office: Collinstown Industrial Park, Leixlip, County<br>>> Kildare Registered Number: 308263<br>>><br>>> This e-mail and any attachments may contain confidential material for<br>>> the sole use of the intended recipient(s). Any review or distribution<br>>> by others is strictly prohibited. If you are not the intended<br>>> recipient, please contact the sender and delete all copies.<br>>><br>>><br>>> _______________________________________________<br>>> LLVM Developers mailing list<br>>> <a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>>> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>>><br>>><br>> _______________________________________________<br>> LLVM Developers mailing list<br>> <a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>_______________________________________________<br>LLVM Developers mailing list<br><a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br><br>_______________________________________________<br>LLVM Developers mailing list<br><a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><o:p></o:p></p></div></div></blockquote></div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div><p>--------------------------------------------------------------<br>Intel Research and Development Ireland Limited<br>Registered in Ireland<br>Registered Office: Collinstown Industrial Park, Leixlip, County Kildare<br>Registered Number: 308263<o:p></o:p></p><p>This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.<o:p></o:p></p></div></div></div></div></blockquote></div><p class=MsoNormal><o:p> </o:p></p></div></div></body></html>