summaryrefslogtreecommitdiffstats
path: root/third_party/rust/tokio/src/macros/trace.rs
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/rust/tokio/src/macros/trace.rs')
-rw-r--r--third_party/rust/tokio/src/macros/trace.rs26
1 files changed, 26 insertions, 0 deletions
diff --git a/third_party/rust/tokio/src/macros/trace.rs b/third_party/rust/tokio/src/macros/trace.rs
new file mode 100644
index 0000000000..80a257e189
--- /dev/null
+++ b/third_party/rust/tokio/src/macros/trace.rs
@@ -0,0 +1,26 @@
+cfg_trace! {
+ macro_rules! trace_op {
+ ($name:expr, $readiness:literal) => {
+ tracing::trace!(
+ target: "runtime::resource::poll_op",
+ op_name = $name,
+ is_ready = $readiness
+ );
+ }
+ }
+
+ macro_rules! trace_poll_op {
+ ($name:expr, $poll:expr $(,)*) => {
+ match $poll {
+ std::task::Poll::Ready(t) => {
+ trace_op!($name, true);
+ std::task::Poll::Ready(t)
+ }
+ std::task::Poll::Pending => {
+ trace_op!($name, false);
+ return std::task::Poll::Pending;
+ }
+ }
+ };
+ }
+}