From 9c15e70086f3343bd810c6150d92ebfd6f346fcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Vilanova?= Date: Tue, 21 Jun 2016 15:52:04 +0200 Subject: trace: [*-user] Add events to trace guest syscalls in syscall emulation mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds two events to trace syscalls in syscall emulation mode (*-user): * guest_user_syscall: Emitted before the syscall is emulated; contains the syscall number and arguments. * guest_user_syscall_ret: Emitted after the syscall is emulated; contains the syscall number and return value. Signed-off-by: LluĂ­s Vilanova Message-id: 146651712411.12388.10024905980452504938.stgit@fimbulvetr.bsc.es Signed-off-by: Stefan Hajnoczi --- bsd-user/syscall.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'bsd-user') diff --git a/bsd-user/syscall.c b/bsd-user/syscall.c index a9fe8693c1..66492aaf5d 100644 --- a/bsd-user/syscall.c +++ b/bsd-user/syscall.c @@ -315,12 +315,14 @@ abi_long do_freebsd_syscall(void *cpu_env, int num, abi_long arg1, abi_long arg5, abi_long arg6, abi_long arg7, abi_long arg8) { + CPUState *cpu = ENV_GET_CPU(cpu_env); abi_long ret; void *p; #ifdef DEBUG gemu_log("freebsd syscall %d\n", num); #endif + trace_guest_user_syscall(cpu, num, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); if(do_strace) print_freebsd_syscall(num, arg1, arg2, arg3, arg4, arg5, arg6); @@ -400,6 +402,7 @@ abi_long do_freebsd_syscall(void *cpu_env, int num, abi_long arg1, #endif if (do_strace) print_freebsd_syscall_ret(num, ret); + trace_guest_user_syscall_ret(cpu, num, ret); return ret; efault: ret = -TARGET_EFAULT; @@ -410,12 +413,14 @@ abi_long do_netbsd_syscall(void *cpu_env, int num, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5, abi_long arg6) { + CPUState *cpu = ENV_GET_CPU(cpu_env); abi_long ret; void *p; #ifdef DEBUG gemu_log("netbsd syscall %d\n", num); #endif + trace_guest_user_syscall(cpu, num, arg1, arg2, arg3, arg4, arg5, arg6, 0, 0); if(do_strace) print_netbsd_syscall(num, arg1, arg2, arg3, arg4, arg5, arg6); @@ -472,6 +477,7 @@ abi_long do_netbsd_syscall(void *cpu_env, int num, abi_long arg1, #endif if (do_strace) print_netbsd_syscall_ret(num, ret); + trace_guest_user_syscall_ret(cpu, num, ret); return ret; efault: ret = -TARGET_EFAULT; @@ -482,12 +488,14 @@ abi_long do_openbsd_syscall(void *cpu_env, int num, abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5, abi_long arg6) { + CPUState *cpu = ENV_GET_CPU(cpu_env); abi_long ret; void *p; #ifdef DEBUG gemu_log("openbsd syscall %d\n", num); #endif + trace_guest_user_syscall(cpu, num, arg1, arg2, arg3, arg4, arg5, arg6, 0, 0); if(do_strace) print_openbsd_syscall(num, arg1, arg2, arg3, arg4, arg5, arg6); @@ -544,6 +552,7 @@ abi_long do_openbsd_syscall(void *cpu_env, int num, abi_long arg1, #endif if (do_strace) print_openbsd_syscall_ret(num, ret); + trace_guest_user_syscall_ret(cpu, num, ret); return ret; efault: ret = -TARGET_EFAULT; -- cgit v1.2.1