<html 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;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">It has been on by default for  -g -O builds in GCC for many years. I see @entry values in backtraces for GCC compiled code with very old GCC 4.7.<o:p></o:p></p>
<p class="MsoNormal">Internally in Cisco, we have enabled this feature in LLVM for Cisco code compilation  for more than a year now.<o:p></o:p></p>
<p class="MsoNormal">-Ananth<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:12.0pt;color:black">From: </span></b><span style="font-size:12.0pt;color:black"><aprantl@apple.com> on behalf of Adrian Prantl <aprantl@apple.com><br>
<b>Date: </b>Friday, February 7, 2020 at 12:23 PM<br>
<b>To: </b>Vedant Kumar <vedant_kumar@apple.com><br>
<b>Cc: </b>"llvm-dev@lists.llvm.org" <llvm-dev@lists.llvm.org>, "nikola.prica@rt-rk.com" <nikola.prica@rt-rk.com>, "Ivan Baev (ibaev)" <ibaev@cisco.com>, "Ananthakrishna Sowda (asowda)" <asowda@cisco.com>, David Blaikie <dblaikie@gmail.com>, David Stenberg
 <david.stenberg@ericsson.com>, Jeremy Morse <jeremy.morse.llvm@gmail.com>, Frédéric Riss <friss@apple.com>, Eric Christopher <echristo@gmail.com>, Paul Robinson <paul.robinson@sony.com><br>
<b>Subject: </b>Re: [llvm-dev] Enabling debug entry value production by default<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal">This would only be enabled when optimizations are enabled, correct?
<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">For GDB and LLDB debug info tuning mode, this sounds good to me. I don't know if, e.g., the Sony debugger supports entry values. Out of curiosity, does anyone know if GCC enable entry values by default?<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">-- adrian<o:p></o:p></p>
<div>
<p class="MsoNormal"><br>
<br>
<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal">On Feb 7, 2020, at 12:09 PM, Vedant Kumar <<a href="mailto:vedant_kumar@apple.com">vedant_kumar@apple.com</a>> wrote:<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">(trying to add back folks dropped by Mail.app...) <o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">+ David Blaikie, David Stenberg, Adrian, Jeremy, and Fred<o:p></o:p></p>
<div>
<p class="MsoNormal"><br>
<br>
<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal">On Feb 7, 2020, at 12:04 PM, Vedant Kumar via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<div>
<p class="MsoNormal">Hi all,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I think we've reached a state where we're ready to enable debug entry value production by default for the x86_64, ARM, and AArch64 targets. For context, this is a debug info feature that allows debuggers to recover the value of unmodified
 optimized-out parameters by 'going up' a stack frame and interpreting spilled values, constants, etc. to work out what was passed to the callee. There's a nice write-up about the impact of this feature in [3]. A big thank you to all of contributors who've
 helped us get here (I've tried to CC everyone, sincere apologies if I've accidentally left you out).<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I believe Djordje and I have shown that there isn't an outsized binary size or compile time impact of enabling this feature. The aggregate size of DWARF in a stage2 x86_64 RelWithDebInfo clang build grows by under 0.2%, and we didn't find
 a significant compile time impact. We've shared CTMark results (both compile-time & DWARF section size numbers), as well as a size analysis of stage2 builds of {llc, clang, lldb} in [1].<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Djordje has also shared a nice location statistics comparison chart in [1], showing increased variable availability with entry values enabled.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">For my part, I instrumented lldb's DWARFExpression::Evaluate method to log instances in which a variable location is unavailable. I then used a script [4] to single-step through a stage2 RelWithDebInfo+entryvals clang binary as it was compiling
 sqlite3.c, printing local variables at each stop. Without entry values, lldb reported "variable not available" 883,918 times. With entry values lldb reported "variable not available" 687,899 times (a 22% drop).<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Does anyone have concerns about enabling this feature?<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">thanks,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">vedant<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">[1] <a href="https://reviews.llvm.org/D73534">[DebugInfo] Enable the debug entry values feature by default</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">[2] <a href="https://reviews.llvm.org/D73700">[CallSiteInfo] Fix the assertions regarding updating the CallSiteInfo</a>, <a href="https://reviews.llvm.org/D74122">[CallSiteInfo] Use the isCandidateForCallSiteEntry() when update the cs info</a><o:p></o:p></p>
</div>
<p class="MsoNormal">[3] <a href="https://robert.ocallahan.org/2018/11/comparing-quality-of-debug-information.html">
https://robert.ocallahan.org/2018/11/comparing-quality-of-debug-information.html</a>
<o:p></o:p></p>
<div>
<p class="MsoNormal">[4] <a href="https://gist.github.com/vedantk/7602b20a9e1d44c42d32dcca36591cc0">https://gist.github.com/vedantk/7602b20a9e1d44c42d32dcca36591cc0</a><o:p></o:p></p>
</div>
</div>
<p class="MsoNormal">_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><o:p></o:p></p>
</div>
</blockquote>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</body>
</html>