From patchwork Tue Oct 22 08:11:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 1181139 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=vivier.eu Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46y60y6hn0z9sPh for ; Tue, 22 Oct 2019 19:21:38 +1100 (AEDT) Received: from localhost ([::1]:51484 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMpQ7-0005CZ-E1 for incoming@patchwork.ozlabs.org; Tue, 22 Oct 2019 04:21:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44280) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMpGS-00032V-E2 for qemu-devel@nongnu.org; Tue, 22 Oct 2019 04:11:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iMpGR-0005DD-Bv for qemu-devel@nongnu.org; Tue, 22 Oct 2019 04:11:36 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:59977) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iMpGR-0005By-1q for qemu-devel@nongnu.org; Tue, 22 Oct 2019 04:11:35 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MYe6H-1iZlhj3Ksd-00VjY1; Tue, 22 Oct 2019 10:11:20 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 09/11] linux-user/strace: Improve bind() output Date: Tue, 22 Oct 2019 10:11:02 +0200 Message-Id: <20191022081104.11814-10-laurent@vivier.eu> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191022081104.11814-1-laurent@vivier.eu> References: <20191022081104.11814-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:Xdd+r7GY/qZzaOF66zQ1MYlqJ3Y0zOwwi/ejhmnpZZtv+BToISa DS3E7xWtMLVHYM2wSWF0EXK+yxqAAVRV44JX1aV3QFCPfC1DHFsFbYxcz+bLTBPJqNU5eSa ntsBZ0JipY3pTVh7sgl6RBZV25mLT4vm5ftWsv9uipnvdwFGlzbj3iW32FcDWOlJyr6xlmC gitvG+q9kmngxt/J5wcxA== X-UI-Out-Filterresults: notjunk:1; V03:K0:fHu1Xq0zEe8=:+g8Or0jkTRy8yLVlsA23/r 2AwvEQrf/zP9uXV6cQOgKuJ21WFr5C4UuqYRBdRkMaXJxtuX6tjXnBoZSihSCGcmyCd6jXDYm WNR/hHMr6BB0h55saEANbyFLqumzTIMzc9KVAQ4RdSN1IdSAEwFqCJNSUbkJTPopWvmU++ezZ cUzygfiHmnK4gtwdCieP0l4943RkE0xEeU+E75zRLuhKrVOiBwB33Uqms1Dxm7/cyfcffZ2nE FFf7phTh0lbzSUzzVnWBpJcEPRW7LmN8rLGT4kwOo/B6JVxmJP53zqFptfVkPJGS1z3bubm+n 8JgK4s4QwqA5H4Az4XnCSAmVoSuqZEQXbSyJ3MPu8UnfZgpsqnqRgGD16CSlnbsEIKLXFRtGn k20S6lWejWf4WWMn37MYgYfM4Cboy0BYVdVNtCTIKpmOe49KBQD8wfjYZ+GjbqJkM+/CejRYY iHYObgpFJJPbKul//cBOclfxaGrSFHAhptkzav3Yq83LCp/G62HJKKcLnJxY3z4OiYQnTEEmE r+yxDljjLez8D2MUEjVZkZPDSPfap9xH1wVrF3YUqZyp8ZLndBcDdlSUkUIHW6toufa7Xys0J DVLlf2rcQWt1mRGtRDe/ayna3lAlQJdkZ/i8Uuv2YokALovXWzFreXfbjMPf2z6u0ftpYPKG+ YaOVHTJBd+OABtLktJf69G+VMTLOFqfF2XqFTfZtVcv+gGajgsZA4848goMRPpZP+dDiIodQ0 1LAtN+XYMWfUEUdII6U88J71I/+/TVL1oUyvQTsLAZ4TevjLWEDj9gYIacOU8ecFiNWp0H4c+ 4EgoCXZFJoTciD+sGs49sjgC6vyHd+dXr7CKcQIumuaJqKulSV1Ppd9tE5cKqd1EIBm+X8Pvm XM8PO/vGks9HFD1/2wDtYrPZiHYLUhQ9bta6a/4Gw= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 217.72.192.73 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Guido_G=C3=BCnther?= , Riku Voipio , Laurent Vivier , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé Tested-By: Guido Günther Reviewed-by: Laurent Vivier Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20191021114857.20538-8-f4bug@amsat.org> Signed-off-by: Laurent Vivier --- linux-user/strace.c | 15 ++++++++++++++- linux-user/strace.list | 2 +- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/linux-user/strace.c b/linux-user/strace.c index 0ce2b658a52d..cd92c77d3366 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -1707,7 +1707,7 @@ print_socket(const struct syscallname *name, #endif -#if defined(TARGET_NR_socketcall) +#if defined(TARGET_NR_socketcall) || defined(TARGET_NR_bind) static void print_sockfd(abi_long sockfd, int last) { @@ -2054,6 +2054,19 @@ print_socketcall(const struct syscallname *name, } #endif +#if defined(TARGET_NR_bind) +static void +print_bind(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_sockfd(arg0, 0); + print_sockaddr(arg1, arg2, 1); + print_syscall_epilogue(name); +} +#endif + #if defined(TARGET_NR_stat) || defined(TARGET_NR_stat64) || \ defined(TARGET_NR_lstat) || defined(TARGET_NR_lstat64) static void diff --git a/linux-user/strace.list b/linux-user/strace.list index 6f95466dc59d..1de4319dcf87 100644 --- a/linux-user/strace.list +++ b/linux-user/strace.list @@ -41,7 +41,7 @@ { TARGET_NR_bdflush, "bdflush" , NULL, NULL, NULL }, #endif #ifdef TARGET_NR_bind -{ TARGET_NR_bind, "bind" , NULL, NULL, NULL }, +{ TARGET_NR_bind, "bind" , NULL, print_bind, NULL }, #endif #ifdef TARGET_NR_bpf { TARGET_NR_bpf, "bpf" , NULL, NULL, NULL },