From patchwork Tue May 19 02:53:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 186906 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp3446965ilb; Mon, 18 May 2020 19:55:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyEnBk4WW7NS37eIhGqAlfTUYPvS4HsN5ckkWkgA2lbPg6IDPguiTSgwado5611YhK/poAP X-Received: by 2002:a05:620a:1f7:: with SMTP id x23mr19432940qkn.491.1589856946650; Mon, 18 May 2020 19:55:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589856946; cv=none; d=google.com; s=arc-20160816; b=soISeuvtNGfr9MKwUnzvtWWb010gaajizmImB5KDcCJGho1iWfZFprEy8720Gbiqex UZdJ3kg6fSt07/1AXqU9xnWO7rx1pj4UE3l3MuvOPVUUpf6dbVlcXj6Wn5yDiNEogrkJ ChHx1zzkAnRSfzy12OLp39+qj9k8nnip+D2DTfKGTbqmg9QxTHd9OB+MnRLCjhNLeGg7 DYhBAlYOoBZ56VeawFasbg+mX3vfwUMsJFdXUVQQC7bGzb6Q1H5EwDwOZB1BvP3OInvK DkGD1v+R9WgAYvN5+O9S+lJWSOCkmJqpOfiNs4UGLpCop5qatXa5afiqIstTuTx+6Nzn AG1g== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=J6GEOI64wSUnLIdW8jpIq6kLD++FF+yxc6i0EiqZJFU=; b=rhjU1DBgFlW1wymgOGwGTNIO1A/5yYgG4KvFrnA7DVsF44MUx1oWda/d4bzHVzHYLw ylzIf+PMLM6QywSnfdeT12Krc8P6XbmZeDKALCfRGn+T3oDtvEL2D8pIwM7548/A31mU 3x3WLNApnPJ2vWxEZamAX/Z/5R8AV+/J9sy7Rn2xUVWkdbwvxoZDRIohfadykAOma6Sx N0WQe4LbsC2mBGCtuNJoMrlNhQzQFlaIH4VMYzm4Td9ofPQuaL68HtiLl75XEomjxOif 1DbRTGKVI0gECz0kIivUMbZpaaJaM0ralRBkMLfb9ZW6TcCz1D9WSpz9KkLwHTFD7jSM V9dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yB4GxqVR; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id c15si6363538qvo.71.2020.05.18.19.55.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 18 May 2020 19:55:46 -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=yB4GxqVR; 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 Received: from localhost ([::1]:34438 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jasPy-0008VK-40 for patch@linaro.org; Mon, 18 May 2020 22:55:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46768) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jasOH-00056h-Pj for qemu-devel@nongnu.org; Mon, 18 May 2020 22:54:01 -0400 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]:35861) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jasOH-0002OQ-1D for qemu-devel@nongnu.org; Mon, 18 May 2020 22:54:01 -0400 Received: by mail-pf1-x42d.google.com with SMTP id z1so5876663pfn.3 for ; Mon, 18 May 2020 19:54:00 -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=J6GEOI64wSUnLIdW8jpIq6kLD++FF+yxc6i0EiqZJFU=; b=yB4GxqVR9ejP+DUevjbKZtciyXoe7y3iRBX2baTlao2QsZ2hjQFnWCDEod1Q3B/Zi3 URENq4sg54ZZkcUce8dbCQoOUrXNnfrzKpPj/TcZWFlfJaw5G2QS0jq1IXsiDz9ss1uB AtcN/wEQXH+1Q4XddpVbZLbrOmCKMD+j1dZse1X2L0lef5ibZrJwov9uJBp9+eiKgexI 8vVujPI4N/k3CViP2dy7E6Boro459+Dqusrz+NzU8AuK0v+Cj1vV3TW2+gWK3K+0QsRR YQdrC/niOhcI0NHNhBt95lTbnfbCvIl2EEF/kM83vs8ktf5LTa47C7K/9pAblFea9EyA nDOg== 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=J6GEOI64wSUnLIdW8jpIq6kLD++FF+yxc6i0EiqZJFU=; b=TcI7drd9RDvJFRUgnLiKRjhIYISPAWQlE/s/eRJdtnYVF683q13c/G43uvP/Z7mSUH UMdcbIOGgs+oDRw0YtpzL9e9wkn/puJfAXtI+SB1nHQPR2s01Hmo2KRVLfM5O0WHr/QR 1QY8FPpcqLq1qtRvYvhhn7DexCC3P8hEErJV3Z7XJndNVzYFuS59T5Gab75B2fUH4tNk ts0fu9gGsFyESSSjVSbMsiG36IfafZjdvgTRTtQbpLuIHv3Q1HfYcDv/7nxywlX7Ksdr tWfOlwJ7Vn64ymxuAj0KeWiKbq399y2s7oWwC5Roc4mzDl8L19B7Mbm8AurVTGeBUNK3 op4A== X-Gm-Message-State: AOAM530N7yoxQbM0SAJH1wKpIy9/rKpy7PRKv6/yY8domA6J8FhjSoFR THu81SjsGUCjWgcWrym2CRwkI+dVPwk= X-Received: by 2002:a63:175c:: with SMTP id 28mr16761352pgx.44.1589856839108; Mon, 18 May 2020 19:53:59 -0700 (PDT) Received: from localhost.localdomain (174-21-143-238.tukw.qwest.net. [174.21.143.238]) by smtp.gmail.com with ESMTPSA id a2sm8772418pgh.57.2020.05.18.19.53.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 May 2020 19:53:58 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [RISU v2 01/17] Use bool for tracing variables Date: Mon, 18 May 2020 19:53:39 -0700 Message-Id: <20200519025355.4420-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200519025355.4420-1-richard.henderson@linaro.org> References: <20200519025355.4420-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42d; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42d.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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: peter.maydell@linaro.org, alex.bennee@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- risu.h | 3 ++- reginfo.c | 2 +- risu.c | 8 ++++---- 3 files changed, 7 insertions(+), 6 deletions(-) -- 2.20.1 Reviewed-by: Alex Bennée diff --git a/risu.h b/risu.h index 8d2d646..e2b4508 100644 --- a/risu.h +++ b/risu.h @@ -17,6 +17,7 @@ #include #include #include +#include /* Extra option processing for architectures */ extern const struct option * const arch_long_opts; @@ -96,7 +97,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(int trace); +int report_match_status(bool trace); /* Interface provided by CPU-specific code: */ diff --git a/reginfo.c b/reginfo.c index dd42ae2..1b2a821 100644 --- a/reginfo.c +++ b/reginfo.c @@ -141,7 +141,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(int trace) +int report_match_status(bool trace) { int resp = 0; fprintf(stderr, "match status...\n"); diff --git a/risu.c b/risu.c index 01525d2..79b1092 100644 --- a/risu.c +++ b/risu.c @@ -31,7 +31,7 @@ void *memblock; int apprentice_fd, master_fd; -int trace; +bool trace; size_t signal_count; #ifdef HAVE_ZLIB @@ -228,7 +228,7 @@ int master(void) signal_count); return 0; } else { - return report_match_status(0); + return report_match_status(false); } } 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(1); + return report_match_status(true); } set_sigill_handler(&apprentice_sigill); fprintf(stderr, "starting apprentice image at 0x%"PRIxPTR"\n", @@ -344,7 +344,7 @@ int main(int argc, char **argv) break; case 't': trace_fn = optarg; - trace = 1; + trace = true; break; case 'h': hostname = optarg;