From patchwork Sat Oct 5 23:33:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 833015 Delivered-To: patch@linaro.org Received: by 2002:adf:8b52:0:b0:367:895a:4699 with SMTP id v18csp1380016wra; Sat, 5 Oct 2024 16:34:37 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVxoV/M+UsLhZJoXhk7he5OyOYHZKPW/uc8dB9GAP5VUOkCp0DYsivx6kLiKIje4IF1NDoe8w==@linaro.org X-Google-Smtp-Source: AGHT+IHok4wXCWz+KJq4IZjZqs0DJ1QNPjig6OI9WyZeD2aHK9jUa3vf7ZuuNYfGyuTc9UKi9DPd X-Received: by 2002:a05:6214:46a1:b0:6cb:7e1d:c530 with SMTP id 6a1803df08f44-6cb9a4540e7mr133506666d6.19.1728171277140; Sat, 05 Oct 2024 16:34:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1728171277; cv=none; d=google.com; s=arc-20240605; b=cHz8/vh06Y7thhQCz5UDiqnv5mBvFUI2EP5fJh+aqb5TpQJ0++lcCJuUjVn4I4J/QW Os1/7y8e1PZ+5HDYDClS/DGrU7ZfRzo/ovph8tjSYUvCpEP8t1oH5mNPmeT7as76yzwi rfJNBNqTrz1LsnfAg6ZBJmz/Zls6CJQaSxglp393NuA8XgW3up26tH3hMb40HvPW4dLK O2rOCoy28kmAEXkon148UBM1M/OuCTG+4u14TvylHyV2EXNEhcsjSafN3weyCuPBJRvb B+YG/fmcuPz0RM6Ki2dV67ExdfrUJEKJMM8zilNRN9CTaiWajYsZYugPy1sPVXx9dHor qilg== 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=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=kXePtY4BylAP7RpF573a2c8CufuERgQ01dVpFC67ruFfXq/+wh7fezmPoCfrrOCy5C YKSAQnweyIUmmFqbYfBg1aomWZ6UbVwcoxqm8Zu/Is8+QKUFf15RhO38KeQ5m6Xr/nek atRFXjANfP0MmWdytWmUhbqLeyOxAgf3A0GcGPVa079yuuNbh10si36Avx6gO3tFBIx4 VtqTDbriShNop2uz6TKbLb+6mNtwiCnQjlG078Lj8gaXzzGakq6ORxhTGep4BItnRMXF kU8xkDCNL2jgoSYgeimFy3MNimCqg+yVtHuNN2xSOxvS0DOVtlLTN4xdk8p84rrjRaJp 2Y/A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="OFvV/hS8"; 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-6cba478ba22si30459366d6.467.2024.10.05.16.34.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 05 Oct 2024 16:34:37 -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="OFvV/hS8"; 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 1sxEHe-0006DP-OF; Sat, 05 Oct 2024 19:33:58 -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 1sxEHc-0006Cx-Px for qemu-devel@nongnu.org; Sat, 05 Oct 2024 19:33:56 -0400 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sxEHb-0004EP-9h for qemu-devel@nongnu.org; Sat, 05 Oct 2024 19:33:56 -0400 Received: by mail-pj1-x1032.google.com with SMTP id 98e67ed59e1d1-2e0a74ce880so2809062a91.2 for ; Sat, 05 Oct 2024 16:33:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1728171234; x=1728776034; 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=OFvV/hS8dqx0tGgAmQAqfe08dF1Ck76FYvyW7aMS9I/w3VdFZ85rcCSKF6MI+M0lml gvaaVXd+EU1YjIrhk14zkfgizwiXb4yeX08F9TuYbdy/u20qyLziGiDwcPraKSh63lkF L2QT+b09oUV5k1FieW2/i9JH8uy9L9Ugsdm8sX1iB49kGaChgwlnxgbI/CWr4bNvKJYI vOwUXTAEn78RH2ysVxjbWX84PTdGRr3SDhSw/Pnmwl06w0jE9SP+6+hkYrDKFczIvviH 38qTtLP50XpZiQHrKzbmWcQ6sHevxuqRjRzZYG78k2alINmb1e2pywVGQ4RTyxQ8f6MJ T+Uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728171234; x=1728776034; 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=FOl9kTUjwKdFnssOXnrZgQtJ3raNyT00wXaFL0BPjC0OYPH3WkpFzSxwaUosNPieyq +6NhVWbva1vhjW0VsJprmiNQjYGCFP86EztcjM2DGsbSgprQvs2/y3czD0sIqg+W3/Nd 06g2ATQZl4LHdKq+wozZjVRbGFwFY+JMuNHZOwZiGfNuybMNV6nCaEEVRjAJuD1yn0De XLGdNZqyTcAh4Kt1OyfGJkLo5wNLx6h2vo/WFPRybvldp3YRMUMNQFy2MrA9ibxCMXMV 0ErgDqV4JTimaD0bxMe+ggdLm6mZew1ZPN295P9IsrddV+cJLsrx0HGtrqmqYcxoDwjw tP/g== X-Gm-Message-State: AOJu0Yy4ATQwKGTj5jaA4Zg8ohCuF7DYzeyzscR23DFl9GuHXtoX9c4s cvRvkwm8tpWQ0cNb8anUt4kSbJ2J+zy9pYn5i522mdlpqKs92qosEXT0SUHeB2fzoKzInkEGfXm f X-Received: by 2002:a17:90a:2ecc:b0:2cf:fe5d:ea12 with SMTP id 98e67ed59e1d1-2e1e626c037mr9183719a91.24.1728171233936; Sat, 05 Oct 2024 16:33:53 -0700 (PDT) Received: from stoup.. (174-21-81-121.tukw.qwest.net. [174.21.81.121]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e20b129cc2sm2394600a91.51.2024.10.05.16.33.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Oct 2024 16:33:53 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 10/10] linux-user: Add strace for recvfrom() Date: Sat, 5 Oct 2024 16:33:43 -0700 Message-ID: <20241005233343.503426-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241005233343.503426-1-richard.henderson@linaro.org> References: <20241005233343.503426-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1032; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1032.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, SPF_PASS=-0.001 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 },