Propagate tracing session to the producers

Until now the notion of the tracing session was not exposed at all
to producers. This made it complicated to distinguish the case of
two independent data sources belonging to two distinct tracing sessions
from the case of two data sources within the same tracing session.
This CL adds the plumbing to propagate this information to the producer
and removes the hack in probes_producer.cc which was looking at the
buffer ID.

Test: TracingServiceImplTest.SessionId
Change-Id: Ia90cf1ee039253c7a07e0a68d2a8ea196c8f0b98
diff --git a/src/traced/probes/probes_producer.cc b/src/traced/probes/probes_producer.cc
index 1fd3ad5..e56eb73 100644
--- a/src/traced/probes/probes_producer.cc
+++ b/src/traced/probes/probes_producer.cc
@@ -119,11 +119,8 @@
 void ProbesProducer::CreateDataSourceInstance(DataSourceInstanceID instance_id,
                                               const DataSourceConfig& config) {
   PERFETTO_DCHECK(data_sources_.count(instance_id) == 0);
-
-  // TODO(hjd): This a hack since we don't actually know the session id. For
-  // now we'll assume anything wit hthe same target buffer is in the same
-  // session.
-  TracingSessionID session_id = config.target_buffer();
+  TracingSessionID session_id = config.tracing_session_id();
+  PERFETTO_CHECK(session_id > 0);
 
   std::unique_ptr<ProbesDataSource> data_source;
   if (config.name() == kFtraceSourceName) {