userdebug_or_eng: allow traced_perf to read kallsyms.
This tracing daemon interfaces with perf_events, and is used for
callstack sampling. Currently, we only handle userspace stacks. We
have the ability to collect kernel frame addresses (as unwound
by the kernel itself), but need /proc/kallsyms to symbolize them.
This patch mirrors what was done for traced_probes (ftrace event
kptr symbolization) in aosp/1455337 - the daemon can set a sysprop
that causes "init" to temporarily relax kptr_restrict, then the daemon
can open and read /proc/kallsyms. After the file is parsed, the
kptr_restrict value is restored.
To reiterate, this is confined to userdebug_or_eng due to the reasons
outlined in go/perfetto-kallsyms.
Bug: 173124818
Change-Id: I9077bbfe6fea3318f4c37947a5c455061ca43d8d
diff --git a/private/property.te b/private/property.te
index b14ab4e..7d74dcf 100644
--- a/private/property.te
+++ b/private/property.te
@@ -491,6 +491,7 @@
neverallow {
-init
userdebug_or_eng(`-traced_probes')
+ userdebug_or_eng(`-traced_perf')
} {
lower_kptr_restrict_prop
}:property_service set;