From patchwork Tue Jun 28 19:12:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 641715 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rfG7m5qF0z9s1h for ; Wed, 29 Jun 2016 05:28:52 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b=YnJkP7Xb; dkim-atps=neutral Received: from localhost ([::1]:39063 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHygk-0004TB-Lh for incoming@patchwork.ozlabs.org; Tue, 28 Jun 2016 15:28:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38492) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHyRm-00022v-2o for qemu-devel@nongnu.org; Tue, 28 Jun 2016 15:13:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bHyRj-0006us-Vi for qemu-devel@nongnu.org; Tue, 28 Jun 2016 15:13:20 -0400 Received: from mail-lf0-x231.google.com ([2a00:1450:4010:c07::231]:33283) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHyRj-0006uj-NT for qemu-devel@nongnu.org; Tue, 28 Jun 2016 15:13:19 -0400 Received: by mail-lf0-x231.google.com with SMTP id f6so18203097lfg.0 for ; Tue, 28 Jun 2016 12:13:19 -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; bh=oKb8VU1X/WCzdastpKqxCYU33dSTK4d4XHnYuBDW8G4=; b=YnJkP7Xb0BNwsYJrZ6pP+c5EsgP/cv1s/l6dkUZmpkYgAb0d2MPMft6CYsoPUW/hsg mR3l0FI67tbxSBg523VLSNAaov7BIUZoX9RIgHfg+Y1cPYdE6h7ldn5J5CJRHQTBXtCo Zb/D9YLkblcipuPjXg7N9M2DNletD9EQeYSug= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=oKb8VU1X/WCzdastpKqxCYU33dSTK4d4XHnYuBDW8G4=; b=jqGu25ErKn4E3iPEyVAvs2UzitHGSfjiAq4lEjhJe4k5rKpeVfXJ3eumPkxxdPJpL1 LXALq/0C0PgMZT/NS+FCyezo2aid6+HY31BmaHBuKaZBjgOpl78x+jG6Z1tIS3nChrO5 vsaYjPcHlXN1mE8kaWInQWhWSZa8RikESbXw+C127sawDOfoMoSBfQTIUkIBvTnVxVkj m6zNUcGKeicMRWNwzGmJU34AufAaMfxOM4F8mmX/vWDH2aTKE8SLdaE3v/eJm9TbEg8v Tv+OoDjFPuLMd8/5RU/ApLjnjIfUu3YSQHKp9LwW4/duedtoF3j8YeH0lQxnbCSLgQ/4 lhQA== X-Gm-Message-State: ALyK8tI57iPawE30CC+wfJF2xsQ+5ARZAQNwnJf+GNbZ0NN04Twm6X8TSG978Lb1wRg3Alin X-Received: by 10.25.16.96 with SMTP id f93mr1790475lfi.114.1467141198781; Tue, 28 Jun 2016 12:13:18 -0700 (PDT) Received: from beaming.home (91-157-170-157.elisa-laajakaista.fi. [91.157.170.157]) by smtp.gmail.com with ESMTPSA id h10sm4262823ljh.38.2016.06.28.12.13.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 28 Jun 2016 12:13:17 -0700 (PDT) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Tue, 28 Jun 2016 22:12:47 +0300 Message-Id: <8997d1bd180ac268fe4bacfa5f0a38ed75809498.1467138806.git.riku.voipio@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c07::231 Subject: [Qemu-devel] [PULL v2 13/24] linux-user: add socket() 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: Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Laurent Vivier Signed-off-by: Laurent Vivier Signed-off-by: Riku Voipio Reviewed-by: Peter Maydell --- linux-user/strace.c | 23 +++++++++++++++++++++++ linux-user/strace.list | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/linux-user/strace.c b/linux-user/strace.c index c8df76f..95f4338 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -1227,6 +1227,29 @@ print__llseek(const struct syscallname *name, } #endif +#if defined(TARGET_NR_socket) +static void +print_socket(const struct syscallname *name, + abi_long arg0, abi_long arg1, abi_long arg2, + abi_long arg3, abi_long arg4, abi_long arg5) +{ + abi_ulong domain = arg0, type = arg1, protocol = arg2; + + print_syscall_prologue(name); + print_socket_domain(domain); + gemu_log(","); + print_socket_type(type); + gemu_log(","); + if (domain == AF_PACKET || + (domain == AF_INET && type == TARGET_SOCK_PACKET)) { + protocol = tswap16(protocol); + } + print_socket_protocol(domain, type, protocol); + print_syscall_epilogue(name); +} + +#endif + #if defined(TARGET_NR_socketcall) #define get_user_ualx(x, gaddr, idx) \ diff --git a/linux-user/strace.list b/linux-user/strace.list index b379497..7c54dc6 100644 --- a/linux-user/strace.list +++ b/linux-user/strace.list @@ -1291,7 +1291,7 @@ { TARGET_NR_sigsuspend, "sigsuspend" , NULL, NULL, NULL }, #endif #ifdef TARGET_NR_socket -{ TARGET_NR_socket, "socket" , NULL, NULL, NULL }, +{ TARGET_NR_socket, "socket" , NULL, print_socket, NULL }, #endif #ifdef TARGET_NR_socketcall { TARGET_NR_socketcall, "socketcall" , NULL, print_socketcall, NULL },