<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Oct 22, 2013 at 2:28 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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Tue, Oct 22, 2013 at 5:06 PM, Chandler Carruth <<a href="mailto:chandlerc@google.com">chandlerc@google.com</a>> wrote:<br>

><br>
> On Tue, Oct 22, 2013 at 1:58 PM, Bob Wilson <<a href="mailto:bob.wilson@apple.com">bob.wilson@apple.com</a>> wrote:<br>
>><br>
>> I really like GCC's -fprofile-generate and -fprofile-use, except I don't<br>
>> think we should reuse those names for something that works differently.  My<br>
>> overall preference would be something like this (using those names as<br>
>> 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.<br>
>> In fact, we may even be able to reuse those option names with -fprofile-use<br>
>> being a synonym for -fprofile-use=gcc, which matches gcc's option.  I'm not<br>
>> at all familiar with how that option actually works in gcc, so I can't say<br>
>> whether that would make sense.<br>
><br>
><br>
> I don't think we can re-use '-fprofile-use' in a way different from GCC<br>
> here. GCC accepts it as "-fprofile-use=/path/..." and i could call my<br>
> profile file "auto" or "gcc" or "clang" and expect it to work.<br>
><br>
> I think it is best for instrumentation-based profiling to use<br>
> '-fprofile-generate' and '-fprofile-use' just like GCC does, if with<br>
> different file formats, etc.<br>
<br>
</div>Agreed.<br>
<div class="im"><br>
> I don't see in flags in upstream GCC regarding sample-driven profiling, but<br>
> "auto" I think is actively harmful in the name. There is nothing<br>
> intrinsically automatic about it. It is "external" in the sense that it<br>
> isn't from compiled-in instrumentation, but I don't see any reason for<br>
> "auto" to indicate that to the user.<br>
<br>
</div>GCC (well the Google branch now) uses -fauto-profile for the<br>
sample-driven profiling. The external profiler actually generates a<br>
gcov file.  The two options -fprofile-generate and -fprofile-use are<br>
strictly for instrumentation based profiling.  Our internal users are<br>
already using -fauto-profile in their builds.<br>
<br>
Dehao (CCd) tells me that the option was initially named<br>
-fsample-profile, but they then renamed it to -fauto-profile.<br>
<div class="im"><br>
> I think for now, we should put this functionality behind a specific flag<br>
> whose name is indicative of the user's expected behavior. The best idea I've<br>
> seen is "-fsample-profile=/path/..." but I'd love to hear better<br>
> suggestions.<br>
<br>
</div>I don't really have better names.  -fsample-profile and -fauto-profile<br>
are both the same to me.  The name -fauto-profile has the slight<br>
advantage that it can serve as a more general flag name, with the<br>
actual profiling style automatically detected by the format of the<br>
input file. But, I don't really care all that much.<br>
<br>
Having said that, I can also see -fprofile-use=filename being smart<br>
enough to know what type of profile it's getting by examining the<br>
signature of "filename".  This is contemplated in my LLVM patch.  The<br>
pass instantiates a different reader according to the type of file it<br>
detects (right now it does nothing of the sort, however).<br></blockquote><div><br></div><div>My $0.02 having just read the recent discussion: particularly if/when -fprofile-use=filename is smart enough to detect the type of profile, instead of having -f*-profile options like -fsample-profile, perhaps -fprofile-type=<kind> (e.g. -fprofile-type=sample, -fprofile-type=gcc, etc--or -fprofile-kind=<kind> instead of -fprofile-type) where the type defaults to GCC style... or later to whatever -fprofile-use= guesses the file's format to be. It also gives pretty good symmetry to -fprofile-generate= and -fprofile-use=</div>
<div><br></div><div>Cheers,</div><div>Kaelyn</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class="HOEnZb"><font color="#888888"><br>
<br>
Diego.<br>
</font></span><div class="HOEnZb"><div class="h5">_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</div></div></blockquote></div><br></div></div>