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: 100757 Delivered-To: patch@linaro.org Received: by 10.182.202.35 with SMTP id kf3csp296356obc; Wed, 31 May 2017 06:16:24 -0700 (PDT) X-Received: by 10.55.181.194 with SMTP id e185mr27286581qkf.195.1496236584931; Wed, 31 May 2017 06:16:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496236584; cv=none; d=google.com; s=arc-20160816; b=CbVlCzKkLNokJ0L2IMLl96ff3leSb9Xsr9sZQ8PA8bI0yelDKzxkDSlMHQLLz2mlQ6 6UXzGhKYSHOlElVo/hpJurnux8jU7shAlBFnQkZ8pwp5J23EkHgKtEjlPanSVFmLAuUf 7fdpEWZ07PcX1HMPlL5mtZcoapmKzobqVQltV5A1nkPx7eXI1NfdetKmI58/CUdd0uIK 1DvZulwczb1Xjh21pE84t2ndiw038C1QJV8iyAXO7hGCd1QJP3Pw33xQx7Y6jiJNWR+8 7IItbWzebhfiujNJtSbBauBfdzRAT9NiE0Awski6URUH2MeEZaMAWc50tpcqVyKeaMfh 3BzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=ijD14mMOkzFltBDkO8wSyZ5Zpp9Fj3UQ+yM7Z2lDFLo=; b=HwLngKnOhLJrPbPM9VthUIfytAiaSR9LZJfR+oFDmNjP/y8VFXX7fNsPl5TZz6M7IN 68DdTSa3yLQ2+ueMXKj/LISPSAAUz9H3+QDnYFvdZ379Up9sR/DoFo8n500tTVGv+nEi fy+A+kXfgSuRtdbqKz8+cn5nGfYIbZfc5ohcRt51ZzQ+3XfWuGrGB+IAcv+XtKwhDP6Y u2OQjjZKZ2BIi5n0OV0iaGF0KzXGjiOxkv9wh4OzpI29essQbgq3nU9+1ansWpBfKDw/ HN0KjIcSH92NzvOIZorzWNGDxZefchNUPgPRptgMTkI4+s1et0T20GrWi2I/KBT9DDPC 4mMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id k28si16411234qtf.298.2017.05.31.06.16.24 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 31 May 2017 06:16:24 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:59357 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dG3U6-0005iq-9M for patch@linaro.org; Wed, 31 May 2017 09:16:22 -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?b?TWlsb8WhIFN0b2phbm92acSH?= , stefanha@redhat.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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(-) -- 2.11.0 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 },