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é Reviewed-by: Ilya Leoshkevich --- 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(")");