From patchwork Tue Jul 4 14:48:49 2017 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: 106982 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp1090783qge; Tue, 4 Jul 2017 07:50:50 -0700 (PDT) X-Received: by 10.55.214.78 with SMTP id t75mr44169541qki.239.1499179849895; Tue, 04 Jul 2017 07:50:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499179849; cv=none; d=google.com; s=arc-20160816; b=Z07aV/sqs+Bk99hdDjRfZVQkYfzqzKGAC63hiivo6r05Kq+0qI0gQLR3Z52EjR1mwF vZmqnErGsAgeMZ/bDllsqgqwhJTG6gLraJ8jykXpLUu7/oa2MqFNPCNa0zNgHZuHuAAo tEnxaY7di/5JmdY/nj+zxSUdQv9nB1uYNiGcppSWZJeMTqbhR+LGM9GlMkNNoKS0NluP LbUdGgnBJ6FGq5cLYnsFyJheVr2PoXBV96Mgs3w42vTJaT092vn6fivosijatbRma0xJ LN597MCMNALhaziiwMWrkHjfjcoIpziyH3OdLZXDdToHqcxYTVhv2ugaUHsme5iWAIk+ gTLg== 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:arc-authentication-results; bh=FTSGn67ihuLGFvAiU99kcOhzzHe0hsPn7oZPuJFLeYE=; b=LuJkCdFTXGm1iBcO0ilTdVqa+jllv9zJZDz1nFo8gDD4+s1mzaivWh4y3gUXt73zP5 9140DsWwRuRVK+BH7nXsIfYkm7d2DuPaSmS03e+hR4ykgfzT/ta5oDxzaTaAqJIs/UzD 3oi77UcQKqSubnsRrLGa44PWeuGkYEhECKoVrJxzBGVB2eOCFXgmXZFcGDx1L70+P5K2 hmwsD70VofyKqjdaGLKdxj4HhaaYPy7h62U39Qvxdx9DY0nDw8KGB9M7OswoBDVF8PAI RXEgcz9JrvJ+jeMyYHSaA5TkROM33rGgvmmBDTpO5no2nXh2vWHhNSR7ylbuIf3nCCOZ D3Lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.b=MygsX119; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id z15si18063133qtb.268.2017.07.04.07.50.49 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 04 Jul 2017 07:50:49 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.b=MygsX119; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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]:41769 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSPA7-0001hm-8c for patch@linaro.org; Tue, 04 Jul 2017 10:50:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35638) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSP7h-0008DZ-Po for qemu-devel@nongnu.org; Tue, 04 Jul 2017 10:48:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSP7e-00014l-HK for qemu-devel@nongnu.org; Tue, 04 Jul 2017 10:48:17 -0400 Received: from mail-wr0-x22d.google.com ([2a00:1450:400c:c0c::22d]:36315) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSP7e-00012v-AG for qemu-devel@nongnu.org; Tue, 04 Jul 2017 10:48:14 -0400 Received: by mail-wr0-x22d.google.com with SMTP id c11so250372563wrc.3 for ; Tue, 04 Jul 2017 07:48:12 -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=FTSGn67ihuLGFvAiU99kcOhzzHe0hsPn7oZPuJFLeYE=; b=MygsX119yewpAaBPxbkqQOrRwRrgo2D/aIyimCB8uhjbMMKZZe/ErUamoAwPg2/f6Y jk7wgWE2vA9mXerlQAU/slNGf0GCpwduZMl8a4ymbxMTYjwfyBSAk6xyVc9r3veltX/z aM3WUCoMv03mye5M40rkhUPxd5zMWXWc2VIGc= 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=FTSGn67ihuLGFvAiU99kcOhzzHe0hsPn7oZPuJFLeYE=; b=lr15kYK4Qu07ZZF8g58SpsUD/en7lD80a3j2TOehneqbx6i5giBV30Gsr5uMggnLGF ktA7JLQwUL4hxZB2AJWY2PcY3U2j+SyRaYjQ0UMop8KM1B+R46zDbTOwB6Q2r97A2oe6 zSt3z/LnjayU6GBwkdzlol5oRYG+tfmdY6TuMebuQKS7b8pMJNllBKjTBDh1sPLuAi3X YbGq+BlkhxJ/pt2SOsBi7eKtvyrq56KwoQyiDBDHO+Rrz3ZT1Lf/rIZ3CqTfxA+CmfGS NrR7YTJ0j1W7xFSSL7H4v0EnQzmAN2ZD2YmtDnlIXiTvU4E2CYU30op4MC9QA5tjBH1x M+SA== X-Gm-Message-State: AKS2vOyn0ACi4MCzxj629Y6sTlRGcK1pRE3Dgq+wAtC4vwt395xFKo1d cdZ8Vw40kQUSPCbEl8b4lw== X-Received: by 10.223.173.140 with SMTP id w12mr41956418wrc.4.1499179691509; Tue, 04 Jul 2017 07:48:11 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id 5sm14935900wrq.60.2017.07.04.07.48.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Jul 2017 07:48:09 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id CBAD03E19E2; Tue, 4 Jul 2017 15:49:10 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Tue, 4 Jul 2017 15:48:49 +0100 Message-Id: <20170704144859.17644-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170704144859.17644-1-alex.bennee@linaro.org> References: <20170704144859.17644-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:400c:c0c::22d Subject: [Qemu-devel] [RISU PATCH 01/11] risu: make match status take tracing into account X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Alex Bennée --- reginfo.c | 14 +++++++++----- risu.c | 4 ++-- risu.h | 2 +- 3 files changed, 12 insertions(+), 8 deletions(-) -- 2.13.0 diff --git a/reginfo.c b/reginfo.c index 13879d5..d9d37b3 100644 --- a/reginfo.c +++ b/reginfo.c @@ -138,7 +138,7 @@ int recv_and_compare_register_info(read_fn read_fn, * Should return 0 if it was a good match (ie end of test) * and 1 for a mismatch. */ -int report_match_status(void) +int report_match_status(int trace) { int resp = 0; fprintf(stderr, "match status...\n"); @@ -148,7 +148,7 @@ int report_match_status(void) /* We don't have valid reginfo from the apprentice side * so stop now rather than printing anything about it. */ - fprintf(stderr, "master reginfo:\n"); + fprintf(stderr, "%s reginfo:\n", trace ? "this":"master"); reginfo_dump(&master_ri, stderr); return 1; } @@ -166,11 +166,15 @@ int report_match_status(void) return 0; } - fprintf(stderr, "master reginfo:\n"); + fprintf(stderr, "%s reginfo:\n", trace ? "this":"master"); reginfo_dump(&master_ri, stderr); - fprintf(stderr, "apprentice reginfo:\n"); + fprintf(stderr, "%s reginfo:\n", trace ? "trace":"apprentice"); reginfo_dump(&apprentice_ri, stderr); - reginfo_dump_mismatch(&master_ri, &apprentice_ri, stderr); + if (trace) { + reginfo_dump_mismatch(&apprentice_ri, &master_ri, stderr); + } else { + reginfo_dump_mismatch(&master_ri, &apprentice_ri, stderr); + } return resp; } diff --git a/risu.c b/risu.c index 6f213dc..47471c6 100644 --- a/risu.c +++ b/risu.c @@ -228,7 +228,7 @@ int master(void) signal_count); return 0; } else { - return report_match_status(); + return report_match_status(0); } } set_sigill_handler(&master_sigill); @@ -250,7 +250,7 @@ int apprentice(void) #endif close(apprentice_fd); fprintf(stderr, "finished early after %zd checkpoints\n", signal_count); - return report_match_status(); + return report_match_status(1); } set_sigill_handler(&apprentice_sigill); fprintf(stderr, "starting apprentice image at 0x%"PRIxPTR"\n", diff --git a/risu.h b/risu.h index 9f15662..1c8ecee 100644 --- a/risu.h +++ b/risu.h @@ -91,7 +91,7 @@ int recv_and_compare_register_info(read_fn read_fn, * Should return 0 if it was a good match (ie end of test) * and 1 for a mismatch. */ -int report_match_status(void); +int report_match_status(int trace); /* Interface provided by CPU-specific code: */