From patchwork Wed May 31 13:08:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 9757013 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BA9A7602F0 for ; Wed, 31 May 2017 13:17:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B72EA281F9 for ; Wed, 31 May 2017 13:17:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ABD512834A; Wed, 31 May 2017 13:17:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id EDD8E281F9 for ; Wed, 31 May 2017 13:17:15 +0000 (UTC) Received: from localhost ([::1]:59357 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dG3Ux-0005iq-1F for patchwork-qemu-devel@patchwork.kernel.org; Wed, 31 May 2017 09:17:15 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36782) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dG3Mj-0007Yv-L8 for qemu-devel@nongnu.org; Wed, 31 May 2017 09:08:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dG3Mi-0003ea-G0 for qemu-devel@nongnu.org; Wed, 31 May 2017 09:08:45 -0400 Received: from mail-lf0-x22c.google.com ([2a00:1450:4010:c07::22c]:35966) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dG3Mi-0003eK-8l for qemu-devel@nongnu.org; Wed, 31 May 2017 09:08:44 -0400 Received: by mail-lf0-x22c.google.com with SMTP id h4so8617308lfj.3 for ; Wed, 31 May 2017 06:08:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ijD14mMOkzFltBDkO8wSyZ5Zpp9Fj3UQ+yM7Z2lDFLo=; b=fh93b4fEFk1qhkDlJjAJZwRCzWRA9warSnxrfKFs5Oh/tsWScSmRv/sSj/1dMLS6zR zpTpMdLinuIkk5Tzp0ERyNvVPwOslUww3RGQhY3FNjax4Zv2fYlkbRrlX22lSyd5yJeX 0pf3khmI1nMYFDQmzdSxh25xb4hYPmXBiJKcM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ijD14mMOkzFltBDkO8wSyZ5Zpp9Fj3UQ+yM7Z2lDFLo=; b=W/rGCvc5XKmquLCzV8YFn1D3eaTQC+a4bqY9vIrU1YRsgxOUkiW1sR+7zSIsgCLSP5 hGUdMu7IT2PbQafdsQEKs01RXfbiBMkFn3CPlBQL4NhzqgIrlPfdhxOKQaDR7I3KwDY6 PuDnVBKVvqXtIqPo2NpBPE4NXEJ1P5+zlLgUE/p1cckcTBUUhUeN/n8ahwgDhkl8Bn3a 1UEOGMug0AHOBe3ih1t4WIONsqn4cRP+1CMEjsJokvHGn32zan4blhs7n0j8wTm4o/oI DVCK5GxWfSaVhjxJyeVQB340IolQGPacFNILzIKmrp6IoNjKRDinUv0PyeNNfIrDdAw0 kNaA== X-Gm-Message-State: AODbwcCsO9VkVrcHv9py/Vp3UpaG8itb3Kta+8bGRjAoFtS5D5wAebz6 aFTrolduA7W0rd4Yph2zSg== X-Received: by 10.46.21.79 with SMTP id 15mr8556985ljv.15.1496236122791; Wed, 31 May 2017 06:08:42 -0700 (PDT) Received: from localhost.localdomain (91-157-170-157.elisa-laajakaista.fi. [91.157.170.157]) by smtp.gmail.com with ESMTPSA id o101sm3741766lfg.3.2017.05.31.06.08.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 31 May 2017 06:08:41 -0700 (PDT) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Wed, 31 May 2017 16:08:20 +0300 Message-Id: <5162264e438cf5efcb101bc8030e5f76feb58635.1496234766.git.riku.voipio@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4010:c07::22c Subject: [Qemu-devel] [PULL 08/15] linux-user: add tkill(), tgkill() and rt_sigqueueinfo() strace X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?UTF-8?q?Milo=C5=A1=20Stojanovi=C4=87?= , stefanha@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Miloš Stojanović 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ć Signed-off-by: Riku Voipio --- 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 8fb1b6e252..f6f76a5bd4 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 6e33788a17..373d43689a 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 },