perfetto: Arm mm event trace config

If persist.perfetto.mm_events.enabled=true periodically
arm mm_event trace config.

The config is only armed if perfotto traced daemon is active.

If arming the config fails, the arm interval is increased
by a backoff factor before retrying.

If 10 failures occur in succession, abort trying to arm
the config.

If an alternate vendor trace config is present at
/vendor/etc/mm_events.cfg it will be armed instead of the default.

The mm_events props are configurable from vendor init.

Bug: 183037386
Test: Manual.
        - Set prop enabled,
        - Synthesize memory pressure
        - Verify perfetto trace data captured in bugreport
Change-Id: I48923e03dff97ae04f3c298ac6fc32189ce53a64
diff --git a/Android.bp b/Android.bp
index f71b821..b67a30b 100644
--- a/Android.bp
+++ b/Android.bp
@@ -9687,6 +9687,7 @@
   ],
   required: [
     "libperfetto_android_internal",
+    "mm_events",
     "traced_perf",
     "trigger_perfetto",
   ],
@@ -9907,6 +9908,11 @@
     ],
 }
 
+sh_binary {
+    name: "mm_events",
+    src: "tools/mm_events",
+}
+
 package {
     default_applicable_licenses: ["external_perfetto_license"],
 }