From 4de731748a9fba1978d26eb1bd05042847e61161 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Fri, 17 May 2024 11:23:37 +0330 Subject: [PATCH 1/2] remove clock_time_get instrumentation --- lib/wasix/src/syscalls/wasi/clock_time_get.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/wasix/src/syscalls/wasi/clock_time_get.rs b/lib/wasix/src/syscalls/wasi/clock_time_get.rs index 33cad5ba50a..5fc5cb6ef80 100644 --- a/lib/wasix/src/syscalls/wasi/clock_time_get.rs +++ b/lib/wasix/src/syscalls/wasi/clock_time_get.rs @@ -1,6 +1,9 @@ use super::*; use crate::syscalls::*; +// NOTE: This syscall is not instrumented since it will be logged too much, +// hence introducing too much noise to the logs. + /// ### `clock_time_get()` /// Get the time of the specified clock /// Inputs: @@ -11,8 +14,6 @@ use crate::syscalls::*; /// Output: /// - `Timestamp *time` /// The value of the clock in nanoseconds -//#[instrument(level = "trace", skip_all, fields(?clock_id, %precision), ret)] -#[instrument(level = "trace", skip_all, ret)] pub fn clock_time_get( mut ctx: FunctionEnvMut<'_, WasiEnv>, clock_id: Snapshot0Clockid, From 73d7613fcdf50e4250d2ee6c733ef46c6adeb5d7 Mon Sep 17 00:00:00 2001 From: "M.Amin Rayej" Date: Fri, 17 May 2024 14:40:51 +0330 Subject: [PATCH 2/2] put clock_time_get instrumentation behind a feature gate --- lib/wasix/Cargo.toml | 1 + lib/wasix/src/syscalls/wasi/clock_time_get.rs | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/lib/wasix/Cargo.toml b/lib/wasix/Cargo.toml index 881309a4596..21f07cfb5df 100644 --- a/lib/wasix/Cargo.toml +++ b/lib/wasix/Cargo.toml @@ -165,6 +165,7 @@ sys-default = [ "ctrlc" ] sys-poll = [] +extra-logging = [] sys-thread = ["tokio/rt", "tokio/time", "tokio/rt-multi-thread", "rusty_pool"] journal = ["tokio/fs", "wasmer-journal/log-file"] diff --git a/lib/wasix/src/syscalls/wasi/clock_time_get.rs b/lib/wasix/src/syscalls/wasi/clock_time_get.rs index 5fc5cb6ef80..f1caab9635e 100644 --- a/lib/wasix/src/syscalls/wasi/clock_time_get.rs +++ b/lib/wasix/src/syscalls/wasi/clock_time_get.rs @@ -14,6 +14,10 @@ use crate::syscalls::*; /// Output: /// - `Timestamp *time` /// The value of the clock in nanoseconds +#[cfg_attr( + feature = "extra-logging", + tracing::instrument(level = "trace", skip_all, ret) +)] pub fn clock_time_get( mut ctx: FunctionEnvMut<'_, WasiEnv>, clock_id: Snapshot0Clockid,