From patchwork Wed Aug 7 12:43:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 817394 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e11:0:b0:367:895a:4699 with SMTP id p17csp372442wrt; Wed, 7 Aug 2024 05:43:53 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUXuMjZnkbGsPA0b9LyNcois/ISsLR0pxYpiPL62826Llf7fU3c7Z4sPMcv8agmuqlQ2I622mYzKouR1IHbFFvP X-Google-Smtp-Source: AGHT+IHpG0HvDTkx1pW803HObaKeBCgnim60ov6OqiFhdQyyMAKYzWQP/FJrjM59JbOPfWpkR5Mz X-Received: by 2002:a0c:f208:0:b0:6bb:b274:fc18 with SMTP id 6a1803df08f44-6bbb274fc43mr74625576d6.29.1723034632914; Wed, 07 Aug 2024 05:43:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723034632; cv=none; d=google.com; s=arc-20160816; b=ewvePETojwvB++SQ//OtGmzWI1s1SXQ+0ZKjRbPPesrf8jEJNma1FjhkPv8qLOP6qk nnZeIJXaUGAMiJwTC7ocf801Ntiyu2sQr0rmY17YN3+PlL5LfY6AehjOEJJbKL6DLHUd zLntqrkjBl00bwPZZGHkIXx5Hgr7jImjR2XtwtkxDogYQH/0DfiJv3ZGtRXRGDnWJmZn A91/V7bDKtWESgCH4vRo7hNTvAjT2iDvbvfxKLMltBcrhYDNLN0vfYkRD+7XLz1hDwBj qD6hzREA9uVcfi/rlWn72CItbSLjJNovsTdnygkBUC0a4f3jbghPRCpI42sm47xMSKbY B1/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=RpWIKWWe5ixWDtiVxOKLp+Lsc4k9VqF1doDZjHB6Yj4=; fh=jTKErOgIgUXnQ30600P+KUWUvJ+nHsfx79XFM+bIdfI=; b=e46bZZZq2QYNrtEuCoKPS7vuMnVWeXUoVOIpp8yYq/x3c23slLKBsVwImGOQoaPiXn yMfYIemGjfzM7eiuefBgoGST4bhwpyVgEwwrrdKM2gMpFGDrfBXi/k83ng2biBrKUIti IcaD7Xjx/xkM0MnOCYNquxmUbcjTgTSVwHLeLswU9BH0GtZYY9eVBQX8X/fJoat6Qw1p 3vZuPxlpFq2u5QeRHYXL/UGi945CqVcMmiSUUUYiEgeW9aUZgFXum3DpN5mgYLV3peBI 21znHB7JVZ5hNJku87Qtu/QzWVoyNHE+OEXJa7ShxDo3FX0V9wQfAXkgF50A9bHL+VdL 5v8w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IInkAKM1; 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-6bbbb5f7e6esi17588176d6.71.2024.08.07.05.43.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 07 Aug 2024 05:43:52 -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=IInkAKM1; 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 1sbg0y-0000T6-Pn; Wed, 07 Aug 2024 08:43:40 -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 1sbg0v-0000F8-HV for qemu-devel@nongnu.org; Wed, 07 Aug 2024 08:43:37 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sbg0t-0005PZ-SA for qemu-devel@nongnu.org; Wed, 07 Aug 2024 08:43:37 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-42817f1eb1fso11750855e9.1 for ; Wed, 07 Aug 2024 05:43:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723034613; x=1723639413; 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=RpWIKWWe5ixWDtiVxOKLp+Lsc4k9VqF1doDZjHB6Yj4=; b=IInkAKM10xipG/W6k2wTx+SRbrzWQJ87K115O67elcap3eDAka9ULldzrCN/no1z+U H6lgQfTJ/SciAR7V4NQGxTOl564byowSxdSyFhF8Tc0eZLpnGCJnx9PuHUDDYHekcps/ gOkYet81qs8hfw9zg/eSrIPlbKw9wM8JTxSdAQxaUNlPZ0wpw7TU4KllXiW+OFB7eklo BSR349nFkOsrzLGJcaux/kdCII+lHvvqCLp2HNOucEQRErYNI8IJY/uLQJ6v45NGIPZo dCI23gA3n4wZUPc7vF6eI/nzZdm0lxwNhXwhQOMG6hmz65UsGqO6/dLjNDUSTelk3WwX UDRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723034613; x=1723639413; 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=RpWIKWWe5ixWDtiVxOKLp+Lsc4k9VqF1doDZjHB6Yj4=; b=HxJFq6ub+mx2C0DM0QIgl/I/SutRNFYKEQYJsSGrrB19s+NLl6uHIuuUnwPe44nD0h PZu9BuI5Ta8J5oApxTW+mMsO5BlAPeR1qIo3yTEEl5uov78BhiObE+gOkBu5epev9mbU hOE0iRMxWmS4KePAN7ESI67PvyQILZe556KMK2nVzzPiFFF31mA/CAR7LoUfvW7BqUX4 ypJqH29ldTz5KSO9EeViy5cWLmtN6YA8VKZT0o1ohfwll0eGuOHq7hiRzMeBa16+8cHh lJXQqZTFrkdUUSqRKAyTH0eE7ulBH8k327f8TikMyT4gSOpTNtxwAVFFyj8ql0CsUvyh weFQ== X-Gm-Message-State: AOJu0YyLGeIGD8JWdw7j3SK4hOktQKOjt9W4/cXoDJEbWxQSgBylG8dC auFVWRYHDhyoIL/x4V7RM4Xyd0MyfSisf3+Y3E2855W+Q9fmfL8FfFimAw/1T04FQyxgha36d94 D X-Received: by 2002:a05:600c:154c:b0:426:6389:94c4 with SMTP id 5b1f17b1804b1-428e6b956edmr116126765e9.37.1723034613204; Wed, 07 Aug 2024 05:43:33 -0700 (PDT) Received: from m1x-phil.lan ([176.187.212.120]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4290580cf79sm27443265e9.48.2024.08.07.05.43.31 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 07 Aug 2024 05:43:32 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Zach van Rijn , Richard Henderson , Laurent Vivier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v3 4/5] linux-user: Add strace for sendto() Date: Wed, 7 Aug 2024 14:43:05 +0200 Message-ID: <20240807124306.52903-5-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240807124306.52903-1-philmd@linaro.org> References: <20240807124306.52903-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.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 Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Ilya Leoshkevich --- 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 210ff86afc..98ef26b917 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -3127,6 +3127,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 dfd4237d14..5a86419e7d 100644 --- a/linux-user/strace.list +++ b/linux-user/strace.list @@ -1285,7 +1285,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 },