Ftrace: Add Setup/Start support for fast triggering

Introduce the notion of Setup vs Start in the ftrace
data source. This make it so that ftrace can be in a
state where M configurations are "setup" (buffers are
allocated, categories configured ...) but only N <= M
of these are "started" (tracing is enabled).

E2E latency (incl all IPC) measured on Pixel2: 2-3ms

Bug: 116547201
Change-Id: I1a995f25c30891b53eae902e137b7adf1dbbc61d
diff --git a/src/traced/probes/ftrace/ftrace_controller.h b/src/traced/probes/ftrace/ftrace_controller.h
index b950e31..fae0a68 100644
--- a/src/traced/probes/ftrace/ftrace_controller.h
+++ b/src/traced/probes/ftrace/ftrace_controller.h
@@ -64,6 +64,7 @@
   void ClearTrace();
 
   bool AddDataSource(FtraceDataSource*) PERFETTO_WARN_UNUSED_RESULT;
+  bool StartDataSource(FtraceDataSource*);
   void RemoveDataSource(FtraceDataSource*);
 
   void DumpFtraceStats(FtraceStats*);
@@ -123,6 +124,7 @@
   bool atrace_running_ = false;
   std::map<size_t, std::unique_ptr<CpuReader>> cpu_readers_;
   std::set<FtraceDataSource*> data_sources_;
+  std::set<FtraceDataSource*> started_data_sources_;
   base::WeakPtrFactory<FtraceController> weak_factory_;  // Keep last.
   PERFETTO_THREAD_CHECKER(thread_checker_)
 };