traced_probes: Don't crash if someone else is using tracing
Change-Id: Idd617876ac6dc9cc1506f93fa925b2993c43d34a
diff --git a/src/traced/probes/probes_producer.cc b/src/traced/probes/probes_producer.cc
index 0047f89..57789a9 100644
--- a/src/traced/probes/probes_producer.cc
+++ b/src/traced/probes/probes_producer.cc
@@ -130,7 +130,10 @@
auto delegate =
std::unique_ptr<SinkDelegate>(new SinkDelegate(std::move(trace_writer)));
auto sink = ftrace_->CreateSink(std::move(proto_config), delegate.get());
- PERFETTO_CHECK(sink);
+ if (!sink) {
+ PERFETTO_ELOG("Failed to start tracing (maybe someone else is using it?)");
+ return;
+ }
delegate->sink(std::move(sink));
delegates_.emplace(id, std::move(delegate));
// Building on Android, watchdogs_.emplace(id, 2* source_config.duration_ms())