summary refs log tree commit diff
path: root/ripple/minitrace
diff options
context:
space:
mode:
authorV <v@unfathomable.blue>2022-02-08 04:21:08 +0000
committeredef <edef@unfathomable.blue>2022-02-08 04:21:08 +0000
commit565b80d348e288d29969a5c1d00827a8484d9e8b (patch)
treef1874fad592c2bdea30a968d2a24598b9fbd4528 /ripple/minitrace
parent63c5c93b0f7ca209ceee7d4c1ab1e63b13640c23 (diff)
ripple/minitrace: log newfstatat paths
Change-Id: Ieec434cdbddb45ab099bb9cf91dea1a135fd06ad
Diffstat (limited to 'ripple/minitrace')
-rw-r--r--ripple/minitrace/src/main.rs15
1 files changed, 13 insertions, 2 deletions
diff --git a/ripple/minitrace/src/main.rs b/ripple/minitrace/src/main.rs
index a8781f5..e5bb1f0 100644
--- a/ripple/minitrace/src/main.rs
+++ b/ripple/minitrace/src/main.rs
@@ -198,6 +198,8 @@ fn main() -> Result<()> {
 	Ok(())
 }
 
+const AT_FDCWD: i32 = -100;
+
 fn check_syscall(process: &Process, entry: SyscallEntry) -> bool {
 	match entry.number {
 		// read
@@ -279,7 +281,6 @@ fn check_syscall(process: &Process, entry: SyscallEntry) -> bool {
 		// openat
 		257 => {
 			let [dirfd, pathname, flags, _mode, ..] = entry.args;
-			const AT_FDCWD: i32 = -100;
 
 			if dirfd.try_into() == Ok(AT_FDCWD) {
 				return false;
@@ -294,7 +295,17 @@ fn check_syscall(process: &Process, entry: SyscallEntry) -> bool {
 		}
 
 		// newfstatat
-		262 => {}
+		262 => {
+			let [dirfd, pathname, _statbuf, _flags, ..] = entry.args;
+
+			if dirfd.try_into() == Ok(AT_FDCWD) {
+				return false;
+			}
+
+			let pathname = process.read_mem_cstr(pathname).unwrap();
+
+			println!("newfstatat(AT_FDCWD, {:?}, ..)", pathname);
+		}
 
 		// prlimit64
 		302 => {