From patchwork Wed Aug 7 08:35:06 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: 817376 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e11:0:b0:367:895a:4699 with SMTP id p17csp294185wrt; Wed, 7 Aug 2024 01:36:11 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX91b43fvjwlrUNYjpT7XpcGkYMROaC44KoPUsFhZ6UIDlwmGwjDwiJYabLuhmSgEgLdAB2RnExPd13fjUa73gU X-Google-Smtp-Source: AGHT+IExedQcQgWpP/CdTQBjZGL9ecHE9dihOUXPj9S1HsAUStQadWTmmJBAyAMSm0Dd8Pq2s1Gt X-Received: by 2002:a05:6214:2e48:b0:6b7:d793:ae71 with SMTP id 6a1803df08f44-6bb98386c62mr224672166d6.25.1723019770767; Wed, 07 Aug 2024 01:36:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723019770; cv=none; d=google.com; s=arc-20160816; b=Ga4+QjITMc5+x7TRO+4QFRXkazpVhBRZh4RaFMhc0lwzbK7JbwbfTbMK/W9ssGPoCh h20pwptEQKNB0F/Nfnotuc/Kl44TLV9PWzotnDFNFcdb7rK88PoERewkpLTGa+LxKxwe 1A25z/PRhVL6aAYUwK1cf2fZKv+/jCG3ZHQ8uutHA+IMvnMIRN8os/mZ9a0UAiGDU6W/ nUXVSFypjtKWAfX5i4Lq5ycqupJkRbNKRnj3aj2+l+s+Eni1FGlJU0P3UtgfW8Hf+UXD s1C5Ro8k6gX3SHhuvbin2ESJa0epk6J/Na6Qazypp3+7olIscsClE2rNbEUocPiNzJco r1aQ== 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=iMiHRlTwvpRnD6JI4WPGuSYm0+wy6tJZGmuKv86uCaw=; fh=ywvbD4ylErzoB2IlWnu3L0NLvq9GVVuZHGzPWx3FgPM=; b=I72HCuSVA7xkAZN4oS65FmOv1LRYTHTOdwn/8b5uYV0d0fNOBpRXTFA8/QDIWxLUVg DbSqvZwlQoqJ4uDgYGfrXopMlTnitBwcc1ctmsYClPgIt/1fhWJLY3n3F1zOg73UqXhf 1dPegIuVL35qSo8Zw2T0optZLuee9ZSuVw6H1e2nVn9FtlBfHwWUNKwDI5Y0QeGhFkoZ ZwKl5u1tZGxjQdskSQfwoKcUzCYJhCLNKGoV222cip5VFnQlyxoPl0vqT4LQc2UgZH5w RoI/nq3VWBAyZMP8UiKlfKJ/aTJ2q+FaIF+kvA/rVfBP/KXhwg+qhZdq/wh4ZMcm75yA apOA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=W0iUkiCt; 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-6bbbb5fb194si12827726d6.33.2024.08.07.01.36.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 07 Aug 2024 01:36: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=W0iUkiCt; 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 1sbc8j-0007G1-Rb; Wed, 07 Aug 2024 04:35:25 -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 1sbc8h-0007Ew-Dk for qemu-devel@nongnu.org; Wed, 07 Aug 2024 04:35:23 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450: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 1sbc8f-0000mR-LX for qemu-devel@nongnu.org; Wed, 07 Aug 2024 04:35:23 -0400 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-3687f8fcab5so719724f8f.3 for ; Wed, 07 Aug 2024 01:35:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723019718; x=1723624518; 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=iMiHRlTwvpRnD6JI4WPGuSYm0+wy6tJZGmuKv86uCaw=; b=W0iUkiCtqmkGXlRnN3TiS4aQ3Fi8XRFXXyCWvItA3oSBaLoeccukIbjvmKwHTe1UcD dt44PVisKKnVY3l9AVrbPWjH1hUQOalpaHfbz3kAXrmqH4yC+OkonZLROtJYN9ef73qs D1xouHDvMV5dUq107ilYHW9FoxMkOzQljkdbbbNYtUbayIRX7dD9CNE9FdzcVFZAYHY7 EUmaZNIlwsEEjXiX4R6Hnp5R3D55lIlMJA/5uthh+Fc0AjGrh2jtTutBqRpJgwrsVb2X h81XjBdDOKQl1FtwYxww6Dddr0BAl/alOv/c8bqPfsJr9G8zhxHYk0PWbBjarIgkoNAp zg3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723019718; x=1723624518; 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=iMiHRlTwvpRnD6JI4WPGuSYm0+wy6tJZGmuKv86uCaw=; b=IMvCAlQ4KQscbt2U54ma3EZKM07XeBusi1vcKjyyhouXJsIjEXqRGnLWNitkCIWkgu Xm+qKbZ/pMNyuVACYbeAwjTdwiIfYjwjzBL2EWBtH9EvOezEsPWs0p+uTbm/R7Di3H2A 7/XsfT2gGKKMQYXCgU6SkCv89evHTQlV7OSrxScBIUCHJN3uiwQs8zCzbJA9a3O9haeB CSoaCrDEKmBSccE2gR8+IeGDHrVMa3L3zq2i5DNOGarLK13EQ4IY+LHTz/q5rOomlpIE AEsQgPEnQzGrbjlfwoV996VXXL8DuZvBPjuAhKFDonG1Qbm68EOe8Xcha2oKOYETgzbH Ndbw== X-Gm-Message-State: AOJu0YznjkMg6zM2x61cX08ft9BIYsEKhLqb0SDJFy278FfggB3NGF5U DD7S3WM8onMeEJkKkNvj/laM/7O3802ZkSxiK2q8YCod9Tbudp2Vj/zN76gouSnn9H84CRNcR/Q W X-Received: by 2002:adf:f14b:0:b0:368:5bb4:169b with SMTP id ffacd0b85a97d-36bbc0aeb7bmr11129214f8f.4.1723019718518; Wed, 07 Aug 2024 01:35:18 -0700 (PDT) Received: from m1x-phil.lan ([176.187.212.120]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36bbcf0c348sm15223764f8f.24.2024.08.07.01.35.17 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 07 Aug 2024 01:35:18 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Laurent Vivier , Zach van Rijn , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 1/3] linux-user: Display sockaddr buffer as pointer Date: Wed, 7 Aug 2024 10:35:06 +0200 Message-ID: <20240807083508.28134-2-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240807083508.28134-1-philmd@linaro.org> References: <20240807083508.28134-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=philmd@linaro.org; helo=mail-wr1-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 Rather than 'raw param', display as pointer to get "NULL" instead of "0x00000000". Remove spurious space. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- linux-user/strace.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linux-user/strace.c b/linux-user/strace.c index b4d1098170..7064afb486 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -434,9 +434,9 @@ print_sockaddr(abi_ulong addr, abi_long addrlen, int last) } unlock_user(sa, addr, 0); } else { - print_raw_param("0x"TARGET_ABI_FMT_lx, addr, 0); + print_pointer(addr, 0); } - qemu_log(", "TARGET_ABI_FMT_ld"%s", addrlen, get_comma(last)); + qemu_log(","TARGET_ABI_FMT_ld"%s", addrlen, get_comma(last)); } static void From patchwork Wed Aug 7 08:35:07 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: 817375 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e11:0:b0:367:895a:4699 with SMTP id p17csp294183wrt; Wed, 7 Aug 2024 01:36:10 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXDY4uHVhYFCJVE3/l4NGa1JTKyTnGYPwfKR0vfbJS9j8831r8i/JXBcYzjzdkHSMycGHFKk0P0OoF9tlIvRSRr X-Google-Smtp-Source: AGHT+IEeoKUeeA66UPZTf77XT/cSWA65J5yQTf0UOOaEZZMi7LA+TZHpbxMjcb9g8T5XyOOXJ/QT X-Received: by 2002:a05:620a:2547:b0:79d:536f:7b3a with SMTP id af79cd13be357-7a34efcbd29mr2095906985a.56.1723019770565; Wed, 07 Aug 2024 01:36:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723019770; cv=none; d=google.com; s=arc-20160816; b=XYZMrFYhLpxn0JMvgr5V3SY14x33lPLd7+sfHvPiloYTeFb9D7cWUmGT9AZmHDMwCI KBm2nYPDg5zDd8LaimaE++ma5HUmawTDXb7L51u9KFezdYMkcmTZ4PInrJiVt6kP6WNa ykjAaPUiX3vqfpNjDtHKrmyMkyPbYVoX1yugHprTAUsaiuzdUSRBHiGQKXTKXkQ16krD FJZlalWsR9L6QPy1Ox3EsAjt96QwIslju7JGw6Lxrp/3uLe1WEQquVBhdbxuqFo0h94S TI0sd1kKRnfa455d53P3azPbvxqWVxLgTn6o9eM+sYx6eSm4+9XhHesDC0dHLvaRXkr2 ZCbA== 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=HJKTi/26cFELKrR1LQH5wnJ4Q9ilmbfS3RnCQSRRhdo=; fh=ywvbD4ylErzoB2IlWnu3L0NLvq9GVVuZHGzPWx3FgPM=; b=AeU+7CDI/+tQQPQLbCYqpup9it+UAfX6JW6eIN7BkWwVr4uieJrY/DFwrHW1152bdg +DWJ0i4VB8msYKiGENDl01MGZ/tTZOMwIId9XI0nrB5nwT19HjEkIXusXyDs33FHqPTF EL+ql3EgISIjdWzMjcLB4p7J3JtpIWS/gIKZc26Y/zbtvxuZ3SSygXJczXmC9S15R+H3 X5YyG3I3ZF3yYhLUbmOnH/TGsyP9hbluc7xd51u05AdRU6NzmL9itkKpi5yFeM15wCEf nftVWkJ7pWDBK/+KlUXtM5/1UsmV306QgYb1D/xM+UuKZYoW4FV7otKWjNZAQFbAS5wh o/Ag==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hDpTs1Kx; 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-7a378805c46si101424985a.363.2024.08.07.01.36.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 07 Aug 2024 01:36: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=hDpTs1Kx; 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 1sbc8p-0007PU-Sh; Wed, 07 Aug 2024 04:35:31 -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 1sbc8o-0007P0-LW for qemu-devel@nongnu.org; Wed, 07 Aug 2024 04:35:30 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sbc8m-0000mn-Ey for qemu-devel@nongnu.org; Wed, 07 Aug 2024 04:35:30 -0400 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-4280bca3960so10958335e9.3 for ; Wed, 07 Aug 2024 01:35:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723019724; x=1723624524; 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=HJKTi/26cFELKrR1LQH5wnJ4Q9ilmbfS3RnCQSRRhdo=; b=hDpTs1KxxnBdhrEKrqVHdA5QMaNpo4ao9624vFsy/sNfXysvoKJNTxAoCyj4ctZ5UE wiPYkJTqSWH+HIUpIND+d9+y45QB2zrl3YMsByVkPr/u4sbq3CEB9eOZNp20pzhWArxj Mhb2XNtPYTuO3ZmKGVucwJ5+hlhN/49AEhGwHyheNsiwpeqH/s5w/0lZYZaTZbzh1V8C sYdljiQt7qAdzNChD6LUmS2j22UQHdUbMyTbypTG9U2+Ebxs6Gpb/ZySLdq6oCz9Uobe HFOmXWGgBh/STBn2X34pX3s6meVht1IOT/7HE9Z39unAdHoKV43xNmYX9beA0c1dJqJ3 WXtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723019724; x=1723624524; 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=HJKTi/26cFELKrR1LQH5wnJ4Q9ilmbfS3RnCQSRRhdo=; b=PWQD8knmY99Pxlse4bpgLYnH+lt1SqUqTjgjkhIfrwVj/zSJhQHVJayJ5nQYcVJ6ne X+O4vIPlLuTkeKnmCr1EGGkUVnlUndDxr2Zb0CSqtLjmMNlGUiodr2Z6T1uSk0yJ+b0T nQqbB9AyMuuOpinHeNcXbD6BPLDzs3KxYG2b8KTvNwg/Y4V0vLwHzMRxfiIe+DCn0Nei 2f7lNmtl0at4FJt3aPnyyDUcfsvlLklkCD5fKnDmgx+6ym3Fl/qtdUs++efh9HWB+oS3 57p6Z9Glo5jYSlbzCbqZM6k4id9uvd8aQvbjs176qtdNaX1XAAXucSVGCTVoUyTkeCd/ mS5A== X-Gm-Message-State: AOJu0YxO2Lfr+jSV+AtbbFSh2xkbxX1Wbhshot2/xhKX0NvnVjTI1ssR M/D4/SMY8ARSWoN4/zIsB6IAbS7cnBvHqIrnX7kXrtD5W+4Pja+Df7PDjfF7V12erxreaa6kHXM p X-Received: by 2002:a05:600c:6412:b0:428:1ce0:4dfd with SMTP id 5b1f17b1804b1-428e6b83782mr119365695e9.34.1723019724285; Wed, 07 Aug 2024 01:35:24 -0700 (PDT) Received: from m1x-phil.lan ([176.187.212.120]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4290598f30asm17940975e9.26.2024.08.07.01.35.23 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 07 Aug 2024 01:35:23 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Laurent Vivier , Zach van Rijn , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 2/3] linux-user: Add strace for sendto() Date: Wed, 7 Aug 2024 10:35:07 +0200 Message-ID: <20240807083508.28134-3-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240807083508.28134-1-philmd@linaro.org> References: <20240807083508.28134-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.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é --- 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 7064afb486..f55b62f0c9 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -3122,6 +3122,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(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 }, From patchwork Wed Aug 7 08:35:08 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: 817378 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e11:0:b0:367:895a:4699 with SMTP id p17csp294212wrt; Wed, 7 Aug 2024 01:36:19 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWqSUdTZ9UjpFhKvB9QSfUCmJ0ZzQeT8vcIlH2IsOqgVD0SAPhZv8roe7FJsxUyCO40ZQzrgcNGY2jUD48yTGBU X-Google-Smtp-Source: AGHT+IH+mh85R3VE6sVfR44YlZqOfR3FIPk3hI61jaCLdOGTNqSajOCnb+d2ZsJJIO1ZkqkJmTNR X-Received: by 2002:a05:6102:d8c:b0:493:e678:b760 with SMTP id ada2fe7eead31-4945bf330ebmr21383306137.28.1723019779243; Wed, 07 Aug 2024 01:36:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723019779; cv=none; d=google.com; s=arc-20160816; b=uf5qKFTas26Kerf2VoZ3poTpIfLOGaWVg1Rqx18/nRUtR/lKZpC/+q3DtyKCtBEswt h6+bRSPkxiq4c25CdJeC4JGp6dzIP9ZPdFLK0+m311dcM9n5Q/Psluxh7Vw5TWp2lBSr exPCil7YjRWurqlxJTt6nJp6f+aE0hSR6FtDKgYxP9x0cxJNHC7h5VNarZdGISA1NsfE OXNeuUPrPbjh4FgXB5juzytnJevIZUzAornqDKua1UP9dgQXV41wvvsAjCTqqwfHsrLW CHFk7SH13N9lf+/LeMG+Q6ULPCgPNoNCm/1n3glrAkJX3l5qPmw7h01v90DD6gHaNSw5 vLUQ== 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=/I0FsiaKLm1aDdY+hG7UBHBo01pYVAJcpIt4G782Pr4=; fh=ywvbD4ylErzoB2IlWnu3L0NLvq9GVVuZHGzPWx3FgPM=; b=Zrz2PUfvdW+1n5J7+GuZbifjGEmiL6UCooTwp1qfwntRbIqQy3heygxSdduRPqGPHv 5t8AknocVYG8tTAxNpff6+ezSAPnbUOtqVAKakrU1G55H+Jhh8lhVjxQi5CpuoU0rlDr +qYzEWWpqKEWH7iD43JT/vS0LTdCi4rdJEj+IUJODqc3/smKS/u3OKQ6FNTvU0hNU3cL Fkg454RtltncyYaDem84KZmzl7qZiEWL01NQY1U6ccJFTRoH1/wCaAEOrh/oBsw4o0pH 6/GvTvAk9cr5W4tLHIO8XPtcLqweEMDFE3Gb+c3a7Ayh4Z038dVNV5Zy5EespGDRNBx7 2AJQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GA2tNaKL; 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-6bbbb73c8e4si13270806d6.161.2024.08.07.01.36.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 07 Aug 2024 01:36:19 -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=GA2tNaKL; 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 1sbc9V-0000wb-VA; Wed, 07 Aug 2024 04:36:13 -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 1sbc9V-0000sP-6f for qemu-devel@nongnu.org; Wed, 07 Aug 2024 04:36:13 -0400 Received: from mail-lf1-x12f.google.com ([2a00:1450:4864:20::12f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sbc9T-0000wu-I1 for qemu-devel@nongnu.org; Wed, 07 Aug 2024 04:36:12 -0400 Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-52f04b4abdcso2211506e87.2 for ; Wed, 07 Aug 2024 01:36:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723019769; x=1723624569; 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=/I0FsiaKLm1aDdY+hG7UBHBo01pYVAJcpIt4G782Pr4=; b=GA2tNaKLZv6YVm+QxaiGhus8DmoPxcJWuGyK7DbyHtFcaa5wUOuSXtWYzIW+tge0jy Pr/NXgP0lj21+DrSKaxa1l0TR7Ugr5olwKsHXy3Z2NqyqlldRhIl+qxdU/fhZQA9GUrT WU32FToyzniUNZ9ikRsnQ1cw2jqhhgp1PzvpC2TvqRjbrJsYaD1gftbwIvAPfzENZWgC vTZnP98IuWDNRS8DSuyLoIEIDkqXcRnH2lcZCN+Wgnv4hg0EDRY6Cq+xU14WBNAytsrI sQZLY+FiNC77l+iDeMJWk2FK1iugxkyIy2RJmEhcxDHzuxHKxR+3WCeOSK+7jYrocg02 EEug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723019769; x=1723624569; 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=/I0FsiaKLm1aDdY+hG7UBHBo01pYVAJcpIt4G782Pr4=; b=MiFlg2Aj2IXirCx0dGCFrv8MI4EA6WXAWlc2yjKU75MkKjhYWNjQIWhvBfeIgKhyV/ W5gxm6rd6Fr/nKP163v8T4m1Juus1R0kqgAvaqRpPoT5ZoENbYg9mnL+mTCFW+e9jAuF Wm7nadhd16AnkPeRPqzNg2EyyTiACg4Skz0ZuK1nHDZ+9O4aCm6Egn16nFRVuVOmTxum HD0Z3GmEUXpCCvqpKcG/0T2Q244mAueYsFe3m35dXyiEqcgG9ckyeMl1Xlj147fKi5xI 42vjO5fh9GfW2aAy4P+G30SlSxiluoFfkJ+psnhQfqOn2yLkVNi6U4SbEqpMVpiIIWiw EPSA== X-Gm-Message-State: AOJu0YzuWYaRbpCxOXCFQEezbYUxyErUe2j3Dyfz9T6qeUvK8ImAKkbj SkuomfE4Sn80eHFvcpqBkYP0RdX/NXPSPVtFQeFOJi9hYyfmh97iqyy9CIdHSS4uIxntsdBi76I z X-Received: by 2002:a05:6512:1115:b0:52e:98f6:c21f with SMTP id 2adb3069b0e04-530bb36be93mr12512090e87.16.1723019768990; Wed, 07 Aug 2024 01:36:08 -0700 (PDT) Received: from m1x-phil.lan ([176.187.212.120]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36bbd01efb1sm15153509f8f.52.2024.08.07.01.36.07 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 07 Aug 2024 01:36:08 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Laurent Vivier , Zach van Rijn , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 3/3] linux-user: Add strace for recvfrom() Date: Wed, 7 Aug 2024 10:35:08 +0200 Message-ID: <20240807083508.28134-4-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240807083508.28134-1-philmd@linaro.org> References: <20240807083508.28134-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::12f; envelope-from=philmd@linaro.org; helo=mail-lf1-x12f.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é --- RFC: Not sure about get_user_ualx() use here --- linux-user/strace.c | 19 +++++++++++++++++++ linux-user/strace.list | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/linux-user/strace.c b/linux-user/strace.c index f55b62f0c9..f03e4229d6 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -3122,6 +3122,25 @@ 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) +{ + abi_ulong addrlen; + + get_user_ualx(addrlen, arg5, 0); + + print_syscall_prologue(name); + print_sockfd(arg0, 0); + print_buf(arg1, arg2, 0); + print_flags(msg_flags, arg3, 0); + print_sockaddr(arg4, addrlen, 1); + 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 5a86419e7d..77ca824f9c 100644 --- a/linux-user/strace.list +++ b/linux-user/strace.list @@ -1135,7 +1135,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 },