From nobody Fri May 3 13:15:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1568827797; cv=none; d=zoho.com; s=zohoarc; b=gJbU6n2yk+wNua/awR3E0aQ6gmXPlO4J3gRakuNgZpEMZmozF6LiUojudHh9Yzsg5ONjdrfFFDFTzNmzVqbI4o+NMtMHwO0FJBtNzCyhQtzbz4QpcnI/2NSostzrnYncLbNZvXdpWJTTZycdkwiZDS4Uaa7SAw13fgC8oLqGH1I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568827797; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=ORDEN7jiztS7uczUBqCzJ8KnmEaF/pHAiuQlY+j2gcw=; b=D8Ye0TIdWQI60GkyxOiDFjLSOkbVD21ji+BGpS/enIVzFJ66aLLit1oLP2vFNL0pK9h/jGzmiDigfImR08TeBPiAq2w5HKJBwnI4Sg6CWparvf476UhZYMLwaLIvf5qLlQ+9+8dBrAbte4ExtdcBsKpIBB9O6AeNWTwYLTdufa8= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1568827797092935.852906155014; Wed, 18 Sep 2019 10:29:57 -0700 (PDT) Received: from localhost ([::1]:33348 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iAdm7-00084h-Ab for importer@patchew.org; Wed, 18 Sep 2019 13:29:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34514) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iAdHZ-0003wu-9E for qemu-devel@nongnu.org; Wed, 18 Sep 2019 12:58:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iAdHX-00022N-M1 for qemu-devel@nongnu.org; Wed, 18 Sep 2019 12:58:21 -0400 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]:39407) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iAdHX-00021n-BJ for qemu-devel@nongnu.org; Wed, 18 Sep 2019 12:58:19 -0400 Received: by mail-wr1-x442.google.com with SMTP id r3so183396wrj.6 for ; Wed, 18 Sep 2019 09:58:19 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id y13sm13204858wrg.8.2019.09.18.09.58.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Sep 2019 09:58:17 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 497281FF87; Wed, 18 Sep 2019 17:58:16 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ORDEN7jiztS7uczUBqCzJ8KnmEaF/pHAiuQlY+j2gcw=; b=cIDoOFErpym6c77BebgSvuRgwsxy5cu5Ov3FG9u2Tvazz62x0NSAn+BcZ5vtLBerRU cbHQ/dfhoF1YnlmvfRdyNjvCAoCBE5zVzbBhWBPVAgqSBWo7qU+DxoR4cxW4xm6iox02 qct4asAFn43gWtPyU10TrtDTuwfRS9y4/b3+V+niZIVHU4CjykMAw3HE9zl75NZpWOiQ mhWdC3DyaqpclcoRLUhfCYNJWXNC6GICv6KZkABJL8YijRs7w+rC3u6CauCun2RIpg7J P+fX+akiqrSKXlgOEL/9W7tTT4AIxK0GlGFeBHCFaxZeBs0U0KxBYpHRtfKIy++7r4hA oe3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ORDEN7jiztS7uczUBqCzJ8KnmEaF/pHAiuQlY+j2gcw=; b=lgGgtkkyaHx5MqYqTskbvWsidqBxRsCoNtPdmcI8sNArPkgg9jLSaftYvsEiUR0Suy ylIAWcEHxtOnVWuAnf3u4YiP7BLZgoi02sHKdzgBFGwUoM7/lId//A4j3wssMNl0qu4a UKNPXxpHmDBviC7eeT11BPHzNWQzFL7+SVbdiZJS33qKfpjYCm4Swr7t9A3GV8ErFGZn hGJNKBeFdGVwdeSvs+49XqY6rK/+3g8YKi5PRPL1J1EWIolK4/EjT+cWmee0TTqpRlXh oO6+wYmQCYAEQMKb2cRz1mGFW/YSRximIp3HCkoy4I9VmyqQHWXMDZE/QrwpCLNsPLKW ZYAA== X-Gm-Message-State: APjAAAWNd1NZwinpRN8y9BMqLGNfA7rIL5y6EeEy1rpKdJSTFtfuy98A BJijLEwkgA8fSRFloyvNaFD9+A== X-Google-Smtp-Source: APXvYqwrK3KMrgwinYPcTqRIIzoGLxUUAIA/lkkOVfLVOe75VI12xgrdCjQjOqIVCvVDFvyIAZPuQg== X-Received: by 2002:adf:eb4d:: with SMTP id u13mr3554846wrn.224.1568825897681; Wed, 18 Sep 2019 09:58:17 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Wed, 18 Sep 2019 17:58:09 +0100 Message-Id: <20190918165809.3719-1-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190918153335.20797-1-alex.bennee@linaro.org> References: <20190918153335.20797-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::442 Subject: [Qemu-devel] [RFC PATCH] tests/tcg: add time counter to memory test (WIP, aarch64 only) X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Pavel Dovgalyuk , "open list:ARM TCG CPUs" , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Peter Maydell Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) To better support testing record/replay we should output something that would otherwise be variable had it not been pegged to icount. [AJB: needs a bit of work to nicely work across architectures although most have some sort of counter]. Signed-off-by: Alex Benn=C3=A9e Cc: Pavel Dovgalyuk --- tests/tcg/aarch64/Makefile.softmmu-target | 1 + tests/tcg/aarch64/system/boot.S | 6 ++++++ tests/tcg/minilib/minilib.h | 3 +++ tests/tcg/multiarch/system/memory.c | 6 +++++- 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/tests/tcg/aarch64/Makefile.softmmu-target b/tests/tcg/aarch64/= Makefile.softmmu-target index b4b39579634..698d9b26b63 100644 --- a/tests/tcg/aarch64/Makefile.softmmu-target +++ b/tests/tcg/aarch64/Makefile.softmmu-target @@ -51,5 +51,6 @@ run-memory-replay: memory-replay run-memory-record -icount shift=3D5$(COMMA)rr=3Dreplay$(COMMA)rrfile=3Drecord.bin \ $(QEMU_OPTS) memory, \ "$< on $(TARGET_NAME)") + $(call diff-out,memory-record,memory-replay.out) =20 TESTS+=3Dmemory-record memory-replay diff --git a/tests/tcg/aarch64/system/boot.S b/tests/tcg/aarch64/system/boo= t.S index b14e94f332d..fb7574e9c06 100644 --- a/tests/tcg/aarch64/system/boot.S +++ b/tests/tcg/aarch64/system/boot.S @@ -220,6 +220,12 @@ __sys_outc: ldp x0, x1, [sp], #16 ret =20 + /* return some sort of counter value */ + .global __sys_counter +__sys_counter: + mrs x0, CNTV_TVAL_EL0 + ret + .data .align 12 =20 diff --git a/tests/tcg/minilib/minilib.h b/tests/tcg/minilib/minilib.h index e23361380ae..29c097c545b 100644 --- a/tests/tcg/minilib/minilib.h +++ b/tests/tcg/minilib/minilib.h @@ -12,10 +12,13 @@ #ifndef _MINILIB_H_ #define _MINILIB_H_ =20 +#include + /* * Provided by the individual arch */ extern void __sys_outc(char c); +extern uint64_t __sys_counter(void); =20 /* * Provided by the common minilib diff --git a/tests/tcg/multiarch/system/memory.c b/tests/tcg/multiarch/syst= em/memory.c index d124502d730..fe32ed27bf8 100644 --- a/tests/tcg/multiarch/system/memory.c +++ b/tests/tcg/multiarch/system/memory.c @@ -454,6 +454,8 @@ int main(void) { int i; bool ok =3D true; + uint64_t start =3D __sys_counter(); + uint64_t end; =20 /* Run through the unsigned tests first */ for (i =3D 0; i < ARRAY_SIZE(init_ufns) && ok; i++) { @@ -470,6 +472,8 @@ int main(void) ok =3D do_signed_reads(true); } =20 - ml_printf("Test complete: %s\n", ok ? "PASSED" : "FAILED"); + end =3D __sys_counter(); + + ml_printf("Test complete in %" PRId64 ": %s\n", start - end, ok ? "PAS= SED" : "FAILED"); return ok ? 0 : -1; } --=20 2.20.1