[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 04/10 v4] bsd-user: Implement strace support for pri
From: |
Sean Bruno |
Subject: |
[Qemu-devel] [PATCH 04/10 v4] bsd-user: Implement strace support for print_ioctl syscall |
Date: |
Sun, 8 Jun 2014 09:57:25 -0700 |
Signed-off-by: Sean Bruno <address@hidden>
---
bsd-user/freebsd/strace.list | 2 +-
bsd-user/strace.c | 19 +++++++++++++++++++
2 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/bsd-user/freebsd/strace.list b/bsd-user/freebsd/strace.list
index 3235f16..718357b 100644
--- a/bsd-user/freebsd/strace.list
+++ b/bsd-user/freebsd/strace.list
@@ -80,7 +80,7 @@
{ TARGET_FREEBSD_NR_getsockopt, "getsockopt", NULL, NULL, NULL },
{ TARGET_FREEBSD_NR_gettimeofday, "gettimeofday", NULL, NULL, NULL },
{ TARGET_FREEBSD_NR_getuid, "getuid", "%s()", NULL, NULL },
-{ TARGET_FREEBSD_NR_ioctl, "ioctl", NULL, NULL, NULL },
+{ TARGET_FREEBSD_NR_ioctl, "ioctl", NULL, print_ioctl, NULL },
{ TARGET_FREEBSD_NR_issetugid, "issetugid", "%s()", NULL, NULL },
{ TARGET_FREEBSD_NR_kevent, "kevent", NULL, NULL, NULL },
{ TARGET_FREEBSD_NR_kill, "kill", NULL, NULL, NULL },
diff --git a/bsd-user/strace.c b/bsd-user/strace.c
index b2633d0..e33dd4d 100644
--- a/bsd-user/strace.c
+++ b/bsd-user/strace.c
@@ -89,6 +89,25 @@ static void print_execve(const struct syscallname *name,
abi_long arg1,
gemu_log("NULL})");
}
+static void print_ioctl(const struct syscallname *name,
+ abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4,
+ abi_long arg5, abi_long arg6)
+{
+ /* Decode the ioctl request */
+ gemu_log("%s(%d, 0x%0lx { IO%s%s GRP:0x%x('%c') CMD:%d LEN:%d }, 0x"
+ TARGET_ABI_FMT_lx ", ...)",
+ name->name,
+ (int)arg1,
+ (unsigned long)arg2,
+ arg2 & IOC_OUT ? "R" : "",
+ arg2 & IOC_IN ? "W" : "",
+ (unsigned)IOCGROUP(arg2),
+ isprint(IOCGROUP(arg2)) ? (char)IOCGROUP(arg2) : '?',
+ (int)arg2 & 0xFF,
+ (int)IOCPARM_LEN(arg2),
+ arg3);
+}
+
/*
* Variants for the return value output function
*/
--
1.9.3
Reviewed-by: Peter Maydell <address@hidden>
- [Qemu-devel] [PATCH 00/10 v4] bsd-user: update strace syscalls and breakout BSD distros, Sean Bruno, 2014/06/08
- [Qemu-devel] [PATCH 03/10 v4] bsd-user: Implement strace support for print_sysctl syscall, Sean Bruno, 2014/06/08
- [Qemu-devel] [PATCH 02/10 v4] bsd-user: GPL v2 attribution update and style, Sean Bruno, 2014/06/08
- [Qemu-devel] [PATCH 01/10 v4] bsd-user: add HOST_VARIANT_DIR for various *BSD dependent code, Sean Bruno, 2014/06/08
- [Qemu-devel] [PATCH 05/10 v4] bsd-user: Implement new syscall print_sysarch and add strace support, Sean Bruno, 2014/06/08
- [Qemu-devel] [PATCH 06/10 v4] bsd-user: Implement strace support for __acl_* syscalls, Sean Bruno, 2014/06/08
- [Qemu-devel] [PATCH 04/10 v4] bsd-user: Implement strace support for print_ioctl syscall,
Sean Bruno <=
- [Qemu-devel] [PATCH 07/10 v4] bsd-user: Implement strace support for extattr_* syscalls, Sean Bruno, 2014/06/08
- [Qemu-devel] [PATCH 08/10 v4] bsd-user: Implement strace support for thr_* syscalls, Sean Bruno, 2014/06/08
- [Qemu-devel] [PATCH 09/10 v4] bsd-user: Fix syscall format, add strace support for more syscalls, Sean Bruno, 2014/06/08
- [Qemu-devel] [PATCH 10/10 v4] bsd-user: Add TARGET_HW_MACHINE TARGET_HW_MACHINE_ARCH for future use, Sean Bruno, 2014/06/08
- Re: [Qemu-devel] [PATCH 00/10 v4] bsd-user: update strace syscalls and breakout BSD distros, Peter Maydell, 2014/06/10