## Permissions to allow additional system-wide tracing to the kernel trace buffer.
## The default list of permissions is set in frameworks/native/cmds/atrace/atrace.rc

# Allow the shell group to enable kernel tracepoints:

on post-fs
    chown root shell /sys/kernel/debug/tracing/events/sync/enable
    chown root shell /sys/kernel/debug/tracing/events/workqueue/enable
    chown root shell /sys/kernel/debug/tracing/events/regulator/enable
    chown root shell /sys/kernel/debug/tracing/events/pagecache/enable

    # irq
    chown root shell /sys/kernel/debug/tracing/events/irq/enable
    chown root shell /sys/kernel/debug/tracing/events/ipi/enable

    # disk
    chown root shell /sys/kernel/debug/tracing/events/f2fs/f2fs_sync_file_enter/enable
    chown root shell /sys/kernel/debug/tracing/events/f2fs/f2fs_sync_file_exit/enable
    chown root shell /sys/kernel/debug/tracing/events/f2fs/f2fs_write_begin/enable
    chown root shell /sys/kernel/debug/tracing/events/f2fs/f2fs_write_end/enable
    chown root shell /sys/kernel/debug/tracing/events/ext4/ext4_da_write_begin/enable
    chown root shell /sys/kernel/debug/tracing/events/ext4/ext4_da_write_end/enable
    chown root shell /sys/kernel/debug/tracing/events/ext4/ext4_sync_file_enter/enable
    chown root shell /sys/kernel/debug/tracing/events/ext4/ext4_sync_file_exit/enable
    chown root shell /sys/kernel/debug/tracing/events/block/block_rq_issue/enable
    chown root shell /sys/kernel/debug/tracing/events/block/block_rq_complete/enable

    chmod 0664 /sys/kernel/debug/tracing/events/sync/enable
    chmod 0664 /sys/kernel/debug/tracing/events/workqueue/enable
    chmod 0664 /sys/kernel/debug/tracing/events/regulator/enable
    chmod 0664 /sys/kernel/debug/tracing/events/pagecache/enable

    # irq
    chmod 0664 /sys/kernel/debug/tracing/events/irq/enable
    chmod 0664 /sys/kernel/debug/tracing/events/ipi/enable

    # disk
    chmod 0664 /sys/kernel/debug/tracing/events/f2fs/f2fs_sync_file_enter/enable
    chmod 0664 /sys/kernel/debug/tracing/events/f2fs/f2fs_sync_file_exit/enable
    chmod 0664 /sys/kernel/debug/tracing/events/f2fs/f2fs_write_begin/enable
    chmod 0664 /sys/kernel/debug/tracing/events/f2fs/f2fs_write_end/enable
    chmod 0664 /sys/kernel/debug/tracing/events/ext4/ext4_da_write_begin/enable
    chmod 0664 /sys/kernel/debug/tracing/events/ext4/ext4_da_write_end/enable
    chmod 0664 /sys/kernel/debug/tracing/events/ext4/ext4_sync_file_enter/enable
    chmod 0664 /sys/kernel/debug/tracing/events/ext4/ext4_sync_file_exit/enable
    chmod 0664 /sys/kernel/debug/tracing/events/block/block_rq_issue/enable
    chmod 0664 /sys/kernel/debug/tracing/events/block/block_rq_complete/enable
