From 1f337530756e0fa5e95df6a093504b8c834679a6 Mon Sep 17 00:00:00 2001 From: V Date: Fri, 17 Jun 2022 06:41:21 +0200 Subject: ripple/minitrace: add set_tid_address, set_robust_list, and getrandom With this, minitrace has all the syscalls needed to run cc1. Change-Id: Iaeef58769f69d64e192af2270eb520e891daec94 --- ripple/minitrace/src/main.rs | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'ripple') diff --git a/ripple/minitrace/src/main.rs b/ripple/minitrace/src/main.rs index bc22563..3f0041f 100644 --- a/ripple/minitrace/src/main.rs +++ b/ripple/minitrace/src/main.rs @@ -273,6 +273,12 @@ fn check_syscall(process: &Process, entry: SyscallEntry) -> bool { } } + // set_tid_address + 218 => { + let [_tidptr, ..] = entry.args; + println!("set_tid_address(..)"); + } + // exit_group 231 => {} @@ -305,6 +311,15 @@ fn check_syscall(process: &Process, entry: SyscallEntry) -> bool { println!("newfstatat(AT_FDCWD, {:?}, ..)", pathname); } + // set_robust_list + 273 => { + let [_head, len, ..] = entry.args; + if len != 24 { + panic!("set_robust_list(2) len should be sizeof (struct robust_list_head), actually {}", len); + } + println!("set_robust_list(..)"); + } + // prlimit64 302 => { let [pid, resource, _new_limit, _old_limit, ..] = entry.args; @@ -319,6 +334,16 @@ fn check_syscall(process: &Process, entry: SyscallEntry) -> bool { } } + // getrandom + 318 => { + let [_buf, buflen, flags, ..] = entry.args; + let flags = flags + .try_into() + .expect("getrandom(2) flags don't fit in u32"); + let flags = GrndFlags::from_bits(flags).expect("unknown getrandom(2) flags"); + println!("getrandom(.., {}, {:?})", buflen, flags); + } + _ => return false, } true @@ -332,4 +357,9 @@ bitflags! { const TRUNC = 0o00001000; const CLOEXEC = 0o02000000; } + + struct GrndFlags: u32 { + const GRND_NONBLOCK = 1 << 0; + const GRND_RANDOM = 1 << 1; + } } -- cgit 1.4.1