<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 24, 2014 at 2:48 PM, Diego Novillo <span dir="ltr"><<a href="mailto:dnovillo@google.com" target="_blank">dnovillo@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">I'm not sure if this was intended, but it's going to be a problem for sample profiles.<div><br></div><div>When we compile with -gmlt, the profiler expects to find the line number for all the function headers so that it can compute relative line locations for the profile.</div><div><br></div><div>The tool that reads the ELF binary is not finding them, so it writes out absolute line numbers, which are impossible to match during the profile-use phase.</div><div><br></div><div>The problem seems to be that we are missing DW_TAG_subprogram for all the functions in the file.</div><div><br></div><div>Attached are the dwarf dumps of the same program. One compiled with my system's clang 3.4 and the other with today's trunk. In both compiles, I used -gline-tables-only.</div><div><br></div><div>The trunk version is missing all the subprogram tags for the functions in the file. This breaks the sample profiler.</div><div><br></div><div>Should I file a bug, or is -gmlt going to be like this from now on? The latter would be a problem for us.</div></blockquote><div><br>Open to negotiation, but this change is intentional ( for details, see the commit: <a href="http://llvm.org/viewvc/llvm-project?rev=218129&view=rev">http://llvm.org/viewvc/llvm-project?rev=218129&view=rev</a> ).<br><br>Even when a subprogram does have inlined subroutines, I've omited the line/file as well, to reduce -gmlt size (actually, I imagine we could even remove the top level subroutines entirely - just emitting the inlined subroutines at the top level - completely garbage DWARF, but it would be smaller & easy enough to teach symbolizers to deal with that if they don't already)<br><br>To be honest, optimized -gmlt is still pretty big, but these changes do make unoptimized -gmlt essentially no cost over the line table itself, which is nice. A longer term approach to solving this is two-level-line-tables, but they would probably present a problem for the algorithm you've described too.<br><br>- David<br> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><br></div><div><br></div><div>Thanks. Diego.</div><div><br></div>
</blockquote></div><br></div></div>