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

Kostya Serebryany kcc at google.com
Fri Feb 21 02:35:11 PST 2014


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


On Thu, Feb 20, 2014 at 11:52 PM, Bob Wilson <bob.wilson at apple.com> wrote:

> Author: bwilson
> Date: Thu Feb 20 13:52:32 2014
> New Revision: 201808
>
> URL: http://llvm.org/viewvc/llvm-project?rev=201808&view=rev
> Log:
> Add an environment variable to override the default profile output file.
>
> Also rename the default output file from "pgo-data" to "default.profdata".
> The ".profdata" suffix is consistent with the name of the new llvm-profdata
> tool.
>
> Modified:
>     compiler-rt/trunk/lib/profile/PGOProfiling.c
>
> Modified: compiler-rt/trunk/lib/profile/PGOProfiling.c
> URL:
> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/PGOProfiling.c?rev=201808&r1=201807&r2=201808&view=diff
>
> ==============================================================================
> --- compiler-rt/trunk/lib/profile/PGOProfiling.c (original)
> +++ compiler-rt/trunk/lib/profile/PGOProfiling.c Thu Feb 20 13:52:32 2014
> @@ -56,7 +56,10 @@ void llvm_pgo_register_writeout_function
>  }
>
>  void llvm_pgo_writeout_files() {
> -  OutputFile = fopen("pgo-data", "w");
> +  const char *OutputName = getenv("LLVM_PROFILE_FILE");
> +  if (OutputName == NULL || OutputName[0] == '\0')
> +    OutputName = "default.profdata";
> +  OutputFile = fopen(OutputName, "w");
>    if (!OutputFile) return;
>
>    while (writeout_fn_head) {
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140221/f7738ad4/attachment.html>


More information about the llvm-commits mailing list