All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Miloš Stojanović" <Milos.Stojanovic@rt-rk.com>
To: qemu-devel@nongnu.org, riku.voipio@iki.fi
Cc: laurent@vivier.eu, Miodrag.Dinic@rt-rk.com,
	Aleksandar.Markovic@rt-rk.com, Petar.Jovanovic@rt-rk.com,
	yongbok.kim@imgtec.com, Milos.Stojanovic@rt-rk.com
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	[thread overview]
Message-ID: <1494860396-24930-3-git-send-email-Milos.Stojanovic@rt-rk.com> (raw)
In-Reply-To: <1494860396-24930-1-git-send-email-Milos.Stojanovic@rt-rk.com>

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>
---
 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

  parent reply	other threads:[~2017-05-15 15:01 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-15 14:59 [Qemu-devel] [PATCH v2 00/16] Augment support for signal handling Miloš Stojanović
2017-05-15 14:59 ` [Qemu-devel] [PATCH v2 01/16] linux-user: add strace for getuid(), gettid(), getppid(), geteuid() Miloš Stojanović
2017-05-15 23:33   ` Philippe Mathieu-Daudé
2017-05-15 14:59 ` Miloš Stojanović [this message]
2017-06-02 12:31   ` [Qemu-devel] [PATCH v2 02/16] linux-user: add tkill(), tgkill() and rt_sigqueueinfo() strace Peter Maydell
2017-05-15 14:59 ` [Qemu-devel] [PATCH v2 03/16] linux-user: fix ssetmask() system call Miloš Stojanović
2017-05-15 14:59 ` [Qemu-devel] [PATCH v2 04/16] linux-user: fix mismatch of lock/unlock_user() invocations in rt_sigqueinfo() syscall Miloš Stojanović
2017-05-15 14:59 ` [Qemu-devel] [PATCH v2 05/16] linux-user: fix argument type declaration of " Miloš Stojanović
2017-05-15 23:35   ` Philippe Mathieu-Daudé
2017-05-15 14:59 ` [Qemu-devel] [PATCH v2 06/16] linux-user: add support for rt_tgsigqueueinfo() system call Miloš Stojanović
2017-05-15 14:59 ` [Qemu-devel] [PATCH v2 07/16] linux-user: add rt_tgsigqueueinfo() strace Miloš Stojanović
2017-05-15 14:59 ` [Qemu-devel] [PATCH v2 08/16] linux-user: fix inconsistent spaces in print_siginfo() output Miloš Stojanović
2017-05-15 14:59 ` [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 14:59 ` [Qemu-devel] [PATCH v2 10/16] [RFC] linux-user: add support for tracking the target signal mask Miloš Stojanović
2017-05-15 14:59 ` [Qemu-devel] [PATCH v2 11/16] [RFC] linux-user: add target_sigdelset() and target_sigorset() Miloš Stojanović
2017-05-15 14:59 ` [Qemu-devel] [PATCH v2 12/16] [RFC] linux-user: fix sigismember() check Miloš Stojanović
2017-05-15 14:59 ` [Qemu-devel] [PATCH v2 13/16] [RFC] linux-user: add functions for working with the target signal mask Miloš Stojanović
2017-05-15 14:59 ` [Qemu-devel] [PATCH v2 14/16] [RFC] linux-user: add functionality for tracking " Miloš Stojanović
2017-05-15 14:59 ` [Qemu-devel] [PATCH v2 15/16] [RFC] linux-user: add support for multiplexing larger target signals Miloš Stojanović
2017-05-15 14:59 ` [Qemu-devel] [PATCH v2 16/16] [RFC] linux-user: add support for multiplexing signals in rt_sigqueueinfo(), rt_tgsigqueueinfo(), kill() and tgkill() syscalls Miloš Stojanović
2017-06-02 12:59 ` [Qemu-devel] [PATCH v2 00/16] Augment support for signal handling Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1494860396-24930-3-git-send-email-Milos.Stojanovic@rt-rk.com \
    --to=milos.stojanovic@rt-rk.com \
    --cc=Aleksandar.Markovic@rt-rk.com \
    --cc=Miodrag.Dinic@rt-rk.com \
    --cc=Petar.Jovanovic@rt-rk.com \
    --cc=laurent@vivier.eu \
    --cc=qemu-devel@nongnu.org \
    --cc=riku.voipio@iki.fi \
    --cc=yongbok.kim@imgtec.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.