fuchsia_trace_observer/lib.rs
1// Copyright 2023 The Fuchsia Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5/// Start a thread that calls the provided callback when trace state changes.
6pub fn start_trace_observer(callback: extern "C" fn()) {
7 unsafe { sys::start_trace_observer_rust(callback) }
8}
9
10mod sys {
11 // From librust-trace-observer.so
12 extern "C" {
13 pub fn start_trace_observer_rust(callback: unsafe extern "C" fn());
14 }
15}