Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 231446d0 authored by Ryan Savitski's avatar Ryan Savitski
Browse files

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
Change-Id: I6001eec487932ab1fd869231815fbf485b7370bb
parent 737426bf
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment