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>
This commit is contained in:
Miloš Stojanović 2017-05-15 16:59:42 +02:00 committed by Riku Voipio
parent 65424cc456
commit 5162264e43
2 changed files with 44 additions and 3 deletions

View File

@ -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
*/

View File

@ -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 },