<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 22, 2013 at 1:58 PM, Bob Wilson <span dir="ltr"><<a href="mailto:bob.wilson@apple.com" target="_blank" class="cremed">bob.wilson@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div id=":9ey" style="overflow:hidden">I really like GCC's -fprofile-generate and -fprofile-use, except I don't think we should reuse those names for something that works differently.  My overall preference would be something like this (using those names as placeholders):<br>

<br>
-fprofile-generate=<instrumentation-style><br>
-fprofile-use=<profile-style><br>
<br>
e.g., "-fprofile-use=auto".  That would at least unify the new options.  In fact, we may even be able to reuse those option names with -fprofile-use being a synonym for -fprofile-use=gcc, which matches gcc's option.  I'm not at all familiar with how that option actually works in gcc, so I can't say whether that would make sense.</div>
</blockquote></div><br>I don't think we can re-use '-fprofile-use' in a way different from GCC here. GCC accepts it as "-fprofile-use=/path/..." and i could call my profile file "auto" or "gcc" or "clang" and expect it to work.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">I think it is best for instrumentation-based profiling to use '-fprofile-generate' and '-fprofile-use' just like GCC does, if with different file formats, etc.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">I don't see in flags in upstream GCC regarding sample-driven profiling, but "auto" I think is actively harmful in the name. There is nothing intrinsically automatic about it. It is "external" in the sense that it isn't from compiled-in instrumentation, but I don't see any reason for "auto" to indicate that to the user.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">I think for now, we should put this functionality behind a specific flag whose name is indicative of the user's expected behavior. The best idea I've seen is "-fsample-profile=/path/..." but I'd love to hear better suggestions.</div>
</div>