aboutsummaryrefslogtreecommitdiff
path: root/linux-user
diff options
context:
space:
mode:
authorMiloš Stojanović <Milos.Stojanovic@rt-rk.com>2017-05-15 16:59:42 +0200
committerRiku Voipio <riku.voipio@linaro.org>2017-05-29 14:56:08 +0300
commit5162264e438cf5efcb101bc8030e5f76feb58635 (patch)
tree3a5d500d931187037a47c8f5f1bc5f200080c0cc /linux-user
parent65424cc45696768442c684c1202d21b7f73f1156 (diff)
downloadqemu-5162264e438cf5efcb101bc8030e5f76feb58635.zip
qemu-5162264e438cf5efcb101bc8030e5f76feb58635.tar.gz
qemu-5162264e438cf5efcb101bc8030e5f76feb58635.tar.bz2
linux-user: add tkill(), tgkill() and rt_sigqueueinfo() strace
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ć <Milos.Stojanovic@rt-rk.com> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
Diffstat (limited to 'linux-user')
-rw-r--r--linux-user/strace.c41
-rw-r--r--linux-user/strace.list6
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 },