[PATCH] D48538: Make __gcov_flush flush counters for all shared libraries

Marco Castelluccio via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 4 15:05:04 PDT 2018


marco-c added a comment.

>>    Sorry, what I meant is that we could remove __llvm_gcov_writeout and only keep __llvm_gcov_flush (they are defined in lib/Transforms/Instrumentation/GCOVProfiling.cpp and passed to llvm_gcov_init). We currently have writeout functions and flush functions, where the difference is just that the flush function is also resetting the counters to 0.
>>    At exit, instead of calling __llvm_gcov_writeout, we could call __llvm_gcov_flush. Since we are at exit, the fact that we reset the counters to 0 for the current module doesn't matter (as the module is not usable anymore after that).
>>   At exit we would still call __llvm_gcov_flush only for the module that is exiting, at __gcov_flush we would call __llvm_gcov_flush for all modules.
> 
> This sounds safe, but this does not belong to this patch.

Yeah, definitely a separate thing, I'll do it and submit it in another revision.

> Looks like Stephane (the only user of the new interface) is ok for you to remove it completely, which is fine by me.

OK, I'll remove it then.

Before landing, I will "stress test" this patch on our CI to make sure everything is still working as before.


https://reviews.llvm.org/D48538





More information about the llvm-commits mailing list