1## Permissions to allow system-wide tracing to the kernel trace buffer.
2##
3on boot
4
5# Allow writing to the kernel trace log.
6    chmod 0222 /sys/kernel/debug/tracing/trace_marker
7
8# Allow the shell group to enable (some) kernel tracing.
9    chown root shell /sys/kernel/debug/tracing/trace_clock
10    chown root shell /sys/kernel/debug/tracing/buffer_size_kb
11    chown root shell /sys/kernel/debug/tracing/options/overwrite
12    chown root shell /sys/kernel/debug/tracing/options/print-tgid
13    chown root shell /sys/kernel/debug/tracing/events/sched/sched_switch/enable
14    chown root shell /sys/kernel/debug/tracing/events/sched/sched_wakeup/enable
15    chown root shell /sys/kernel/debug/tracing/events/power/cpu_frequency/enable
16    chown root shell /sys/kernel/debug/tracing/events/power/cpu_idle/enable
17    chown root shell /sys/kernel/debug/tracing/events/power/clock_set_rate/enable
18    chown root shell /sys/kernel/debug/tracing/events/cpufreq_interactive/enable
19    chown root shell /sys/kernel/debug/tracing/tracing_on
20
21    chmod 0664 /sys/kernel/debug/tracing/trace_clock
22    chmod 0664 /sys/kernel/debug/tracing/buffer_size_kb
23    chmod 0664 /sys/kernel/debug/tracing/options/overwrite
24    chmod 0664 /sys/kernel/debug/tracing/options/print-tgid
25    chmod 0664 /sys/kernel/debug/tracing/events/sched/sched_switch/enable
26    chmod 0664 /sys/kernel/debug/tracing/events/sched/sched_wakeup/enable
27    chmod 0664 /sys/kernel/debug/tracing/events/power/cpu_frequency/enable
28    chmod 0664 /sys/kernel/debug/tracing/events/power/cpu_idle/enable
29    chmod 0664 /sys/kernel/debug/tracing/events/power/clock_set_rate/enable
30    chmod 0664 /sys/kernel/debug/tracing/events/cpufreq_interactive/enable
31    chmod 0664 /sys/kernel/debug/tracing/tracing_on
32
33# Allow only the shell group to read and truncate the kernel trace.
34    chown root shell /sys/kernel/debug/tracing/trace
35    chmod 0660 /sys/kernel/debug/tracing/trace
36