[compiler-rt] r201808 - Add an environment variable to override the default profile output file.

Bob Wilson bob.wilson at apple.com
Sat Feb 22 00:16:45 PST 2014


On Feb 21, 2014, at 10:02 PM, Kostya Serebryany <kcc at google.com> wrote:

> 
> 
> 
> On Fri, Feb 21, 2014 at 9:55 PM, Bob Wilson <bob.wilson at apple.com> wrote:
> 
> On Feb 21, 2014, at 2:35 AM, Kostya Serebryany <kcc at google.com> wrote:
> 
>> AsanCov emits file_name.PID so that you can run multiple processes with coverage (each spawning multiple subprocesses) and 
>> they will not fight over the same file. An env. var. does not give us that. 
>> 
>> —kcc 
> 
> We discussed that possibility yesterday. It makes sense, but adding the PID or some other unique identifier just complicates things for our typical usage. It is easier for our build process to be able to set something to specify the file name. Otherwise, we don’t know what file will be written and have to open up a directory and search for it. That’s even more of a hassle when you’re running the code on a separate device with limited access to the file system.
> 
> Can you think of a simple way to provide both options? I really don’t want to make this more complicated than necessary.
> 
> We may want to follow the path chosen by valgrind for --log-file=
> See http://valgrind.org/docs/manual/manual-core.html where --log-file= is described. 
> In short, they allow %p in the file name, and %p will be replaced with PID. 
> 
> Sanitizers (when used with log_path option) always dump output to name.PID. 
> W/o PID (or other unique ID) you essentially can not log from a multi-process program.

I like that idea. That way you can choose the behavior your want, i.e., with or without the PID, depending on whether you put a “%p” in the environment variable.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140222/b05314a3/attachment.html>


More information about the llvm-commits mailing list