Improvements to the tracing and logging in wasmer

- Now using the fmt subscriber for improved formatting
- Using spans on all syscalls
- Added recorded fields on the spans instead trace and debug macros
- Adding timing on all syscall
This commit is contained in:
Johnathan Sharratt
2023-03-06 03:12:29 +11:00
committed by Christoph Herzog
parent 6d33d57e6e
commit 6dde2831a0
126 changed files with 476 additions and 1226 deletions

View File

@@ -1,4 +1,4 @@
use std::{any::Any, marker::PhantomData};
use std::{any::Any, fmt::Debug, marker::PhantomData};
use crate::vm::VMFunctionEnvironment;
@@ -102,6 +102,12 @@ pub struct FunctionEnvMut<'a, T: 'a> {
pub(crate) func_env: FunctionEnv<T>,
}
impl<'a, T> Debug for FunctionEnvMut<'a, T> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "env_mut")
}
}
impl<T: Send + 'static> FunctionEnvMut<'_, T> {
/// Returns a reference to the host state in this function environement.
pub fn data(&self) -> &T {

View File

@@ -278,11 +278,6 @@ impl<T: ValueType, M: MemorySize> Eq for WasmPtr<T, M> {}
impl<T: ValueType, M: MemorySize> fmt::Debug for WasmPtr<T, M> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"WasmPtr(offset: {}, pointer: {:#x})",
self.offset.into(),
self.offset.into()
)
write!(f, "{}(@{})", std::any::type_name::<T>(), self.offset.into())
}
}