fxfs_trace/
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
5pub use fxfs_trace_macros::*;
6pub use storage_trace::{self, Id, Scope, TraceFutureExt};
7
8#[macro_export]
9macro_rules! duration {
10    ($name:expr $(, $key:expr => $val:expr)* $(,)?) => {
11        $crate::storage_trace::duration!(c"fxfs", $name $(,$key => $val)*);
12    }
13}
14
15#[macro_export]
16macro_rules! instant {
17    ($name:expr, $scope:expr $(, $key:expr => $val:expr)* $(,)?) => {
18        $crate::storage_trace::instant!(c"fxfs", $name, $scope $(,$key => $val)*);
19    }
20}
21
22#[macro_export]
23macro_rules! flow_begin {
24    ($name:expr, $flow_id:expr $(, $key:expr => $val:expr)* $(,)?) => {
25        $crate::storage_trace::flow_begin!(c"fxfs", $name, $flow_id $(,$key => $val)*);
26    }
27}
28
29#[macro_export]
30macro_rules! flow_step {
31    ($name:expr, $flow_id:expr $(, $key:expr => $val:expr)* $(,)?) => {
32        $crate::storage_trace::flow_step!(c"fxfs", $name, $flow_id $(,$key => $val)*);
33    }
34}
35
36#[macro_export]
37macro_rules! flow_end {
38    ($name:expr, $flow_id:expr $(, $key:expr => $val:expr)* $(,)?) => {
39        $crate::storage_trace::flow_end!(c"fxfs", $name, $flow_id $(,$key => $val)*);
40    }
41}
42
43#[macro_export]
44macro_rules! trace_future_args {
45    ($name:expr $(, $key:expr => $val:expr)* $(,)?) => {
46        $crate::storage_trace::trace_future_args!(c"fxfs", $name $(,$key => $val)*);
47    };
48}