mm_events: Add knob to remove mm_event tracing instance

Only create mm_event tracing instance if
persist.mm_events.enabled=true. This saves ~5.5MB on low
memory devices that don't enable mm_events. The memory saved is
slab memory that would be allocated for the ftrace instance's
inode/dentry objects.

Set the per-CPU trace buffer sizes to 1KB by default to minimize
trace buffer memory usage if perfetto isn't started.

Also disable tracing by default, traced_probes will enable
as needed.

Bug: 194156702
Test: boot; ls /sys/kernel/tracing/instances -> No mm_events
Test: setprop persist.mm_events.enabled true; boot;
      ls /sys/kernel/tracing/instances -> mm_events
Change-Id: I89d7e5e1cd0d32b5612bc419b1a1c4b8c3c8ade6
1 file changed