atrace.rc revision ffcc71175aa6c6ed9e3a3deb446f8ba561d63df5
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/power/cpu_frequency_limits/enable
19    chown root shell /sys/kernel/debug/tracing/events/cpufreq_interactive/enable
20    chown root shell /sys/kernel/debug/tracing/events/vmscan/mm_vmscan_direct_reclaim_begin/enable
21    chown root shell /sys/kernel/debug/tracing/events/vmscan/mm_vmscan_direct_reclaim_end/enable
22    chown root shell /sys/kernel/debug/tracing/events/vmscan/mm_vmscan_kswapd_wake/enable
23    chown root shell /sys/kernel/debug/tracing/events/vmscan/mm_vmscan_kswapd_sleep/enable
24    chown root shell /sys/kernel/debug/tracing/events/binder/binder_transaction/enable
25    chown root shell /sys/kernel/debug/tracing/events/binder/binder_transaction_received/enable
26    chown root shell /sys/kernel/debug/tracing/events/binder/binder_lock/enable
27    chown root shell /sys/kernel/debug/tracing/events/binder/binder_locked/enable
28    chown root shell /sys/kernel/debug/tracing/events/binder/binder_unlock/enable
29
30    chown root shell /sys/kernel/debug/tracing/tracing_on
31
32    chmod 0664 /sys/kernel/debug/tracing/trace_clock
33    chmod 0664 /sys/kernel/debug/tracing/buffer_size_kb
34    chmod 0664 /sys/kernel/debug/tracing/options/overwrite
35    chmod 0664 /sys/kernel/debug/tracing/options/print-tgid
36    chmod 0664 /sys/kernel/debug/tracing/events/sched/sched_switch/enable
37    chmod 0664 /sys/kernel/debug/tracing/events/sched/sched_wakeup/enable
38    chmod 0664 /sys/kernel/debug/tracing/events/power/cpu_frequency/enable
39    chmod 0664 /sys/kernel/debug/tracing/events/power/cpu_idle/enable
40    chmod 0664 /sys/kernel/debug/tracing/events/power/clock_set_rate/enable
41    chmod 0664 /sys/kernel/debug/tracing/events/power/cpu_frequency_limits/enable
42    chmod 0664 /sys/kernel/debug/tracing/events/cpufreq_interactive/enable
43    chmod 0664 /sys/kernel/debug/tracing/events/vmscan/mm_vmscan_direct_reclaim_begin/enable
44    chmod 0664 /sys/kernel/debug/tracing/events/vmscan/mm_vmscan_direct_reclaim_end/enable
45    chmod 0664 /sys/kernel/debug/tracing/events/vmscan/mm_vmscan_kswapd_wake/enable
46    chmod 0664 /sys/kernel/debug/tracing/events/vmscan/mm_vmscan_kswapd_sleep/enable
47    chmod 0664 /sys/kernel/debug/tracing/tracing_on
48    chmod 0664 /sys/kernel/debug/tracing/events/binder/binder_transaction/enable
49    chmod 0664 /sys/kernel/debug/tracing/events/binder/binder_transaction_received/enable
50    chmod 0664 /sys/kernel/debug/tracing/events/binder/binder_lock/enable
51    chmod 0664 /sys/kernel/debug/tracing/events/binder/binder_locked/enable
52    chmod 0664 /sys/kernel/debug/tracing/events/binder/binder_unlock/enable
53
54# Allow only the shell group to read and truncate the kernel trace.
55    chown root shell /sys/kernel/debug/tracing/trace
56    chmod 0660 /sys/kernel/debug/tracing/trace
57
58on property:persist.debug.atrace.boottrace=1
59    start boottrace
60
61# Run atrace with the categories written in a file
62service boottrace /system/bin/atrace --async_start -f /data/misc/boottrace/categories
63    disabled
64    oneshot
65