From patchwork Sat Oct 5 23:33:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 833020 Delivered-To: patch@linaro.org Received: by 2002:adf:8b52:0:b0:367:895a:4699 with SMTP id v18csp1380173wra; Sat, 5 Oct 2024 16:35:31 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUiBK7Z2MT2oKFWF+EVfI5VfB5AI2OLA78X+332rZWlSf44VGadjxMP+XQ4ShvEaBDgtqqX6w==@linaro.org X-Google-Smtp-Source: AGHT+IGYxw2eEElsDT1bqZguudrh+fRjMhydCHRcWlaoyF1JJVuSZekAufC4jViE4Ktt/9uKbTG2 X-Received: by 2002:a05:620a:454e:b0:7ac:b93b:b250 with SMTP id af79cd13be357-7ae6f3b23cdmr1141454085a.0.1728171331230; Sat, 05 Oct 2024 16:35:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1728171331; cv=none; d=google.com; s=arc-20240605; b=N85fsLt8iLuL/4MzCnPyJg+eBH/8xh+u7a6k1ycyaLrKpihdZlMMY50RqDbH/CeJTo Rg2zC6sEqaft3GJsC2Mio5eAirKtfWCh/kPBAC2S7xuPHnZnRZDMqshJCIcNCPcTbmf+ /Q5YolzJ1GKgjw1Ij7k1tMmQq7fSgYDPRcxzsbW2H4SomUPmMIIk1/oYrdp0a3vnpjuD DpfSZQMgcDd2/xfAg7rJhC8vq4/yOuUNoCOm1lXCBcQkC9c7lvyAqoYYNebWhlYJuwgO uv08o58tIbImZNwFc6kHDNOKeNbldrh9J7eI6YeZ1Ixhvq6un13CEkLILarzaltEKmqt JNEg== 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=F2PtOJCUNqbnhgRp0PzmkQFuI5aOsUosexzj1Se6aBs=; fh=RZjZOy5+Yj9WJfOPbqEaL9dDAfIcQQit8cKdQSuDgDE=; b=dlIB0nslKRl9NS7bxn6eIifAfDL6GAG3AJjnD2JYk502djtjsfILd2pQbeMbu7kKik t0LJMf+cOtcWwbLhNMhS+KySJmmqCmAngt6nBd/jeT3Ugb/xY9GdJ6w1nGkHy56ivCoL ILNLbLzxzFdLK9GMpO428d7JN5WbDyhEC+Aufb4z9NSFoUXr4Zd5P0kYYHXj9xSNMnbY hLtnxPlJCNhIuotkIpH1sMR0dTDsRfGgryJ7IoZbxas4KGf8PaFPa9YEFIGQB2xXQtGW KTCYdkJF2Q91lHNEM5G6/Tvg6jOaDmnl/Z3r1uNopckb7AZfa+FZzrlbCAHk9itwMxYM netQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=murOCSQ8; 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 af79cd13be357-7ae756166c2si285698485a.108.2024.10.05.16.35.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 05 Oct 2024 16:35:31 -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=murOCSQ8; 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 1sxEHc-0006Cy-RN; Sat, 05 Oct 2024 19:33:56 -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 1sxEHb-0006CZ-Vu for qemu-devel@nongnu.org; Sat, 05 Oct 2024 19:33:55 -0400 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sxEHa-0004E9-Iu for qemu-devel@nongnu.org; Sat, 05 Oct 2024 19:33:55 -0400 Received: by mail-pj1-x1033.google.com with SMTP id 98e67ed59e1d1-2e18293a5efso2300546a91.3 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=1728171233; x=1728776033; 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=F2PtOJCUNqbnhgRp0PzmkQFuI5aOsUosexzj1Se6aBs=; b=murOCSQ8hvhLMnhb+ESpSC/KB1TUufVo5XSJYWzRjqR+uvh3o85zUl2TE3N+SRELf4 QGqGWr4WjNbsW20meFia20Par8gr61SmRv12GjOH3lndGtfw4hEIKFJ9/amQe1ycR0w9 wfsYyUbpm3m0b6mJxP/zLZEuYlggmybWgHYRWUhP3mIolkvF72NSJmobMBfu8NOsTzIP oRgz6LqskXK3bA3BKfjuMJRSR4YcKpxMqU5CDQp/sSiwXZ22CiqQtljEuKXnuQKmWtiI LaU74yMLPl9YxEldA+7JTlWA7LXBhcLi2do2FacysBuUD0bD4Lw/+DjLb7js7gCYmbm4 Sd+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728171233; x=1728776033; 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=F2PtOJCUNqbnhgRp0PzmkQFuI5aOsUosexzj1Se6aBs=; b=ORKEcWCZxyKPGp83E9MvyDADb8n8FZb+5ZaFPVdmErzXhXvLl+BqaMsqZ75JUom6sc 09GkiVwM6hKoENJ60IR2PTTLYFso6cj8T99T+Lh5ukiilf6bdwjDMraChpcsaFukkNql qiVds7LchBFDarOK10simtq9rFfL1wq1OvEWqM5IYKn+5g3+jV28QOETYd4P6igyPE4f K+lL53nhEn/HMMiCgUfPeE8NbDo2bPBq8Mrk7m7kbZKYYCPJ+41m8Y6FO31IWkMDy+Yz fUkJG0UgV2QW1F261iUT0dKPP1qeHC3CIu8AIiwZlM+SfReCw5G5i+xiIP26ITbJPFW3 Uv3A== X-Gm-Message-State: AOJu0Yy0IlNt3N4nt8zRSQoqRReHTk7Mbjjq2HmUuXH8EZOnxUn9V7Fu yguxeKHryYBlsHIiqO/Xy2P6ECVKkr6IsQ1lOysKb4T5WS5RGmBRZ1laHS5/vHPV0EmM41EchDL q X-Received: by 2002:a17:90a:f40a:b0:2e1:e433:767e with SMTP id 98e67ed59e1d1-2e1e631e566mr9485663a91.28.1728171232947; Sat, 05 Oct 2024 16:33:52 -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.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Oct 2024 16:33:52 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Ilya Leoshkevich Subject: [PATCH 09/10] linux-user: Add strace for sendto() Date: Sat, 5 Oct 2024 16:33:42 -0700 Message-ID: <20241005233343.503426-10-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::1033; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1033.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é Reviewed-by: Ilya Leoshkevich Message-ID: <20240807124306.52903-5-philmd@linaro.org> Signed-off-by: Richard Henderson --- linux-user/strace.c | 15 +++++++++++++++ linux-user/strace.list | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/linux-user/strace.c b/linux-user/strace.c index 245153c1ce..0263e6a396 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -3142,6 +3142,21 @@ print_bind(CPUArchState *cpu_env, const struct syscallname *name, } #endif +#ifdef TARGET_NR_sendto +static void +print_sendto(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_buf_len(arg1, arg2, 0); + print_flags(msg_flags, arg3, 0); + print_sockaddr(arg4, arg5, 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 f8899710b5..64d24e16d0 100644 --- a/linux-user/strace.list +++ b/linux-user/strace.list @@ -1288,7 +1288,7 @@ { TARGET_NR_sendmsg, "sendmsg" , NULL, NULL, NULL }, #endif #ifdef TARGET_NR_sendto -{ TARGET_NR_sendto, "sendto" , NULL, NULL, NULL }, +{ TARGET_NR_sendto, "sendto" , NULL, print_sendto, NULL }, #endif #ifdef TARGET_NR_setdomainname { TARGET_NR_setdomainname, "setdomainname" , NULL, NULL, NULL },