Skip to content

Commit f33975a

Browse files
VladimirMakaevfacebook-github-bot
authored andcommitted
trace output buffers for clock_gettime
Reviewed By: jasonwhite Differential Revision: D40946575 fbshipit-source-id: 5ca05f7d38ebd1eb7e031f017482ef8358bf1f2d
1 parent 96c89f0 commit f33975a

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

reverie-syscalls/src/args/time.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,16 @@ impl From<Timespec> for libc::timeval {
7676
}
7777
}
7878

79+
impl std::fmt::Display for Timespec {
80+
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
81+
write!(
82+
f,
83+
"{{ tv_sec: {}, tv_nsec: {} }}",
84+
self.tv_sec, self.tv_nsec
85+
)
86+
}
87+
}
88+
7989
/// A serializable version of `libc::timeval`.
8090
#[derive(Serialize, Deserialize)]
8191
#[derive(Default, Copy, Clone, Eq, PartialEq, Debug, Hash)]
@@ -107,5 +117,7 @@ pub struct Timezone {
107117
}
108118

109119
crate::impl_displayable!(Display Timeval);
120+
crate::impl_displayable!(Display Timespec);
110121

111122
crate::displayable_ptr!(TimevalMutPtr, AddrMut<Timeval>);
123+
crate::displayable_ptr!(TimespecMutPtr, AddrMut<Timespec>);

reverie-syscalls/src/syscalls/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ use crate::args::StatPtr;
3939
use crate::args::StatxMask;
4040
use crate::args::StatxPtr;
4141
use crate::args::Timespec;
42+
use crate::args::TimespecMutPtr;
4243
use crate::args::TimevalMutPtr;
4344
use crate::args::Timezone;
4445
use crate::display::Displayable;
@@ -2297,7 +2298,7 @@ typed_syscall! {
22972298
typed_syscall! {
22982299
pub struct ClockGettime {
22992300
clockid: ClockId,
2300-
tp: Option<AddrMut<Timespec>>,
2301+
tp: Option<TimespecMutPtr>,
23012302
}
23022303
}
23032304

0 commit comments

Comments
 (0)