From patchwork Wed Aug 7 12:37:32 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: 817390 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e11:0:b0:367:895a:4699 with SMTP id p17csp370686wrt; Wed, 7 Aug 2024 05:38:52 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV7+Uj9e+upxmLaYykL88nhg0CpwuFimxtUGibTgedkeYAdX7hU+ZXX5jJ3GHCasP4ENRzbHLpeIyaSvhoADtia X-Google-Smtp-Source: AGHT+IEEu8mwvPlr8vlcqqPffKQ+1VgeeQgZno7iMsPVuJXDJJAe3R0M8kj0gUrQL+Fi88IHWYdZ X-Received: by 2002:a05:6214:590a:b0:6b9:60ad:a9e2 with SMTP id 6a1803df08f44-6bb9830f744mr268696376d6.11.1723034332223; Wed, 07 Aug 2024 05:38:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723034332; cv=none; d=google.com; s=arc-20160816; b=qisBgy+oZcNkcRfv9rr4leQxXfKTJMsWrf4Am/pvUv/ZIOS7TinyEij9usHQRyeLIi pdEVXpidLssF8YxYiM6zmhgljGyovCKBT69uOVo2dsTHnisaWg/EeIx918cVC06tEJhL ijBVuDZeSeXphwoeRONFvR6vt8XiFnoY1w8Lfc4FT+BkbX2bZlVIq3FDZnvABQJ1CYGX 45Fi8LZj37iXkYBGO/vL9vdxLaq2oZnlaRPOh2x9d2FPwJGENykbd2pbrgtGFDrfOvkV vCdXuFIzj5IGph7ptWcqr8im5in3Z5Z5b76rK1tnzBPeUBHAk30STKCBP9DBdQaEpu/q 4Q0A== 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=ywvbD4ylErzoB2IlWnu3L0NLvq9GVVuZHGzPWx3FgPM=; b=jLT8Bfsj9YtJ0YmtNiTbEFfuXTKfZorYE5ND2IP7S7HFtxoBedxSjHe3dnt5zMLY4V HNg4b9aikPscWNLijtxlwBt2LpWPW86+3m5PG30+WO3Dy5xdzq9hR9cUhRQ1dunSsZ0b 4A6U5GDdbCn7mPhtta1asPRsGa6V3/ZvtKzqzBRIsiAxZL7UUyrR4qMhKAlx85BQv1EX 0NpeD6TfGVT4H0xQ57eZN0u1q5X5W5NfckVfzdyY0hXYIBoGxcz//IbWzNpafiVr9CsE 8BIFlbKt9bHZoXboHpHIT5e864yFrPEQvwNyetXQqfNClMxJq4kH1GCuFNrpzteiSxOj KzMg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DU5H6yUb; 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-6bbbb90f8ddsi16850686d6.493.2024.08.07.05.38.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 07 Aug 2024 05:38: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=DU5H6yUb; 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 1sbfvQ-0003Ei-Be; Wed, 07 Aug 2024 08:37:56 -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 1sbfvM-0003E8-PK for qemu-devel@nongnu.org; Wed, 07 Aug 2024 08:37:53 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sbfvL-0004io-5H for qemu-devel@nongnu.org; Wed, 07 Aug 2024 08:37:52 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-42812945633so12825895e9.0 for ; Wed, 07 Aug 2024 05:37:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723034269; x=1723639069; 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=DU5H6yUbh64Q27BuJS467eFTyzdveZYHJxdTsuFs3Sw2h7BHaqU/I2F1f+zO38T9q6 mmrmytwVXklWhJnrOQCV12vOUaiWzpdC1Yr7WhON1PXMA0TAHjtcJFGRSzyVr26FVeUo xVgo0HXvAzNLc1r9IFQJ0W0UaSSzFRgQeaGNEaNGS7LD7WHWkzUckK/4i+4wk7YrBaVh rK4as6h+aF2NawaoQUQhmmuP3BUnGclqR+7brVM1sgDcySJhn9bAZGob17MYzw40xG2T bxXT6Q+J5eqaA52xnGG5HebHmsOuLTqWOA0kN4cTl0m+ypMPU6H8KyeiAXONYVUgc3ji g2Sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723034269; x=1723639069; 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=kQryK3uSMGs07rfpYc+5jcTZnqZTP5bTDOljFuzgjo9G56LQUYJoHVDAkosQiCnbzb gm39R1i/uAPVzHkl4Za1Uoeyci0fO/3wV4HP9zESzREx80ygAQwSft5YyIt612z/ltgp de8hTLqMlSFn/SQZ8sMFfA+3ZQtulQYsSxgyhS2QBuPYKtt4Qg1DXSR+sqzXuqsl74IK vYyO4+pwIULrV84kJumMbiWxl4IQPo0CwnNf8fKUoYpkRCVxGoltOUZXlG2N/HBYrr3P KRe3sgCqI0RpsQlKyx+B74jezUnlfaTb9/bx7HRwOGrRazFZeGHW8M9N2Sr0l8k6jIAK ljfg== X-Gm-Message-State: AOJu0YxhJSS0zS2Yk8+h1jQp420XjQWTQnAI8NhxpVf6G3ay+AYESBTn AnfVHyhVGYiZWp6I4rKtJGAou6qKcWBtCI7dVTEi7QjoglvYfXlqJ4i3AIsI5gtKJQfwFyqZVFs j X-Received: by 2002:a05:6000:1fa2:b0:368:7ee2:b7c8 with SMTP id ffacd0b85a97d-36bbc0e6721mr14969362f8f.1.1723034269357; Wed, 07 Aug 2024 05:37:49 -0700 (PDT) Received: from m1x-phil.lan ([176.187.212.120]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36bbcf0c314sm15660585f8f.12.2024.08.07.05.37.48 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 07 Aug 2024 05:37:48 -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 v2 2/4] linux-user: Factor print_buf_len() out Date: Wed, 7 Aug 2024 14:37:32 +0200 Message-ID: <20240807123734.52501-3-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240807123734.52501-1-philmd@linaro.org> References: <20240807123734.52501-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.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(")");