From patchwork Mon Sep 16 08:53:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 828995 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:4187:b0:367:895a:4699 with SMTP id ei7csp681917wrb; Mon, 16 Sep 2024 01:57:21 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXpIUBdm1KzLfr6vOAma0Kptr5Z96oKe4RhbXgGcoxSK67/yXV4DcW/dN2a0r+DaAj/Vg5iGw==@linaro.org X-Google-Smtp-Source: AGHT+IEBV5MMBy4euI5F2uK/stkLQdqGXMS0ZYac+H7h1URyL5SVf1XKbu29iJqVV8dMdQrXLFQ/ X-Received: by 2002:a05:6214:2b8b:b0:6c3:67b3:4c1d with SMTP id 6a1803df08f44-6c573519b5bmr261766656d6.13.1726477041512; Mon, 16 Sep 2024 01:57:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1726477041; cv=none; d=google.com; s=arc-20240605; b=OEGjT8R82qhlOwukM2UHOC9fde23XXuJjlI8Zk+oDgM5pSPwGBYJ0uHCOq/TS/4+Y7 B/sy4f4SPh4styKqyo2FmQBGZ7HZEzeeKpLzs6XCGpJJfAwmhgzJQ5NhLNmNGGdrxUwd s48/e0wtCrTfyfniBtO/Hv6uX9yRCF7FHRlHlEHYnRwOOfzUUpb3b+m4zQyWaLbq3uCb y1FwUgazHcaXs5XfDnt7tLg2k/Fbpgg8otuJqBhgKA3UY4V50QIJ4IqoiI9amIhkLVK3 THSoyOv2y4eCIseMPBEErDciSP9rdn8OM8WiLUy0nO+JyvwhQHCQvEnaU9dj4ipLPvKk koXw== 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=mlT6xKCM1MHGEdfr2CcDhKWOabJzOeHlvX+jZ2i+MVk=; fh=ATDHygEnrhDZDytw2YSa+GgRs9jfnpjrC7XifhYWFyU=; b=jtjWc/XQ4DN4k3K2snyKMQdbWprmznLYKteD/O3gLI98yEJ9UAISkM/nJZHDSb7Tyv J8JsWB6f8uJFNPHbG0HHpWDmn3d4GVBMDkXEZ0bpLqbWCr/JmaqRJH58VRa82JJKSqxB bW8oD5JqOl6XwaRQi8JDpVJc72z2Pqk14kk+J4B6tX/vSD6CplDxEGiIlRylSUJzLMOb zr/MDG20GN1kItPPdP+e3q/wWppt7/vQzcCv6bcGXEfft2BtU1kNMZpIsSEIkM/2//8A 9Qv4QZ3d+DI4VMycIkiXSJMzdRAmrUQT56frZGVaRoXMvT5GuTDRBDkG7akOiMcxRCvK mNRQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xMK+nSwB; 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-6c58c7a5468si53107546d6.314.2024.09.16.01.57.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 Sep 2024 01:57:21 -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=xMK+nSwB; 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 1sq7VX-0001j4-V0; Mon, 16 Sep 2024 04:54: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 1sq7V8-0000XT-Ar for qemu-devel@nongnu.org; Mon, 16 Sep 2024 04:54:31 -0400 Received: from mail-lf1-x132.google.com ([2a00:1450:4864:20::132]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sq7Uq-0005E2-Rk for qemu-devel@nongnu.org; Mon, 16 Sep 2024 04:54:30 -0400 Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-5367ae52a01so3294291e87.3 for ; Mon, 16 Sep 2024 01:54:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1726476851; x=1727081651; 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=mlT6xKCM1MHGEdfr2CcDhKWOabJzOeHlvX+jZ2i+MVk=; b=xMK+nSwB9XzwUW5iheJut5EN9Q0Pl/TC6LbBgQyO/rU7/1sDEIEgy0Q1SD0glREyJl 0n8UXrLOpJow8U+i/Fu+B1ou+F6NAbPJHNm/yHvxAuXV/XR4ueRwLOnilq2eHp7EyYo/ ryrGSk/dwrsxNEiOhwHVFGrr4gYr4Iv8YIU+yXPYaI1rIs1Izdrf5+keATzWXUSV0MDs 946a7p/nGT/XOwwZu6S8oZAqt1d03DrlGIZluSf0gZro2Q/NEAREN0OxNreh8T9QAgdb JA645aiBPY1HSivVSBDfqvqFZIY3A2pThC3n0cNYt91tM8ZnwNuBQdUhqEjXyJ2PfPMh w8xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726476851; x=1727081651; 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=mlT6xKCM1MHGEdfr2CcDhKWOabJzOeHlvX+jZ2i+MVk=; b=ToI1VaKyiTIWLjMp6UBqT9blqM9VTPYHpXv+X4u1VK2XFWjvz0JKbnjoy5A67HCijL 5mdinZd6LR1x2/WaqHwMDyzMoYVbtC83l6hICbtmjlzzfsOYgcmC9dNzGDs+ULDG6bmz enpuAJ2dJpl7nMRer3Ab3KKWc2IMOO4Zr3g8XZq22bqcSw9HPXmySLk6aVDXIJxLdBVi +oG8y0mvqcRmKX63AlpgIyhpouaYjt3sqPCm2b3JqRCr8raI5wUWI7GuceWeKPwMUOp/ GdwDmL5VjvHgopQPwNwqOU3KQBtGjmCnk7oahndFrnhRY12d5A8fW0Z0dCCLxOvdRVSp WDEQ== X-Gm-Message-State: AOJu0YyOkkXdvMthw0G+HT0Ix7qo3WaQ/5dW8HOshU8K0QVkhWoMRDXn wfI9LObnghfKY71Tx+dQuB5Qo2jnJV82z/qzAIpnRUEP9ULn6u8QTV+Tsxq0j8I= X-Received: by 2002:a05:6512:3a8c:b0:52e:987f:cfc6 with SMTP id 2adb3069b0e04-5367ff32c42mr4417081e87.51.1726476849860; Mon, 16 Sep 2024 01:54:09 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42da242138bsm70655045e9.35.2024.09.16.01.54.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Sep 2024 01:54:04 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 444DC5FC60; Mon, 16 Sep 2024 09:54:01 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, Thomas Huth , Richard Henderson , qemu-ppc@nongnu.org, Ilya Leoshkevich , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Marcel Apfelbaum , Alexandre Iooss , Eduardo Habkost , Daniel Henrique Barboza , Yanan Wang , Nicholas Piggin , David Hildenbrand , devel@lists.libvirt.org, Mahmoud Mandour , Zhao Liu , =?utf-8?q?Alex_Benn=C3=A9e?= , Pierrick Bouvier Subject: [PATCH v2 10/18] tests/tcg: clean up output of memory system test Date: Mon, 16 Sep 2024 09:53:52 +0100 Message-Id: <20240916085400.1046925-11-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20240916085400.1046925-1-alex.bennee@linaro.org> References: <20240916085400.1046925-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::132; envelope-from=alex.bennee@linaro.org; helo=mail-lf1-x132.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=unavailable 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 This is useful information when debugging memory issues so lets improve by: - include the ptr address for u8 fills (like the others) - indicate the number of operations for reads and writes - explicitly note when we are flushing - move the fill printf to after the reset Message-Id: <20240910140733.4007719-20-alex.bennee@linaro.org> Reviewed-by: Pierrick Bouvier Signed-off-by: Alex Bennée --- tests/tcg/multiarch/system/memory.c | 47 ++++++++++++++++++----------- 1 file changed, 29 insertions(+), 18 deletions(-) diff --git a/tests/tcg/multiarch/system/memory.c b/tests/tcg/multiarch/system/memory.c index 6eb2eb16f7..8f2371975d 100644 --- a/tests/tcg/multiarch/system/memory.c +++ b/tests/tcg/multiarch/system/memory.c @@ -63,12 +63,14 @@ static void init_test_data_u8(int unused_offset) int i; (void)(unused_offset); - ml_printf("Filling test area with u8:"); + ml_printf("Filling test area with u8 (%p):", ptr); + for (i = 0; i < TEST_SIZE; i++) { *ptr++ = BYTE_NEXT(count); pdot(i); } - ml_printf("done\n"); + + ml_printf("done %d @ %p\n", i, ptr); } /* @@ -94,7 +96,7 @@ static void init_test_data_s8(bool neg_first) *ptr++ = get_byte(i, !neg_first); pdot(i); } - ml_printf("done\n"); + ml_printf("done %d @ %p\n", i * 2, ptr); } /* @@ -105,9 +107,18 @@ static void reset_start_data(int offset) { uint32_t *ptr = (uint32_t *) &test_data[0]; int i; + + if (!offset) { + return; + } + + ml_printf("Flushing %d bytes from %p: ", offset, ptr); + for (i = 0; i < offset; i++) { *ptr++ = 0; } + + ml_printf("done %d @ %p\n", i, ptr); } static void init_test_data_u16(int offset) @@ -117,17 +128,17 @@ static void init_test_data_u16(int offset) const int max = (TEST_SIZE - offset) / sizeof(word); int i; - ml_printf("Filling test area with u16 (offset %d, %p):", offset, ptr); - reset_start_data(offset); + ml_printf("Filling test area with u16 (offset %d, %p):", offset, ptr); + for (i = 0; i < max; i++) { uint16_t low = BYTE_NEXT(count), high = BYTE_NEXT(count); word = BYTE_SHIFT(high, 1) | BYTE_SHIFT(low, 0); *ptr++ = word; pdot(i); } - ml_printf("done @ %p\n", ptr); + ml_printf("done %d @ %p\n", i, ptr); } static void init_test_data_u32(int offset) @@ -137,10 +148,10 @@ static void init_test_data_u32(int offset) const int max = (TEST_SIZE - offset) / sizeof(word); int i; - ml_printf("Filling test area with u32 (offset %d, %p):", offset, ptr); - reset_start_data(offset); + ml_printf("Filling test area with u32 (offset %d, %p):", offset, ptr); + for (i = 0; i < max; i++) { uint32_t b4 = BYTE_NEXT(count), b3 = BYTE_NEXT(count); uint32_t b2 = BYTE_NEXT(count), b1 = BYTE_NEXT(count); @@ -149,7 +160,7 @@ static void init_test_data_u32(int offset) *ptr++ = word; pdot(i); } - ml_printf("done @ %p\n", ptr); + ml_printf("done %d @ %p\n", i, ptr); } static void init_test_data_u64(int offset) @@ -159,10 +170,10 @@ static void init_test_data_u64(int offset) const int max = (TEST_SIZE - offset) / sizeof(word); int i; - ml_printf("Filling test area with u64 (offset %d, %p):", offset, ptr); - reset_start_data(offset); + ml_printf("Filling test area with u64 (offset %d, %p):", offset, ptr); + for (i = 0; i < max; i++) { uint64_t b8 = BYTE_NEXT(count), b7 = BYTE_NEXT(count); uint64_t b6 = BYTE_NEXT(count), b5 = BYTE_NEXT(count); @@ -174,7 +185,7 @@ static void init_test_data_u64(int offset) *ptr++ = word; pdot(i); } - ml_printf("done @ %p\n", ptr); + ml_printf("done %d @ %p\n", i, ptr); } static bool read_test_data_u16(int offset) @@ -198,7 +209,7 @@ static bool read_test_data_u16(int offset) } } - ml_printf("done @ %p\n", ptr); + ml_printf("done %d @ %p\n", i, ptr); return true; } @@ -239,7 +250,7 @@ static bool read_test_data_u32(int offset) pdot(i); } } - ml_printf("done @ %p\n", ptr); + ml_printf("done %d @ %p\n", i, ptr); return true; } @@ -293,7 +304,7 @@ static bool read_test_data_u64(int offset) pdot(i); } } - ml_printf("done @ %p\n", ptr); + ml_printf("done %d @ %p\n", i, ptr); return true; } @@ -365,7 +376,7 @@ static bool read_test_data_s8(int offset, bool neg_first) return false; } } - ml_printf("done @ %p\n", ptr); + ml_printf("done %d @ %p\n", i * 2, ptr); return true; } @@ -398,7 +409,7 @@ static bool read_test_data_s16(int offset, bool neg_first) return false; } } - ml_printf("done @ %p\n", ptr); + ml_printf("done %d @ %p\n", i, ptr); return true; } @@ -431,7 +442,7 @@ static bool read_test_data_s32(int offset, bool neg_first) return false; } } - ml_printf("done @ %p\n", ptr); + ml_printf("done %d @ %p\n", i, ptr); return true; }