// Copyright 2018 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. // A helper library for connecting to the trace manager via fdio. #include #include #include const char kServicePath[] = "/svc/fuchsia.tracelink.Registry"; zx_status_t trace_provider_connect_with_fdio(zx_handle_t* out_client) { // Connect to the trace registry. zx::channel registry_client; zx::channel registry_service; zx_status_t status = zx::channel::create(0u, ®istry_client, ®istry_service); if (status != ZX_OK) return status; status = fdio_service_connect(kServicePath, registry_service.release()); // takes ownership if (status != ZX_OK) return status; *out_client = registry_client.release(); return ZX_OK; }