profiling: Write bookkeeping to trace

Also retain more information about mappings.

See example trace: https://fmayer.users.x20web.corp.google.com/www/heapprofd_trace.textpb

Test: m
Test: flash sailfish
Test: profile system_server

Change-Id: Ia5db70fbffbf9ec58a6d7a942d52d7df2f2d409a
diff --git a/BUILD.gn b/BUILD.gn
index a6d4a63..f5a0eb1 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -54,8 +54,6 @@
       ":traced",
       ":traced_probes",
       "protos/perfetto/config:merged_config",  # For syntax-checking the proto.
-      "protos/perfetto/profiling:lite",  # For syntax-checking the proto.
-                                         # TODO(fmayer): Remove once used.
       "src/ipc/protoc_plugin:ipc_plugin($host_toolchain)",
       "tools:protoc_helper",
     ]
@@ -298,6 +296,7 @@
   executable("heapprofd") {
     deps = [
       "gn:default_deps",
+      "protos/perfetto/trace:zero",
       "src/base",
       "src/base:unix_socket",
       "src/profiling/memory:daemon",