summaryrefslogtreecommitdiff
path: root/api/coverage/tools
diff options
context:
space:
mode:
author David Duarte <licorne@google.com> 2023-10-11 23:46:35 +0000
committer David Duarte <licorne@google.com> 2023-10-12 21:39:39 +0000
commit8adb04718ef80d5e5c65bdf3f2ca120406916486 (patch)
treeddd4bf4da871e54c98b792ca1a59563b70b5fdfc /api/coverage/tools
parentd3a0d02b7fb4e54142760a9f0c14e63d3bda015b (diff)
Call exit instead of _exit when compiled with clang coverage
A function is registered with atexit when compiling with clang coverage. https://cs.android.com/android/platform/superproject/+/main:external/compiler-rt/lib/profile/InstrProfilingFile.c;l=508;drc=c58a43648cd6121c51a2e795a28e2ef90d7813e6 This function dumps coverage when the process exits. However when calling System.exit from java this leads to a call to _exit(2) which doesn't run exit hooks. Instead when compiled with coverage call exit(3) to run the exit hooks. This behavior is the same as what the default "exit" option of ART is doing. https://cs.android.com/android/platform/superproject/+/master:art/libartbase/base/fast_exit.h;l=44;drc=bdf1737bd17132525bcfdc778663123b61e97fa3 Another way to fix this might be to call __llvm_profile_write_file before _exit(2). Test: run avatar and see if coverage increase Bug: 304849228 Change-Id: Iec40612526f34472320be5ba5980cd1eea361ebc
Diffstat (limited to 'api/coverage/tools')
0 files changed, 0 insertions, 0 deletions