DO NOT MERGE: logd: limit LogStatistics to eng builds
Storing the command line of every thread that logs requires grabbing
/proc/<pid>/cmdline, which calls __access_remote_vm and grabs the
mmap_sem of the logging process. However, because this is run in a
very low priority logd thread, this can result in uninterruptible
sleeps that significantly perturb performance results.
Per userdebug policy, this is now limited to eng targets or when the
"logd.statistics" or "persist.logd.statistics" properties are enabled.
Ignore-AOSP-First: starting in udc-qpr-dev before improving in main so
tests continue to run
Test: stop, simpleperf record -a --exclude-perf -g --kprobe "p:access_remote_vm __access_remote_vm" -e kprobes:access_remote_vm, start
Bug: 294570513
Change-Id: I5da92981734de044f0692558b99de53ca223518b
2 files changed