diff options
author | Baitinq <manuelpalenzuelamerino@gmail.com> | 2024-07-22 22:43:00 +0200 |
---|---|---|
committer | Baitinq <manuelpalenzuelamerino@gmail.com> | 2024-07-22 22:43:00 +0200 |
commit | d9ad9d226fd4613509c73b99e13f11606c10ff0d (patch) | |
tree | 54e25ba99e915e0905d272ad5e293958a38fc7db /fs-tracer-common | |
parent | fs-tracer: open files should be referenced with pid+fd (diff) | |
download | fs-tracer-d9ad9d226fd4613509c73b99e13f11606c10ff0d.tar.gz fs-tracer-d9ad9d226fd4613509c73b99e13f11606c10ff0d.tar.bz2 fs-tracer-d9ad9d226fd4613509c73b99e13f11606c10ff0d.zip |
fs-tracer: handle close syscall and properly serialize reqs
Diffstat (limited to 'fs-tracer-common')
-rw-r--r-- | fs-tracer-common/src/lib.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/fs-tracer-common/src/lib.rs b/fs-tracer-common/src/lib.rs index 3615dec..fb36b74 100644 --- a/fs-tracer-common/src/lib.rs +++ b/fs-tracer-common/src/lib.rs @@ -15,6 +15,7 @@ use crate::vmlinux::umode_t; pub enum SyscallInfo { Write(WriteSyscallBPF), Open(OpenSyscallBPF), + Close(CloseSyscallBPF), } #[derive(Clone, Copy)] @@ -67,3 +68,23 @@ impl fmt::Debug for OpenSyscallBPF { .finish() } } + +#[derive(Clone, Copy)] +pub struct CloseSyscallBPF { + pub pid: u32, + pub fd: c_int, + + pub ret: c_long, +} + +unsafe impl Sync for CloseSyscallBPF {} + +impl fmt::Debug for CloseSyscallBPF { + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.debug_struct("CloseSyscallBPF") + .field("pid", &self.pid) + .field("fd", &self.fd) + .field("ret", &self.ret) + .finish() + } +} |