tracefs permissions: fix throttled_rss_stat/enable on user builds
throttled_rss_stat is a synthetic event derived from kmem/rss_stat via
hitogram/trigger machinery in tracefs. The existing MAC and DAC
permissions allow us to do everything except actually enabling/disabling
the recording of the synthetic event.
userdebug builds work because we fall back onto a generic enable/disable
set_event mechanism that is debug-only.
From strace on a debuggable build:
openat(AT_FDCWD, "/sys/kernel/tracing/events/synthetic/rss_stat_throttled/enable", O_WRONLY|O_CLOEXEC) = -1 EACCES (Permission denied)
And the corresponding file permissions:
/sys/kernel/tracing/events/synthetic/rss_stat_throttled $ ls -alZ
-rw-r--r-- 1 root readtracefs u:object_r:debugfs_tracing:s0 0 2023-02-20 19:26 enable
Tested: patched onto an internal branch, flashed panther-user, collected
trace with perfetto
Bug: 270060883
Merged-In: I25dcb6d9fa60066fd59f2d1dc796baceb3b6b419
Merged-In: I6001eec487932ab1fd869231815fbf485b7370bb
Change-Id: I6001eec487932ab1fd869231815fbf485b7370bb
(cherry picked from commit 231446d0f0dce6db16ba158113c09719fa562e9e)
1 file changed