From patchwork Tue Oct 8 18:51:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 833622 Delivered-To: patch@linaro.org Received: by 2002:adf:a1d9:0:b0:367:895a:4699 with SMTP id v25csp450850wrv; Tue, 8 Oct 2024 11:55:11 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWDak5iA2iwXocAeDN+LsO/xtupUPrZGb7rW1HctZ0yW+NoYY11YwUcOKZaYe+o3lR+atJIug==@linaro.org X-Google-Smtp-Source: AGHT+IEQaB/o0VyyadXtGcAKLCsESI3x9NfWfl9s7JFIStn8zvNrqaVXenbUlw4I64WBLFIxV4wv X-Received: by 2002:a05:6902:2503:b0:e1f:ebc5:22cb with SMTP id 3f1490d57ef6-e28fe40cb36mr115615276.27.1728413710790; Tue, 08 Oct 2024 11:55:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1728413710; cv=none; d=google.com; s=arc-20240605; b=lFaITd+d3JLIFXPdxj30ahbriAGoC8P02jy3w5wzfVDXdkW537DazOL+lk0PPw+xVG wHSX0VXEz+VqJ4XK7n6BAnVjIlGpikymoo0GXK8bOhY1C17xBfG6LCpCa0OrX+hDHTat 1CUoRQ2I3ncxYaN1hPh7JjE1OlbfxreytAVlpwmkz5gD6R36/Sv9hy6OZMhRiS6fmcfx GiJ42zc9BNVOs29qJX/c+IIm7gaCxUJU9besWHxFIzrTVQ/FaEt66DRFv5rSOdrXvu0g 6GNDCLlLyg3iqcCsztJozTg4JGq/VD/9vfrjhfU0avlGeNIgKxWjaBbnPx1b3XqgJfcX WTtg== 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=VA5fFQhEMLAFY8N/eU6MrxAxygDfRSReAsnt7AOK3f8=; b=CfLc4NbXu+LoBFiN1gnrdlZTR0u5qGGkGy7oRaTktraNi19aMiUoLbYcFhZb3zsP8y YUKIWxTa2/hiOqKXsiXsu9pI5M6JAmIgwdr5izHlbQBO2+dtaBtWjke3zl3uo32nccdC VF5TxDVlJPpbb39g4hTFP/cEtWvem0ug//OZupj7EbT3fldkt/wm/XEO4lz7Qns5DI4d Q7KikRGBfC/PjMvUu1lZl39M+D+eUAEyB3J1k4W4JenFLxifefNdOwHlG8VuoqgTa+zN 5DTXpqApnbIFEa/AQrZRR7PaBAHFD2+5y9aK7h2Dx4wthdQlDEjIhZNTO95sc9tHZH5O UoUw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rW11cEZL; 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-7ae756625b1si893133985a.251.2024.10.08.11.55.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 08 Oct 2024 11:55:10 -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=rW11cEZL; 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 1syFJc-0007Uk-BE; Tue, 08 Oct 2024 14:52:12 -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 1syFJP-0007Qs-RE for qemu-devel@nongnu.org; Tue, 08 Oct 2024 14:52:00 -0400 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1syFJL-0002Sm-A1 for qemu-devel@nongnu.org; Tue, 08 Oct 2024 14:51:58 -0400 Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-71e050190ddso1813995b3a.0 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=1728413512; x=1729018312; 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=rW11cEZL+xp2lpFZYILKRLIQUxuRNA5t6Hg9xYgR2mhJXrnWNZaCCWXXlgZrZmiPfq 09I04DChgsdEo+qjKvstqELJSR1I12az6My/jKaoeiyNzyHQBoK5Ja7820wn/4XqyCoD yQpGiG0Skng1w08gQ5HxX1x/z+2EGzIIKyO9Zi2W3399TAr2phh6HgE9GjjaLP2uA7d4 Ocl04hyJKEKTpeKChaHcUrAFkh1Dfu/+HZvXWC/5tw9hy/c7IdgaBlImU4K/AQAywmCx w4XIujp2fvvoB7I0x5r2eft3iM42wafVMA4EroV1h65FMh5/z/uWRjSJ3AkfFebwROI7 cUVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728413512; x=1729018312; 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=OUfSaTHg9Z7DBQqiSOjp1UGyP9C9Ywgp5bN0jJUzkVNKRu35FDXcATrPA/VY9OG/vf KYwio+nkxDEPUK7/DDwUVIHERaqM5rBT6cYX3j8kM9TJ05o9BKjDslP1ZdMROBYbqSjD vax48R4JwkZYhlH+0qYkHOCawBpmkqEnpaVmNrCUdwnQ83fxxE02OmbrZC+bbzOdwf0j sKC/cK1sG+JbIa02gi5zZwecI3EIaAw1WjEvebE3tx2kKoxPtx6YTfYgk9EAIRDG6vQk imw2Kvt6ak8wjQfquTaJlxCB+Op6qaJWk3htC+JPDOQsJfBN/jViOQ6Kzo46CEdoaKLM MJWw== X-Gm-Message-State: AOJu0YxPw02RzKT6MlBa/+3H0lMtf31jtZDwpyrakkMnJSFLq82oeQPo 6pVJkTsCUP9C2a/C4LV6sD1pSu07dicSh01ASGopdiafbBFniSfmayuGCv9HWjGQjE3qgr1SHQp 9 X-Received: by 2002:a05:6a20:d492:b0:1d2:f124:a1cb with SMTP id adf61e73a8af0-1d6dfa27999mr24547657637.9.1728413511984; Tue, 08 Oct 2024 11:51:51 -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.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Oct 2024 11:51:51 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Ilya Leoshkevich Subject: [PULL 09/14] linux-user: Add strace for sendto() Date: Tue, 8 Oct 2024 11:51:36 -0700 Message-ID: <20241008185141.20057-10-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::42e; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42e.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 },