From patchwork Wed Aug 7 12:43:02 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: 817397 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e11:0:b0:367:895a:4699 with SMTP id p17csp372707wrt; Wed, 7 Aug 2024 05:44:38 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX6ROisfvH9aBzIg4qtBQCBob9F2BoJXMT+mNY3Ga3ogxEN3BMKR7O0XHV5nkpi19TQYi3ydn+Adoe+GDXqTRL5 X-Google-Smtp-Source: AGHT+IGhwSaMya29JOCAZOuQV2eoaRa5acTYUM1wTNm6aq3DwYCtgy2Q12FwYuLATqGjn6kTIxTq X-Received: by 2002:a05:620a:4043:b0:79d:6039:784c with SMTP id af79cd13be357-7a34ef42ebfmr2243315485a.30.1723034678183; Wed, 07 Aug 2024 05:44:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723034678; cv=none; d=google.com; s=arc-20160816; b=i3PcGGzVWKn8YB4l0jgptmAOQe5dDHrt67RlZVePTXjtP/dDnJ/IHNPI9depElTYt9 aeJvKZb0cUm/kKeSdFYZUEEV0xpArvpqNlf2bKV2jFudDOHlU/eqZ5OzNbHZ/O4z1tk0 hpjZyEDDGzi5ODPDRdgKaq3l+uotkbFMdBoTt75p78u0RYMdNRomFBQn8A7bpg0aw98c ZdpIvWHzMLDAp+zrGiEl4Zf75mbC1H0WbLd3OwyvV2bU6mu4EAfSmhkjgL25rWchZRw+ PUh9RU6v7bRv4ZikqIgUVWPswOzdyc1BnIKRfgpikYmx7XBkQeG2YQVTDuj+EtR3JcMd UcPQ== 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=jaQO+2U4Q3+FxA+WUglfjEa6HzrZrjuAodkM2Cay3Ww=; fh=jTKErOgIgUXnQ30600P+KUWUvJ+nHsfx79XFM+bIdfI=; b=OspHstJ8d0tDaivxhjP76uMyVzlpqTbwF3rPlTV7pYAd6CMjDPQGgLOffgSjuavHbv nXfxmETCuKoQRlYkfFXz6lWx06FJY8+DR/vDTKhiJJVXmAL/PGac/9oexA9AxH9Hz/H0 tNwP21H0WOlfaOgBeOejALQUkv+ZrcB9o6d7QAIAkUINbOoQNMVnUDK7j7bAjoOncHCz jo0y+3q/ddApxyESlxR/qdJWTZdYeuEp3DYuw8Y7oLomWb/TwoNMudScZ3O1WoyzXO14 PTYwm5AEwsnOfXxiteUS/RCMqZMJEiAQ7JUAaRVdfKX9kn6Yav/MXTFjXAC5c8aTf9xx N/gQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rnHRcneI; 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-7a37882c001si145636185a.431.2024.08.07.05.44.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 07 Aug 2024 05:44:38 -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=rnHRcneI; 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 1sbg0j-00083w-5R; Wed, 07 Aug 2024 08:43: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 1sbg0e-0007zI-B3 for qemu-devel@nongnu.org; Wed, 07 Aug 2024 08:43:20 -0400 Received: from mail-lj1-x22b.google.com ([2a00:1450:4864:20::22b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sbg0c-0005OY-7L for qemu-devel@nongnu.org; Wed, 07 Aug 2024 08:43:20 -0400 Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2ef2cce8be8so18578631fa.1 for ; Wed, 07 Aug 2024 05:43:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723034596; x=1723639396; 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=jaQO+2U4Q3+FxA+WUglfjEa6HzrZrjuAodkM2Cay3Ww=; b=rnHRcneI9cIq9DV4cXcj6D46/dv4vxGRgeaYkWxDCA5khUqiNe50AQsqm+ovR2ZgbR IJQxh4W+AVjD233XFWb//LiTFVcaXt6pH3d7Ch4gkkIgOhIOSWfa/O2c/x/NIGEbePMt OATdXN5ncWmzjZ3M4zcRAN2QScQyAqtNaZWNW3GgxCnzI948aLz4fsFLFCwj88XHK2Xc lkKw9EnGN2q56XktAitJIhFFYCzOXm8IR0SojGb+a3FLnQ4HHexG3csHbxwiQfpDGOvn 2jsoJR1NJNowYZIUFGk0RDdJ6anBQ4uswa6YW4zvBzSLyHkUPtvwNjpnM5ZPL0du6z4J LeFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723034596; x=1723639396; 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=jaQO+2U4Q3+FxA+WUglfjEa6HzrZrjuAodkM2Cay3Ww=; b=Txm6Woab/LqFPr6AMO0r4Hb9ws2OEN8IzqsDXMNhJBdq1xwoORkxwrh+iljn1RDnl1 8vt/xVgcXtZELmR8hPx2CrHJ2AMhZF3X99X7TNyO3RkkvypixVt/l7VU7xHFJ4ZPa3+J aIjEBRlyX8+d23VUAqtaK8CRIbHZGJ20uhs2zJpBIAOqLUM7Eejgq6FbUlax6XOmag9h fNlSLqJBMbnMZM3Q+08OA+QcBftdOEIh/OlP1Jvjk1+rU5OxEAJV8p2dWMyfFSsWFBII pDZpY5UmvWof7rgFnZYvAylHJRA9DFv+lnLHtTbJlfoAHorU9tXLlGFqvifMyF45Cl5n HMQg== X-Gm-Message-State: AOJu0YxmDH2TenTN1dNoX2yg4iT2KyaCNS5ItCHmDomWTkOLojRwEKYx d7fzl3fvz+xg0fiZOhu1x/RUSBsHVI10OfI+ccdD5gNGLW3yzwoBeH8GBao0h+PrJlvJ0c4Vf3g x X-Received: by 2002:a2e:8789:0:b0:2ef:2247:9881 with SMTP id 38308e7fff4ca-2f15ab0416cmr136361881fa.31.1723034595466; Wed, 07 Aug 2024 05:43:15 -0700 (PDT) Received: from m1x-phil.lan ([176.187.212.120]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36bbcf0cc58sm15922573f8f.2.2024.08.07.05.43.14 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 07 Aug 2024 05:43:15 -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 1/5] linux-user: Correct print_sockaddr() format Date: Wed, 7 Aug 2024 14:43:02 +0200 Message-ID: <20240807124306.52903-2-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::22b; envelope-from=philmd@linaro.org; helo=mail-lj1-x22b.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 When the %addr argument can not be accessed, a double comma is logged (the final qemu_log call prepend a comma). Call print_raw_param with last=1 to avoid the extra comma. Remove spurious space. Signed-off-by: Philippe Mathieu-Daudé --- 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..73f81e66fc 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_raw_param("0x"TARGET_ABI_FMT_lx, addr, 1); } - 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 12:43:03 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: 817393 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e11:0:b0:367:895a:4699 with SMTP id p17csp372438wrt; Wed, 7 Aug 2024 05:43:52 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW3A9oiSHwCGX1it9BHuvSfGCcCp1Wovc9khLa1Q0eskJGsWJrovpFxZWZ+HcoKqt4ZGnWTrdmOnEfg0seETV6z X-Google-Smtp-Source: AGHT+IEZab0oU6phQSZutP78CqYZLOEFBpyQNuqF4f6q3KglxtnKZ800eb7UWTf7FCYf650lqdXJ X-Received: by 2002:a05:6808:16a0:b0:3d9:e127:ecb3 with SMTP id 5614622812f47-3db557ef94amr23227061b6e.2.1723034632235; 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=FLMfTCpWWDsyFNwWkm/lvNJpVRLx+2GVYwUsTGo8qALCMd6zz45OKJ2p5Yhv9vVcAI qT0PawqzzMTDSfcwZZKNgldAPAesvXXn+oMSgl/FR1CLjSvyzBdejk9KpNE46WgBA1OD cAjAIkohY7naJbKRCUG31adB9yzLfTQ+sKs1TmqoyflMnj8neiZqTasfAet00Yukd5gM 6iXPUlenZKwwdOv+GuKa3rVT+Usd8ePv8HVsKj9q9XZzMb49GTL+c5TKC/0ZKvixAIv/ Lku8QXW58cD3hr8tewgRtYPdxke5qCVIvfi8O0G7NxSc3RhsgNQToimK8JgMlsEEsKtE jsYw== 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=62bCHMKIXQfxUU/cuSogWzhBCjagyaLhvUECd2A5+LY=; fh=jTKErOgIgUXnQ30600P+KUWUvJ+nHsfx79XFM+bIdfI=; b=osMEsElmkOzarlsxJR/ea73rAY/ziH7DaVNtmpVcuToqzDUwPaLrG7lb1EQKRsGQLy 8VirJR7vht6SxcuKsMXO18bNvyn/tCocI/7dN0XVHt2dZcsDy4yNH3TZ99qN5dzdOxdy c8+Yflw0lR3UAeRlf8RyWTJihE55VSQF+MozAzXuWVankHBsab+kmo01lLpFieokmwip o7jKA+f+BGOWzMNPvL7ZFLL0GphyqEV6Nbleo8yXB8j0plstDkAwTFsQ3nm+wP2Zxk7F dyCMvB/QSb3AYEwToKruiUtwg+IQRABJtfrBV7y1UJnmFK4DM0UkzrqvGtouDw4Fuc4o Ys1Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=evb2L3zb; 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 d75a77b69052e-451c8857311si14690541cf.729.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=evb2L3zb; 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 1sbg0r-0008Mf-0S; Wed, 07 Aug 2024 08:43:33 -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 1sbg0k-0008GE-Rd for qemu-devel@nongnu.org; Wed, 07 Aug 2024 08:43:28 -0400 Received: from mail-lj1-x22a.google.com ([2a00:1450:4864:20::22a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sbg0i-0005Oy-Vc for qemu-devel@nongnu.org; Wed, 07 Aug 2024 08:43:26 -0400 Received: by mail-lj1-x22a.google.com with SMTP id 38308e7fff4ca-2f1870c355cso18416751fa.1 for ; Wed, 07 Aug 2024 05:43:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723034601; x=1723639401; 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=62bCHMKIXQfxUU/cuSogWzhBCjagyaLhvUECd2A5+LY=; b=evb2L3zbf7MH2Moxxu2vtCPGsnE4Bbyh8RMpmSQcsJvLU3/Nxr/2oaN3z9Mzxm/7CD LLReFvrtrMVbzuuagXM2AtXumyIQKxVyiKrVu0w0t+7v5WxfyLvn0/9uHJwYqyrPc8F4 Bw6czIsPg8TVomt1sX7qnvqx3JnjgsEL0O4UtM186Y5fI+mSeFvrHROQBzi62fAhZduh HOSgsfPCDJ0ai+3CGzojeSQVSHt2eI+zsmJz/mZuaH4euLgOuccwW0F8i3bjEKTBfJ3p +v7PsddsO7jCxI7USxP8Eab+UGENQet/THq/v4AnGZTsb5poATb3ZK6eLq+NemJ9Cuoc /GZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723034601; x=1723639401; 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=62bCHMKIXQfxUU/cuSogWzhBCjagyaLhvUECd2A5+LY=; b=CoFcjc3ESrqNm0tBqLP5igc0uuFi8MMzssQEf37nmeA5E6tOXz2hUdhTpxcByeXhRl tH1AnutmBlUwJ0FFS6puzFkKnvp9F+Lfu2MJlK1EWq77ZYuyn7zcLRlKI5bkB/frUypU 4JY0+rXz5CAN8jaSw6/lX7ropPb2No64bL1lx65xG6g8fN63YJpXnSULvu4kfi0wGYXD llsTOLK1yh8GxfWnaHNy5VnRamn4PqOs/czQE+7hVITJ20ojipkUiAuKZLI7vtNjDHsM LNNe/Ef9F3t7jxEj1RkEQIEz6TU+rkVwjV29ome5/C5rxt254PUxGa/8lWcolIZ1RTWP O+5Q== X-Gm-Message-State: AOJu0YxaCASt+f4LPbAoFRaJC1p9n7LqzFzWkY5teHN6Pu7k3QU2w3RY +NQimBZQudbPk7i50iY4q38r2hqdAAuwK15aLZ3CqthyFBoJHHGtl0PQhdqWsiAEu7sH8Z5nQoP H X-Received: by 2002:a2e:9c90:0:b0:2ef:2c87:3bd7 with SMTP id 38308e7fff4ca-2f15ab0c200mr114613611fa.37.1723034601460; Wed, 07 Aug 2024 05:43:21 -0700 (PDT) Received: from m1x-phil.lan ([176.187.212.120]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42905971d06sm26898975e9.19.2024.08.07.05.43.20 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 07 Aug 2024 05:43:20 -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 2/5] linux-user: Display sockaddr buffer as pointer Date: Wed, 7 Aug 2024 14:43:03 +0200 Message-ID: <20240807124306.52903-3-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::22a; envelope-from=philmd@linaro.org; helo=mail-lj1-x22a.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". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- linux-user/strace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/strace.c b/linux-user/strace.c index 73f81e66fc..80f64ff40c 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -434,7 +434,7 @@ 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, 1); + print_pointer(addr, 1); } qemu_log(","TARGET_ABI_FMT_ld"%s", addrlen, get_comma(last)); } From patchwork Wed Aug 7 12:43:04 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: 817396 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e11:0:b0:367:895a:4699 with SMTP id p17csp372646wrt; Wed, 7 Aug 2024 05:44:28 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXDbFl6getNawD+ERbwyTmcrSyEORY7MHxWYsOfGfK+d6QPnBr9j61VXyDsENhPWfCKVqxUGfKpwZB/p6OqNSqQ X-Google-Smtp-Source: AGHT+IHFHvrTXx5aBAiPpba/YeycGLiDjolReO9HeFn9+jPGPex+o/4uTo2XhzeWe8iVQfeIX0hG X-Received: by 2002:a05:6808:13d1:b0:3db:3303:8377 with SMTP id 5614622812f47-3db5581341fmr21889938b6e.30.1723034668657; Wed, 07 Aug 2024 05:44:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723034668; cv=none; d=google.com; s=arc-20160816; b=hPIzk7BtgDcNCzX114ZEntnt/r/27C2/mbwmlBA7NI8qS4xsNEVK9hRq66NIpPin7H BKWGXV82a0mJVXYuMp7VFDXR0Tanc9wtqgqQvtj0O7HHAsubyAil1+SlHljOkHhpnPmy NDmdjyjXhdhsltRfVRPfTITfCr0ARuS+CUom1POZ3FH2ehKho3eWDdOMldt+hNRwoG/t MI7s7CAh1BEKZ0W2s3q1s0PHtE1X2e7eqqHthQRS9t9T5uvONx1aayOMlMHCmEjXhO16 3/X+uRHgt/dGnx0R64QBphiO6gBeisN1hY25wjjRFfOqRjr+BDv5OP5lDpjwmLDB5cOs 0H0A== 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=rnPHm5qmilosKgT5p/Ig2S4/TLxu+gWuPX7v2WagT94=; fh=jTKErOgIgUXnQ30600P+KUWUvJ+nHsfx79XFM+bIdfI=; b=T0Y9A9+Iq4dnceQ3Y0qvuYjMsXqVwWFoo1WOrkeMzq0asJQNk2qMrZOzCJCs1W+c7F 8y1rNzo8EW3wrZAlymBv/iYbrFdgL59dM8bxhZx1mJ10KQa+TyfeMhV79wanmKDn1kMN wKqbEFHFm7bmWwb8XWWzhchy0D+aouDpGa6L6aYQmbnNSSg5lP9fYXHDerYuwTjaD4f6 kg8y6B7WQ1JYfwcYuCH3BAvJdbDGjwy1ZXP4+OJLr/K8rplz321SCgnyMYPlPpb9HJ2e 8kLqWNHuqBj00Xpe6pLDjYW4KgKgKEmmCVq9iyt+tORi2+MO9rPDHj2f9iZiqJevBZaU FpDw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rrRVLWJ0; 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 d75a77b69052e-451c87f90e9si14682851cf.500.2024.08.07.05.44.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 07 Aug 2024 05:44:28 -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=rrRVLWJ0; 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 1sbg0t-0008U9-Fi; Wed, 07 Aug 2024 08:43:35 -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 1sbg0p-0008M5-AA for qemu-devel@nongnu.org; Wed, 07 Aug 2024 08:43:31 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sbg0n-0005PH-L2 for qemu-devel@nongnu.org; Wed, 07 Aug 2024 08:43:31 -0400 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-428fb103724so4959785e9.1 for ; Wed, 07 Aug 2024 05:43:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723034607; x=1723639407; 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=rnPHm5qmilosKgT5p/Ig2S4/TLxu+gWuPX7v2WagT94=; b=rrRVLWJ08phpqd9sCmMeUxhyCA0aYwbbbUEY2PYonWDzVgyBzuO+W7ms4KyalBafts /FN26EjN+azqT/enTZf9itI1v105bUSaKvPWIVktRD5YP6NSFZ/jc1JerlhN3AxPhcKc l/Tgn9JLndr2VliTw1JDL63RFB9rDeBZqKIME1GHTLpYb93sesImLn+JGTJxI4FRmk4j YH/ZO+mLbM0kbf4KIkeG8B/fTWUv6Abycbivc3ZWzVnOHmbZtHnEkBrqOyxlyGgg6oVJ 1/LsRrthAnAOGfS0xzhUPldp08v+yvDqoVUUR31BgfzE15Lu38nMMTePkXvGCZoDSk4T T/Aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723034607; x=1723639407; 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=rnPHm5qmilosKgT5p/Ig2S4/TLxu+gWuPX7v2WagT94=; b=Dk2+GwTb+Oa+F96k4O5h7AZszFgq+X31jzaol3Q+rm79WPte06K99aFJs8D43gYWvv 6gWg7UMyY79iQUCcYz0ECMa5so/mE7sziYMq+FS239C2W8Z86z2jfDgb2ZW1GaW1FbBi KUkyMoQYh9xiAPWxdXC/mVlUf2NMFyUgyJKsDY95gKDgIKLezBmxDi23SJZUVMD5Xn6i 3cgsGKqPqBiooCf5h/iat+G1BTEimWSDR6xsCGx6N58AXXimOLb0IzfKWyEdtCZ8TYLH 1TArI5YrcxPw/s/1q/BKti7ebWqcw5N/jQ5zP1D+yPSos+bkqhKHh5LjZFVMfXr+irTh SfXQ== X-Gm-Message-State: AOJu0Yw/7TusnTSpYGJBz8A08ett5ArO/mDxWFltQBx9G7j5Xaum1ObY 2T12UDgz6uzqUSf49hrsF2nbu+TJ0gtEnEmEcLolZKy8nQkfM97Np9hMU2eoFE54TrA+jqO3D3b Y X-Received: by 2002:a5d:54d0:0:b0:368:318a:a191 with SMTP id ffacd0b85a97d-36bf0dad2d0mr1439151f8f.8.1723034607304; Wed, 07 Aug 2024 05:43:27 -0700 (PDT) Received: from m1x-phil.lan ([176.187.212.120]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4290598f195sm27847505e9.28.2024.08.07.05.43.26 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 07 Aug 2024 05:43:26 -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 3/5] linux-user: Factor print_buf_len() out Date: Wed, 7 Aug 2024 14:43:04 +0200 Message-ID: <20240807124306.52903-4-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::330; envelope-from=philmd@linaro.org; helo=mail-wm1-x330.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 | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/linux-user/strace.c b/linux-user/strace.c index 80f64ff40c..210ff86afc 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -1655,6 +1655,13 @@ print_buf(abi_long addr, abi_long len, int last) } } +static void +print_buf_len(abi_long addr, abi_long len, int last) +{ + print_buf(addr, len, 0); + print_raw_param(TARGET_ABI_FMT_ld, len, last); +} + /* * Prints out raw parameter using given format. Caller needs * to do byte swapping if needed. @@ -2742,8 +2749,7 @@ static void do_print_sendrecv(const char *name, abi_long arg1) qemu_log("%s(", name); print_sockfd(sockfd, 0); - print_buf(msg, len, 0); - print_raw_param(TARGET_ABI_FMT_ld, len, 0); + print_buf_len(msg, len, 0); print_flags(msg_flags, flags, 1); qemu_log(")"); } @@ -2761,8 +2767,7 @@ static void do_print_msgaddr(const char *name, abi_long arg1) qemu_log("%s(", name); print_sockfd(sockfd, 0); - print_buf(msg, len, 0); - print_raw_param(TARGET_ABI_FMT_ld, len, 0); + print_buf_len(msg, len, 0); print_flags(msg_flags, flags, 0); print_sockaddr(addr, addrlen, 0); qemu_log(")"); 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é --- 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 }, From patchwork Wed Aug 7 12:43: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: 817395 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e11:0:b0:367:895a:4699 with SMTP id p17csp372535wrt; Wed, 7 Aug 2024 05:44:10 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXZYP/Ee0yClRh4Prn/3lSOxk/INtsJFQjaa3e4oO7cOqcC4NEwkZ/D3oNHTjIaVeoq2yPIzg==@linaro.org X-Google-Smtp-Source: AGHT+IEwxsCJl/4GOPyoKmIkLEOD2MXyBQJ/X5BUtRpcwM5LrOi41UWIMo3pb1e/1iiMGPyXeScW X-Received: by 2002:a05:620a:198e:b0:79f:18b8:5de6 with SMTP id af79cd13be357-7a34ee95e24mr2080522685a.7.1723034650124; Wed, 07 Aug 2024 05:44:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723034650; cv=none; d=google.com; s=arc-20160816; b=P5dahApiajzPo/lTBPghh2q+YEN5c9I3ZVEp90QU05/sUtxDlz2RFkvgRhqVO5d6CP oJWpcuja5A4G8yfmZYfk6IyJkaeJiulV9ZFQl75LmyH3kMOjrE0KjRRJyoX7YWLIA3oj cdqLKwffv8ACMkQCryVZZj8xnHLJNlSVyVRbBPbCNo3w2xm/42U/c8ECHotGxYYpxlev kLxLnfH4KyzYxGHPQFAuM+bFmSftc14RJ520fbe8qhZ1JGU2BK+AzoNmQaNW6w5UMxcj hC0ucQSsbsPBHQZ/qvkYXHigqlo8rTdujWJ2/RV5Uaea2atB3Y3uRIjjzAQBqHaDZ81O S1OQ== 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=Pq1dTXzDXbRYVMh0ReJZN5GzV4YwZOctS4OmQtmosdA=; fh=jTKErOgIgUXnQ30600P+KUWUvJ+nHsfx79XFM+bIdfI=; b=x65DHVS515EThzXldgsGPl8Hcx5hbqN5pUda8R4o4p/n8KocLf/zRWTubzDpo6Hd5/ +1YlzxIb0I5dSIl3ra09+c7o7Mav+hctnPDCSohjwzvIkUPxFdAC9E1MZ1WJR1VpHxz1 7a1OsHI6HGlXgjKgGbW0/LW3SdEpVXgsIPLIkTM3vCNISquorNZKter3iyLJKvru+5sR bZ//yjLa8yDggP1/i9uVjHbVR7372kdLnjmQjEGJXcuUqA3Z/+IRIFHjVx50A/j894zk kkTifxr32rRHLSPPKGJzQJIKWtHoyi2iZAJdeaWDFi074a1PVhLQ0L0l2oMQZ8D86wML V6cw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wq6tzVYg; 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-7a378872431si149669485a.689.2024.08.07.05.44.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 07 Aug 2024 05:44: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=wq6tzVYg; 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 1sbg1B-0001IH-KY; Wed, 07 Aug 2024 08:43:54 -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 1sbg13-0000o0-65 for qemu-devel@nongnu.org; Wed, 07 Aug 2024 08:43:46 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sbg10-0005Q0-Jq for qemu-devel@nongnu.org; Wed, 07 Aug 2024 08:43:44 -0400 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-428119da952so11823645e9.0 for ; Wed, 07 Aug 2024 05:43:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723034619; x=1723639419; 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=Pq1dTXzDXbRYVMh0ReJZN5GzV4YwZOctS4OmQtmosdA=; b=wq6tzVYgt5gfg6wgGuk4r5ia1NCr+XwFhTr5vUMdGT6ltYVA0ZyHpGOzXBFRvsQm4y aKfnL7rFqgOlDBQYGCh8X0GAd84j80zMaHfNDbLBKRejwxCRNFQdfNibAum0E+udB6UM g64v5CtGhxKy3IdKLoU3uxX7aoRLgFtsO7KFzkmU6vv/fXd/pDekWDLSO9Uoi9psCZoK kZyCI7oY6SQQ/OtTgcXSN6MJ+VQpeHYxJK9oOM++s4glTgRN6jXYhn+twkvqlOwQO47h 9OdFxTwdTOOt5wwWUwQ8XGhcVltuCZGb4aniEmbmg96ngFnZsDQVE+nuUAGlarKqSJKs h8eQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723034619; x=1723639419; 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=Pq1dTXzDXbRYVMh0ReJZN5GzV4YwZOctS4OmQtmosdA=; b=u0F1gb77BMdkrbw65sgw2SoINYEq4lMg9n+vdw1uYPrl7cLATOs57HYQcT1R4NNAOW EIQQTZt4yS1LYfI8PG1a1dT8l9b7QRLb8VnUftJLlY/jtS0kx8LnlkaxYZDEShAEoVBg 2YawaJ5p+LaqKigw36mJbktXFMwpIdNLxUoybCj3QXyMZsJhPnzVtVF1dTPZzb5c0h3f NbDXFS+5U5FDVnLODLUxHCkaXiz2jgCyHOnDEn8r3voTToJyaLRn9Sog7AgXxa4MVuw+ zLBddmt+/Ze0668e7ZUCS3vOq8QZ1V5Ri/UfrciQ+OtrjiG4JqDNh7QNcrVeheSt5d6S ClQw== X-Gm-Message-State: AOJu0YyX25ypOvtVyx0X7InH8o6Wj9ikfPs1QKwvQ2GHMrYvnP3KNycW 53Z19kVq2+lNphaxztS1Ftz9TZyuGX+xdjFq7EcaHH5qKwbsJj5vc+7I/9H+JYFVKpcFQXk2Awa Q X-Received: by 2002:a05:600c:1f05:b0:427:d8f2:550 with SMTP id 5b1f17b1804b1-428e6b043c1mr119371385e9.14.1723034619003; Wed, 07 Aug 2024 05:43:39 -0700 (PDT) Received: from m1x-phil.lan ([176.187.212.120]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-429059a6703sm27553805e9.37.2024.08.07.05.43.37 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 07 Aug 2024 05:43:38 -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 5/5] linux-user: Add strace for recvfrom() Date: Wed, 7 Aug 2024 14:43:06 +0200 Message-ID: <20240807124306.52903-6-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::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.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 | 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 98ef26b917..d76907fdc9 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -3127,6 +3127,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_len(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 },