<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Feb 21, 2014, at 6:17 AM, Diego Novillo <<a href="mailto:dnovillo@google.com">dnovillo@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">On Thu, Feb 20, 2014 at 2:52 PM, Bob Wilson <<a href="mailto:bob.wilson@apple.com">bob.wilson@apple.com</a>> wrote:<br><blockquote type="cite">Author: bwilson<br>Date: Thu Feb 20 13:52:32 2014<br>New Revision: 201808<br><br>URL: <a href="http://llvm.org/viewvc/llvm-project?rev=201808&view=rev">http://llvm.org/viewvc/llvm-project?rev=201808&view=rev</a><br>Log:<br>Add an environment variable to override the default profile output file.<br><br>Also rename the default output file from "pgo-data" to "default.profdata".<br>The ".profdata" suffix is consistent with the name of the new llvm-profdata<br>tool.<br><br>Modified:<br>   compiler-rt/trunk/lib/profile/PGOProfiling.c<br><br>Modified: compiler-rt/trunk/lib/profile/PGOProfiling.c<br>URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/PGOProfiling.c?rev=201808&r1=201807&r2=201808&view=diff">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/PGOProfiling.c?rev=201808&r1=201807&r2=201808&view=diff</a><br>==============================================================================<br>--- compiler-rt/trunk/lib/profile/PGOProfiling.c (original)<br>+++ compiler-rt/trunk/lib/profile/PGOProfiling.c Thu Feb 20 13:52:32 2014<br>@@ -56,7 +56,10 @@ void llvm_pgo_register_writeout_function<br>}<br><br>void llvm_pgo_writeout_files() {<br>-  OutputFile = fopen("pgo-data", "w");<br>+  const char *OutputName = getenv("LLVM_PROFILE_FILE");<br></blockquote><br>I was never very fond of environment variables. They lead to all kinds<br>of nasty and hidden side-effects. How about a flag?</div></blockquote><br></div><div>How would that work? At the time we build the code, we may not even know where to write the output. E.g., when running on iOS we can only write inside the app’s sandbox directory. We also need to be able to change the output file for different runs, and a random unique identifier won’t be good enough because we need to know which output correlates with each run.</div></body></html>