[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 02/16] linux-user: add tkill(), tgkill() and rt_s
From: |
Miloš Stojanović |
Subject: |
[Qemu-devel] [PATCH v2 02/16] linux-user: add tkill(), tgkill() and rt_sigqueueinfo() strace |
Date: |
Mon, 15 May 2017 16:59:42 +0200 |
Improve strace support for syscall tkill(), tgkill() and rt_sigqueueinfo()
by implementing print functions that match arguments types of the system
calls and add them to the corresponding starce.list entry.
tkill:
Prior to this commit, typical strace output used to look like this:
4886 tkill(4886,50,0,4832615904,0,-9151031864016699136) = 0
After this commit, it looks like this:
4886 tkill(4886,50) = 0
tgkill:
Prior to this commit, typical strace output used to look like this:
4890 tgkill(4890,4890,50,8,4832630528,4832615904) = 0
After this commit, it looks like this:
4890 tgkill(4890,4890,50) = 0
rt_sigqueueinfo:
Prior to this commit, typical strace output used to look like this:
8307 rt_sigqueueinfo(8307,50,1996483164,0,0,50) = 0
After this commit, it looks like this:
8307 rt_sigqueueinfo(8307,50,0x00000040007ff6b0) = 0
Signed-off-by: Miloš Stojanović <address@hidden>
---
linux-user/strace.c | 41 +++++++++++++++++++++++++++++++++++++++++
linux-user/strace.list | 6 +++---
2 files changed, 44 insertions(+), 3 deletions(-)
diff --git a/linux-user/strace.c b/linux-user/strace.c
index 8fb1b6e..f6f76a5 100644
--- a/linux-user/strace.c
+++ b/linux-user/strace.c
@@ -1901,6 +1901,20 @@ print_rt_sigprocmask(const struct syscallname *name,
}
#endif
+#ifdef TARGET_NR_rt_sigqueueinfo
+static void
+print_rt_sigqueueinfo(const struct syscallname *name,
+ abi_long arg0, abi_long arg1, abi_long arg2,
+ abi_long arg3, abi_long arg4, abi_long arg5)
+{
+ print_syscall_prologue(name);
+ print_raw_param("%d", arg0, 0);
+ print_signal(arg1, 0);
+ print_pointer(arg2, 1);
+ print_syscall_epilogue(name);
+}
+#endif
+
#ifdef TARGET_NR_syslog
static void
print_syslog_action(abi_ulong arg, int last)
@@ -2415,6 +2429,33 @@ print_kill(const struct syscallname *name,
}
#endif
+#ifdef TARGET_NR_tkill
+static void
+print_tkill(const struct syscallname *name,
+ abi_long arg0, abi_long arg1, abi_long arg2,
+ abi_long arg3, abi_long arg4, abi_long arg5)
+{
+ print_syscall_prologue(name);
+ print_raw_param("%d", arg0, 0);
+ print_signal(arg1, 1);
+ print_syscall_epilogue(name);
+}
+#endif
+
+#ifdef TARGET_NR_tgkill
+static void
+print_tgkill(const struct syscallname *name,
+ abi_long arg0, abi_long arg1, abi_long arg2,
+ abi_long arg3, abi_long arg4, abi_long arg5)
+{
+ print_syscall_prologue(name);
+ print_raw_param("%d", arg0, 0);
+ print_raw_param("%d", arg1, 0);
+ print_signal(arg2, 1);
+ print_syscall_epilogue(name);
+}
+#endif
+
/*
* An array of all of the syscalls we know about
*/
diff --git a/linux-user/strace.list b/linux-user/strace.list
index 6e33788..373d436 100644
--- a/linux-user/strace.list
+++ b/linux-user/strace.list
@@ -1155,7 +1155,7 @@
{ TARGET_NR_rt_sigprocmask, "rt_sigprocmask" , NULL, print_rt_sigprocmask,
NULL },
#endif
#ifdef TARGET_NR_rt_sigqueueinfo
-{ TARGET_NR_rt_sigqueueinfo, "rt_sigqueueinfo" , NULL, NULL, NULL },
+{ TARGET_NR_rt_sigqueueinfo, "rt_sigqueueinfo" , NULL, print_rt_sigqueueinfo,
NULL },
#endif
#ifdef TARGET_NR_rt_sigreturn
{ TARGET_NR_rt_sigreturn, "rt_sigreturn" , NULL, NULL, NULL },
@@ -1498,7 +1498,7 @@
{ TARGET_NR_tee, "tee" , NULL, NULL, NULL },
#endif
#ifdef TARGET_NR_tgkill
-{ TARGET_NR_tgkill, "tgkill" , NULL, NULL, NULL },
+{ TARGET_NR_tgkill, "tgkill" , NULL, print_tgkill, NULL },
#endif
#ifdef TARGET_NR_time
{ TARGET_NR_time, "time" , NULL, NULL, NULL },
@@ -1534,7 +1534,7 @@
{ TARGET_NR_times, "times" , NULL, NULL, NULL },
#endif
#ifdef TARGET_NR_tkill
-{ TARGET_NR_tkill, "tkill" , NULL, NULL, NULL },
+{ TARGET_NR_tkill, "tkill" , NULL, print_tkill, NULL },
#endif
#ifdef TARGET_NR_truncate
{ TARGET_NR_truncate, "truncate" , NULL, NULL, NULL },
--
1.9.1
- [Qemu-devel] [PATCH v2 00/16] Augment support for signal handling, Miloš Stojanović, 2017/05/15
- [Qemu-devel] [PATCH v2 01/16] linux-user: add strace for getuid(), gettid(), getppid(), geteuid(), Miloš Stojanović, 2017/05/15
- [Qemu-devel] [PATCH v2 02/16] linux-user: add tkill(), tgkill() and rt_sigqueueinfo() strace,
Miloš Stojanović <=
- [Qemu-devel] [PATCH v2 03/16] linux-user: fix ssetmask() system call, Miloš Stojanović, 2017/05/15
- [Qemu-devel] [PATCH v2 04/16] linux-user: fix mismatch of lock/unlock_user() invocations in rt_sigqueinfo() syscall, Miloš Stojanović, 2017/05/15
- [Qemu-devel] [PATCH v2 05/16] linux-user: fix argument type declaration of rt_sigqueinfo() syscall, Miloš Stojanović, 2017/05/15
- [Qemu-devel] [PATCH v2 06/16] linux-user: add support for rt_tgsigqueueinfo() system call, Miloš Stojanović, 2017/05/15
- [Qemu-devel] [PATCH v2 07/16] linux-user: add rt_tgsigqueueinfo() strace, Miloš Stojanović, 2017/05/15
- [Qemu-devel] [PATCH v2 08/16] linux-user: fix inconsistent spaces in print_siginfo() output, Miloš Stojanović, 2017/05/15
- [Qemu-devel] [PATCH v2 09/16] linux-user: add strace support for uinfo structure of rt_sigqueueinfo() and rt_tgsigqueueinfo(), Miloš Stojanović, 2017/05/15
- [Qemu-devel] [PATCH v2 10/16] [RFC] linux-user: add support for tracking the target signal mask, Miloš Stojanović, 2017/05/15
- [Qemu-devel] [PATCH v2 11/16] [RFC] linux-user: add target_sigdelset() and target_sigorset(), Miloš Stojanović, 2017/05/15