mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-22 17:03:23 +00:00
Avoid computation of log message arguments in syscall handler
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
da5873e990
commit
98a2e623e2
@ -19,7 +19,7 @@ pub(crate) use aster_frame::{
|
|||||||
};
|
};
|
||||||
pub(crate) use bitflags::bitflags;
|
pub(crate) use bitflags::bitflags;
|
||||||
pub(crate) use int_to_c_enum::TryFromInt;
|
pub(crate) use int_to_c_enum::TryFromInt;
|
||||||
pub(crate) use log::{debug, error, info, trace, warn};
|
pub(crate) use log::{debug, error, info, log_enabled, trace, warn};
|
||||||
pub(crate) use pod::Pod;
|
pub(crate) use pod::Pod;
|
||||||
|
|
||||||
/// return current process
|
/// return current process
|
||||||
|
@ -568,12 +568,14 @@ pub fn syscall_dispatch(
|
|||||||
#[macro_export]
|
#[macro_export]
|
||||||
macro_rules! log_syscall_entry {
|
macro_rules! log_syscall_entry {
|
||||||
($syscall_name: tt) => {
|
($syscall_name: tt) => {
|
||||||
let syscall_name_str = stringify!($syscall_name);
|
if log_enabled!(log::Level::Info) {
|
||||||
let pid = $crate::current!().pid();
|
let syscall_name_str = stringify!($syscall_name);
|
||||||
let tid = $crate::current_thread!().tid();
|
let pid = $crate::current!().pid();
|
||||||
info!(
|
let tid = $crate::current_thread!().tid();
|
||||||
"[pid={}][tid={}][id={}][{}]",
|
info!(
|
||||||
pid, tid, $syscall_name, syscall_name_str
|
"[pid={}][tid={}][id={}][{}]",
|
||||||
);
|
pid, tid, $syscall_name, syscall_name_str
|
||||||
|
);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user