| // Copyright 2022 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| library fuchsia.tracing.perfetto; |
| |
| using zx; |
| |
| /// Interface for creating connections between Perfetto "Consumers" and |
| /// a shared Perfetto service. |
| /// To learn more about Perfetto, see: https://www.perfetto.dev/docs/ |
| /// and https://perfetto.dev/docs/concepts/service-model . |
| @discoverable |
| closed protocol ConsumerConnector { |
| /// Connects a Perfetto Consumer to the Perfetto backend. Both sides |
| /// will communicate over `producer_socket` using Perfetto's internal wire |
| /// format. |
| /// The lifetime of `consumer_socket` may outlive the connection lifetime |
| /// of ConsumerConnector. |
| /// Multiple producers may be connected simultaneously. |
| // TODO(https://fxbug.dev/42166474): Define error conditions and status codes. |
| strict ConnectConsumer(resource struct { |
| consumer_socket zx.Handle:SOCKET; |
| }) -> () error zx.Status; |
| }; |