[profile] In Android, do not mkdir() dirs in GCOV_PREFIX


[profile] In Android, do not mkdir() dirs in GCOV_PREFIX

In Android, attempting to mkdir() or even stat() top-level directories
like /data causes noisy selinux denials. During whole-system coverage
instrumentation, this causes a deluge of noisy messages that drown out
legitimate selinux denials, that should be audited and fixed.

To avoid this, skip creating any directory in GCOV_PREFIX (thereby
assuming that it exists).

  • Android platform ensures that the GCOV_PREFIX used in Android is

created and read/writable by all processes.

  • This only affects the Android platform (by checking against

ANDROID_API_FUTURE) and for apps built with Clang coverage, the
runtime will still create any non-existent parent directories for the
coverage files.

Reviewers: srhines, davidxl

Subscribers: krytarowski, #sanitizers, danalbert, llvm-commits

Tags: #sanitizers, #llvm

Differential Revision: https://reviews.llvm.org/D65245