trigger_perfetto: Add trigger_perfetto binary

Add a new binary ("trigger_perfetto") to allow programs that cannot
exec "perfetto" to trigger the end of long running traces.

Clean up a new small unreleated things:

- Fix tools/tmux support for protobuf configs
- Add a new config "background.cfg" with a stop trigger for testing
- Improve two error logs in tracing_service_impl.cc

Bug: 130543265
Change-Id: I7fde613382e2bf3041ab50a96f0a300fe8699704
diff --git a/BUILD.gn b/BUILD.gn
index 0e1d257..084bf9d 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -54,6 +54,7 @@
       ":perfetto_integrationtests",
       ":traced",
       ":traced_probes",
+      ":trigger_perfetto",
       "protos/perfetto/config:merged_config",  # For syntax-checking the proto.
       "protos/perfetto/trace:merged_trace",  # For syntax-checking the proto.
       "src/ipc/protoc_plugin:ipc_plugin($host_toolchain)",
@@ -213,6 +214,22 @@
     ]
   }
 
+  # Tool to finalize long running traces.
+  # This connects to traced as a producer and sends the triggers passed on the
+  # commandline. This is a subset of what the perfetto binary can do but we
+  # need a separate binary for programs that cannot (for good reason) use the
+  # additional functionality (for example starting traces via consumer socket)
+  # due to selinux rules.
+  executable("trigger_perfetto") {
+    deps = [
+      "gn:default_deps",
+      "src/perfetto_cmd:trigger_perfetto_cmd",
+    ]
+    sources = [
+      "src/perfetto_cmd/trigger_perfetto_main.cc",
+    ]
+  }
+
   if (perfetto_build_with_android) {
     executable("trace_to_text") {
       testonly = true