traced_probes, traced_perf: allow kernel symbolisation on release builds with init's assistance
traced_probes and traced_perf now inherit an fd to /proc/kallsyms from
init, which retains full address visibility, even on release builds of
Android.
The main complication with this shared fd is that concurrent reads would
cause quadratic slowdown because the underlying seq_file is stateful.
Hence we use provisional flock(/proc/kallsyms) to mutually exclude the
parsing of kallsyms between our daemons.
See go/perfetto-kallsyms-user for more details.
Bug: 383513654
Change-Id: I39c6ac4e6d7a07fad1fad757cecb3ef5014989d2
diff --git a/perfetto.rc b/perfetto.rc
index 5c6d853..8169d8f 100644
--- a/perfetto.rc
+++ b/perfetto.rc
@@ -34,6 +34,7 @@
onrestart exec_background - nobody shell -- /system/bin/traced_probes --cleanup-after-crash
file /dev/kmsg w
capabilities DAC_READ_SEARCH
+ shared_kallsyms
on property:persist.device_config.global_settings.sys_traced=1
setprop persist.traced.enable 1