From patchwork Tue Oct 8 18:51:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 833610 Delivered-To: patch@linaro.org Received: by 2002:adf:a1d9:0:b0:367:895a:4699 with SMTP id v25csp450109wrv; Tue, 8 Oct 2024 11:53:08 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU3w0TMUVUQFxT2vKmVwMRpennCiV6Sq8hVTsnB/+RsYx8uTwPLiIefSqyxlRmKT3pO7UVPUQ==@linaro.org X-Google-Smtp-Source: AGHT+IHWMnsTDCWqlvx+ClbzGwUGPnQe9tUK/SE8bLjPP/HCLU5otWU5gN4GNx3L62gAwHEc8mkO X-Received: by 2002:a05:6214:4881:b0:6cb:c772:fbe5 with SMTP id 6a1803df08f44-6cbc772fc21mr25361066d6.30.1728413588003; Tue, 08 Oct 2024 11:53:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1728413587; cv=none; d=google.com; s=arc-20240605; b=T5hjjT92p6wJCEAfftuJ3U3b0r42XOgP5sQGo+UJd0BTcUyLafUuK2saJk68j/OhNz 4nO5s+/oqg+d8shD67ciw2xNimNci5gHqtb+OvThYO9WHl7s+nE7n/cBu8xh7V1SNS1a GoE4x7hvNvYzoAWacyHY6vwpsRdUd5s7blzzFzccYnkK3kIRl+z9Cef+TgG2GtZMRlAB 1saLssA+CEuEKqduL7AuzqYzMOHgSLmlTeTIxdwZD2fFtVVpX2uK9wpyoWFWPWCTVdst PzSbeuRWcGZPy5VGgOZFtx/eNy1xvY3nINT9V65btXuVhO1Jp3RplJHyySEbzFy/yyKJ DQkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=wYBWpQBnXZ27uF3GVfCeocPGkAYUMjeFh2ALsFccVN8=; fh=tTjTfh/QwbpfIJ40uL4jnZOzWTJn3vAziy+Fmyen6KU=; b=S/4ty8241rAxQ6b0KHrI+Yo5P7AlUwNOjOAvelkjdvTVi1opqgoXD4Z5anDKFd/mKF Ll+WnGre8VlljeGcnxtoxyv+3uWSxkJMaFLc7/beJdlyyOSFNof2w/kQf8LVx9+TBgaA vn7ZAPPpWN3MOKgHi4FWQGQkFipggIYIGC9JCmqOHAN9HfQ/EETCuXcUo/DboiGyHx+n ymFmdM8quUbGxavYdkds+1LjCDaJYm4D4sRAnoBzKfrtGjOw1cCGLzPCxh3nRF4eQ5aK kRQANCQtZSn8sWbAHBSG+dQFlZl5ZuFSMVLFmHJMS+cGDp5vCGJDU56LA8mMNOt5BTxr NuBA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KWP0Qrk8; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6cba46d7d9esi91869196d6.2.2024.10.08.11.53.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 08 Oct 2024 11:53:07 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KWP0Qrk8; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1syFJf-0007XR-Pf; Tue, 08 Oct 2024 14:52:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1syFJS-0007SP-RY for qemu-devel@nongnu.org; Tue, 08 Oct 2024 14:52:02 -0400 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1syFJL-0002T7-Ae for qemu-devel@nongnu.org; Tue, 08 Oct 2024 14:52:01 -0400 Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-71dfe07489dso2210912b3a.3 for ; Tue, 08 Oct 2024 11:51:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1728413513; x=1729018313; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wYBWpQBnXZ27uF3GVfCeocPGkAYUMjeFh2ALsFccVN8=; b=KWP0Qrk8sgrfWvJflShrddoSYkn0AoCoeq3iCKJ2KVRPqfvKS5IOAUYeHFBjn1arWu ILE5Rw8mYx4wcNGk1y2fBfbCMW+pIXH9QYQirGyaNNg1A58rZ+hNEwtABk5EPZEopvq0 YjlSZ4A69Ba2IRuse5XYUrXtE35eQYRNyjInlWE/IsS/nd9dSE8B0htKe5K1wP5ERmP3 k+lclaCf76NYOZmulzWILscuUbz4cgv4jb6bWZZkeNycekHKltptcDCIsOkKermGCXzq lDH3AxM+ySLOC03XzC/iEeLABayhHWCidXxh6bp0lT+Uw7hJn8ihqfUsdRBmlRdZtJ/r 6b0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728413513; x=1729018313; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wYBWpQBnXZ27uF3GVfCeocPGkAYUMjeFh2ALsFccVN8=; b=xBMvKeeE/Us1sCvCqW9pDIBi4GFKmvJf4XpeQ7qg45JxBqRxSHxSYUY+RTH82hBM2P FZNBxcsBW23Gdrhyp5zLJchKGgA+1VV5ZjkOMico50EGfoMfY0X3JFJj6T5qxZS8Ofmo BEJMSpqsVdAr6W1a5OdNNnuNn/FDpzffmQ5Mdl2EGjxyXnqn67XZEFWmquIRD/G4P507 GkWN8+Sc2EyVM6VpoZJzoRemtD/ZUs4Z++FE0hTHWlKjdJryjctu//4FeUaDnvHK715R JkIuXl1Qgq9cPlibdLI6Psr7qFiHNQQnguOAbuZlA+QXQibJL2Fc/dSVFgRHdwPVHDav TRUA== X-Gm-Message-State: AOJu0YzmocLBlF+sUhuKoD2Ai86fYHVEy8S4CJgEPoSLRra7nbLikw6u ThK1+bJhLzVFacuafECsSx4dCWcx5l8cIl+CcBRI/2yhNx4i7ik18QuksrqXg9ePgzELEz9zkce 0 X-Received: by 2002:a05:6a21:1798:b0:1d5:10c3:ae43 with SMTP id adf61e73a8af0-1d6dfa45775mr21831835637.21.1728413513002; Tue, 08 Oct 2024 11:51:53 -0700 (PDT) Received: from stoup.. (174-21-81-121.tukw.qwest.net. [174.21.81.121]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7e9f6821c32sm7186818a12.33.2024.10.08.11.51.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Oct 2024 11:51:52 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 10/14] linux-user: Add strace for recvfrom() Date: Tue, 8 Oct 2024 11:51:37 -0700 Message-ID: <20241008185141.20057-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241008185141.20057-1-richard.henderson@linaro.org> References: <20241008185141.20057-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::433; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x433.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé Signed-off-by: Philippe Mathieu-Daudé Message-ID: <20240807124306.52903-6-philmd@linaro.org> [rth: Do not dump output buffers.] Signed-off-by: Richard Henderson --- linux-user/strace.c | 17 +++++++++++++++++ linux-user/strace.list | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/linux-user/strace.c b/linux-user/strace.c index 0263e6a396..c3eb3a2706 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -3142,6 +3142,23 @@ print_bind(CPUArchState *cpu_env, const struct syscallname *name, } #endif +#ifdef TARGET_NR_recvfrom +static void +print_recvfrom(CPUArchState *cpu_env, 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_pointer(arg1, 0); /* output */ + print_raw_param(TARGET_ABI_FMT_ld, arg2, 0); + print_flags(msg_flags, arg3, 0); + print_pointer(arg4, 0); /* output */ + print_pointer(arg5, 1); /* in/out */ + print_syscall_epilogue(name); +} +#endif + #ifdef TARGET_NR_sendto static void print_sendto(CPUArchState *cpu_env, const struct syscallname *name, diff --git a/linux-user/strace.list b/linux-user/strace.list index 64d24e16d0..0d69fb3150 100644 --- a/linux-user/strace.list +++ b/linux-user/strace.list @@ -1138,7 +1138,7 @@ { TARGET_NR_recv, "recv" , "%s(%d,%p,%u,%d)", NULL, NULL }, #endif #ifdef TARGET_NR_recvfrom -{ TARGET_NR_recvfrom, "recvfrom" , NULL, NULL, NULL }, +{ TARGET_NR_recvfrom, "recvfrom" , NULL, print_recvfrom, NULL }, #endif #ifdef TARGET_NR_recvmmsg { TARGET_NR_recvmmsg, "recvmmsg" , NULL, NULL, NULL },