From patchwork Sat Oct 5 23:33:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 833016 Delivered-To: patch@linaro.org Received: by 2002:adf:8b52:0:b0:367:895a:4699 with SMTP id v18csp1380019wra; Sat, 5 Oct 2024 16:34:37 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUqD6lnu62bCW9a18cKybCHZ61EVWq+Va7gTV7aN6+JjAfjjou1SymRimRLsgNsR3Pz4njDqw==@linaro.org X-Google-Smtp-Source: AGHT+IFw2wx/PFA4QCSRcBxWSLfMeV54Rmuq6XmNWbXytP0by0+JQQVtTVG2gbJgUNlrvcOmUvE6 X-Received: by 2002:ac8:5d09:0:b0:45b:5cdf:54f3 with SMTP id d75a77b69052e-45d9ba21589mr107806101cf.10.1728171277280; Sat, 05 Oct 2024 16:34:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1728171277; cv=none; d=google.com; s=arc-20240605; b=U+d83KElHj/7gUEkOn5weJBGvmmJ7ME9RR1MnaU06W1TiOukWWm94ebxoZ4A2qr6Jh AdVpUnn38vPP2I8kJpC+fiVM2WvVLpLpl/NdqIPrhL2mDXYl+p6mgiNeeEzXCRmQsDi5 lh8FmZlJ6whTzyB9IGhvmfhj5ZCAWTu7FQqj+tdPmEC+9j91o47dBoKU/AmeD3Lv1Hhc X3g7TEHInoSHf4w3L553kN5T49l23BcTVkIUfW+zz5RsuOF1+OAhlq0ZL8/g0TxmbAv5 VTocg/PmLTr7W+63Bf66vdKd2kdzrHosNFKbB6d5suwA4VHFvds77hy2rOWP8Mj5HLHR CFTA== 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=5CYklN5kY6AhJz0z8fnMo7i52/61zUcEwxCjMHlZ3PY=; fh=RZjZOy5+Yj9WJfOPbqEaL9dDAfIcQQit8cKdQSuDgDE=; b=Y2oIbyxdD6vpoyC6TUf6uqilyHCaNx6C2z7HST9jWpew8m8nS9WyxBmbleDtuqkKjb JeXmkKFPeuDCLA+RSRSnv9pIjP9ikdQ7YjaMTjrtpaH3Pbz1BwxLhXlx1EqD/+3audW9 ljETO4vryDU6bjkGzAC1oAuP8dJqgtt7AAQRVd3VhcSicAtN5ltK2i4x+Fl5MiY7Ordc KZ4pk/VpGPeLT6zwm6dpmCJpJOPk0qCDeNAyMhhsZ0P1pnkKCLb14h+WKittBlzQfuZ1 +zVZ4QiDm6b+eok93XEPwxpw7tb+SdqHwCctSpamMLaaQLrmTnH6XE+YPFgUoP2g69B+ mF5w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OFGG4gZL; 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-45da74ac816si30281601cf.32.2024.10.05.16.34.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 05 Oct 2024 16:34:37 -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=OFGG4gZL; 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 1sxEHb-0006C6-Bd; Sat, 05 Oct 2024 19:33:55 -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 1sxEHY-0006Aj-Mr for qemu-devel@nongnu.org; Sat, 05 Oct 2024 19:33:52 -0400 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sxEHX-0004DT-9K for qemu-devel@nongnu.org; Sat, 05 Oct 2024 19:33:52 -0400 Received: by mail-pj1-x1034.google.com with SMTP id 98e67ed59e1d1-2e1bfa9ddb3so2481927a91.0 for ; Sat, 05 Oct 2024 16:33:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1728171230; x=1728776030; 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=5CYklN5kY6AhJz0z8fnMo7i52/61zUcEwxCjMHlZ3PY=; b=OFGG4gZLWdA8Zh95OBZQBsTVgvkGfJOlEsAFbO2+xe15ypmhyr40Y5TF8oD16djA1u KUIqngAeHx0vyjHyeCu9fBFxH67+ydsoH5swH1UTmlbHKeb+Jcj0ashTk2VJDlCgaWV7 0O885zKIe+/F5Qjcv6wv/4+hWh9RLAv6dn0AMZZyhoqFdGZ8EX1E1B5RVu75gtTvRiJ8 vtPinvEcQK0rE7KFU/PqiLbsu/37Ud8lv52HF7JZzxabbjqHbeIBaXD3mL5ZD9i/tI1k 7nVGXzrZOrNcYm4pmUBNk4Pt2YbpeF0OfqXL9vvB6qwb36v+I7xK+QRV5Dp6SZXLHxGp NWEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728171230; x=1728776030; 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=5CYklN5kY6AhJz0z8fnMo7i52/61zUcEwxCjMHlZ3PY=; b=DapsBxGBmJNVSIlrPMvw23EIwRk2XxOx43KUY714bxB1NchbHZF6/nFnmyMa/GvzL9 grl1SCK9wa4PzZtD63SHXVtE2LvmCeL10cyFzmp3wmQpNPYzAH0UFv/XMTwxIe5eHU3k 4PpPE5S2wCMQxk7+2PQomJaH0oo4pzQzTts+SK0qNEDO1rMhNOS2ycA5fsUEip4NG2iJ FAmFaZN33VU81n9/lSeqQaHw/GFAH743U8wfkWNA6SPaYYfTrllhmrLShYxfXyuqwz7A pJ5KOfeDGftts6GvAFRaZAONNrcfvb7WvMNnqo9kHlQmQQGju2KyaqQGl07X97vjXz1V l7ow== X-Gm-Message-State: AOJu0YxQl8BjCthJNtxKryqu7BfsXUpxKmXBG4op4dEZHsUh9PomY7M6 em47VG5JqsXG4+P97ah2sIH+eUzBUSmG5BVnXrCsb7ZoVKMKcKd+ygvY0Di9oe8A9BSBb8ZLpfg D X-Received: by 2002:a17:90a:fc96:b0:2c9:6aa9:1d76 with SMTP id 98e67ed59e1d1-2e1e626bc1amr8125478a91.18.1728171230067; Sat, 05 Oct 2024 16:33:50 -0700 (PDT) Received: from stoup.. (174-21-81-121.tukw.qwest.net. [174.21.81.121]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e20b129cc2sm2394600a91.51.2024.10.05.16.33.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Oct 2024 16:33:49 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Ilya Leoshkevich Subject: [PATCH 06/10] linux-user: Correct print_sockaddr() format Date: Sat, 5 Oct 2024 16:33:39 -0700 Message-ID: <20241005233343.503426-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241005233343.503426-1-richard.henderson@linaro.org> References: <20241005233343.503426-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1034; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1034.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é When the %addr argument can not be accessed, a double comma is logged (the final qemu_log call prepend a comma). Move the comma from the final qemu_log to the preceeding switch cases that had omitted it. Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20240807124306.52903-2-philmd@linaro.org> Acked-by: Ilya Leoshkevich [rth: Move comma into the various switch cases.] Signed-off-by: Richard Henderson --- linux-user/strace.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/linux-user/strace.c b/linux-user/strace.c index cf9eaf71c9..dfdec58542 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -376,7 +376,7 @@ print_sockaddr(abi_ulong addr, abi_long addrlen, int last) un->sun_path[i]; i++) { qemu_log("%c", un->sun_path[i]); } - qemu_log("\"}"); + qemu_log("\"},"); break; } case AF_INET: { @@ -386,7 +386,7 @@ print_sockaddr(abi_ulong addr, abi_long addrlen, int last) ntohs(in->sin_port)); qemu_log("sin_addr=inet_addr(\"%d.%d.%d.%d\")", c[0], c[1], c[2], c[3]); - qemu_log("}"); + qemu_log("},"); break; } case AF_PACKET: { @@ -417,12 +417,12 @@ print_sockaddr(abi_ulong addr, abi_long addrlen, int last) } qemu_log(",sll_addr=%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x", c[0], c[1], c[2], c[3], c[4], c[5], c[6], c[7]); - qemu_log("}"); + qemu_log("},"); break; } case AF_NETLINK: { struct target_sockaddr_nl *nl = (struct target_sockaddr_nl *)sa; - qemu_log("{nl_family=AF_NETLINK,nl_pid=%u,nl_groups=%u}", + qemu_log("{nl_family=AF_NETLINK,nl_pid=%u,nl_groups=%u},", tswap32(nl->nl_pid), tswap32(nl->nl_groups)); break; } @@ -432,14 +432,14 @@ print_sockaddr(abi_ulong addr, abi_long addrlen, int last) qemu_log("%02x, ", sa->sa_data[i]); } qemu_log("%02x}", sa->sa_data[i]); - qemu_log("}"); + qemu_log("},"); break; } unlock_user(sa, addr, 0); } else { print_raw_param("0x"TARGET_ABI_FMT_lx, 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