w2yehia wrote:

> Can you summarize the high level use case which didn't work before, and in 
> which way it used to fail before, which gets fixed by this change?

Continuous profiling (that is continuous profile syncing to disk) is an 
existing feature, which is OFF by default on most platforms. 
The feature 
[mmap's](https://github.com/llvm/llvm-project/blob/main/compiler-rt/lib/profile/InstrProfilingFile.c#L273)
 the profile file rather than writing it at program exit (the default 
non-continuous mode behavior). There are two implementations in 
`InstrProfilingFile.c`, 
[one](https://github.com/llvm/llvm-project/blob/main/compiler-rt/lib/profile/InstrProfilingFile.c#L160)
 that mmap's onto existing memory, and 
[another](https://github.com/llvm/llvm-project/blob/main/compiler-rt/lib/profile/InstrProfilingFile.c#L273)
 that mmap's without an address hint. The latter relies on a corresponding 
compiler action (added in 
[this](https://github.com/llvm/llvm-project/commit/d3db13af7e5c01632fbf28149a2d4f9c4841aeba)
 commit), which is enabled using `-mllvm -runtime-counter-relocation`. 

What I added, in a previous PR (#124353), was a clang option 
(-fprofile-continuous) to enable the feature and take care of the nuances of 
setting up the compiler and runtime: (1) override the profile file name by 
appending '%c' into it, and (2) pass `-runtime-counter-relocation` to the 
backend on certain platforms.
This PR added `T.isKnownWindowsMSVCEnvironment()` to the conditions under which 
the drivers passes `-runtime-counter-relocation` to the backend, and the 
question is whether this is sufficient for windows or more changes to the 
conditions are needed. 
Note if we miss a condition/configuration then it doesn't break the feature 
there, it just would 
[fail](https://github.com/llvm/llvm-project/blob/main/compiler-rt/lib/profile/InstrProfilingFile.c#L662)
 at runtime if you try enabling using this new clang option 
(-fprofile-continuous).

https://github.com/llvm/llvm-project/pull/127858
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to