From patchwork Wed Sep 18 16:58:09 2019 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: 173991 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp2740399ill; Wed, 18 Sep 2019 10:27:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqzkNMvvxYCAeeAgEpP+xf4Uzr8sADEfh70yXWGomiXMZraQ1v5RHKrIcJhg3S1TleWVM1JF X-Received: by 2002:a05:620a:14af:: with SMTP id x15mr5062729qkj.170.1568827665375; Wed, 18 Sep 2019 10:27:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568827665; cv=none; d=google.com; s=arc-20160816; b=Fy1KUHG6tsGxrQw4N7SjIGz6ybBeNQD24rvnfVlTX2LNSfBC0GLyq7fCXbCYP3RB1u Gt73JXQ5CN7D8U44Xk69B1RpOvB4Rcpdgvzu6tZwme6d/V1jjNkNALEmCbptq5Eyf/4H +j7ckWh56lTlOZThy2FGdnIpF+SkjP8Mik3vpk7vmjA6Hq+MiQBjP4I1o48LoP0q8tst nK7Xb6FR1efIvbsLpbBf1pS336KAcvyORhEAIhNuirduSISgFRZ38HyqqFBxgjuNli17 NFL8MEIFFA8yOEQmwilzzWmq7RAzXUbHQp2nefJP9m0UAzGBxFoN1uBWf34g0lyR/Alo vHVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=ORDEN7jiztS7uczUBqCzJ8KnmEaF/pHAiuQlY+j2gcw=; b=Cg6if3jc1nKyKTDN9TY8+aKBTKgaQ8HfCVI4CBqGaDeTRVUS/UIA/Gm1wmlBaklV/i OsLIUOVi0Vtu3dGIHWATsOf+vg0hFkHDanSUYUdW/n6hscOv24YvC0JNI7CwoscTQd9i uEV8JmTuIK9ND486jIrvehfVjEcSVCGA2v3FVcA3wQP+A4dtsRmD4bukOVG73N6DXiwL udU4760sPWwJPYI54IervkFMo3EYmtemuwf6pxwet/zXl8BuQSGizqLs0BXuywbGzJ6z krc6uke2s42H27nEUNT3sNVbkY2vzsFP3C+eSCwv7HPeKDbplvtkhgGjth63dAu1218+ VxpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=cIDoOFEr; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id p1si3921747qkm.142.2019.09.18.10.27.45 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Sep 2019 10:27:45 -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=fail header.i=@linaro.org header.s=google header.b=cIDoOFEr; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:33326 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iAdk0-0006Fd-NJ for patch@linaro.org; Wed, 18 Sep 2019 13:27:44 -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) 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-Received: by 2002:adf:eb4d:: with SMTP id u13mr3554846wrn.224.1568825897681; Wed, 18 Sep 2019 09:58:17 -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) From: =?utf-8?q?Alex_Benn=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 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_Benn=C3=A9e?= , Peter Maydell Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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ée 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(-) -- 2.20.1 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=5$(COMMA)rr=replay$(COMMA)rrfile=record.bin \ $(QEMU_OPTS) memory, \ "$< on $(TARGET_NAME)") + $(call diff-out,memory-record,memory-replay.out) TESTS+=memory-record memory-replay diff --git a/tests/tcg/aarch64/system/boot.S b/tests/tcg/aarch64/system/boot.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 + /* return some sort of counter value */ + .global __sys_counter +__sys_counter: + mrs x0, CNTV_TVAL_EL0 + ret + .data .align 12 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_ +#include + /* * Provided by the individual arch */ extern void __sys_outc(char c); +extern uint64_t __sys_counter(void); /* * Provided by the common minilib diff --git a/tests/tcg/multiarch/system/memory.c b/tests/tcg/multiarch/system/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 = true; + uint64_t start = __sys_counter(); + uint64_t end; /* Run through the unsigned tests first */ for (i = 0; i < ARRAY_SIZE(init_ufns) && ok; i++) { @@ -470,6 +472,8 @@ int main(void) ok = do_signed_reads(true); } - ml_printf("Test complete: %s\n", ok ? "PASSED" : "FAILED"); + end = __sys_counter(); + + ml_printf("Test complete in %" PRId64 ": %s\n", start - end, ok ? "PASSED" : "FAILED"); return ok ? 0 : -1; }