From patchwork Fri May 22 02:34:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 187113 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp2102132ilb; Thu, 21 May 2020 19:34:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx4c2Tgef5tt0feTjWHFyV4KeW48tr8W1hoAs6JfIxtPMQJoptcAvEtwBQlIfTHebkVVpUl X-Received: by 2002:a25:ba4c:: with SMTP id z12mr14904525ybj.164.1590114896730; Thu, 21 May 2020 19:34:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590114896; cv=none; d=google.com; s=arc-20160816; b=09mWXLppgb8W3Nx4yyDBruYHNktHRiHhAXSZTEW68HnxGLWRkH6+VG+CeoL22zYb6x XdVFgEP4fBoYCSCssWI9thi1idVhvdarCyvpUMKuGOj+8MaUygfJ38JcF7C9Ua8TnEgp LYoY63aOGZ3FV+SITbpkyuabYJDf7g9MPzVwv0KK2nMkAFX7F1ZW66ZS7SQLPsTkB5sN gsiHdo4ygO2+5scww0lrdADuQnvOpgKecEmKCC8RH1r89mP95lVa/DOwkB2SbM330V4V HeEGXFtUteDzZbtZ3GS2NoI1FuTYuIbVyvNXk0FnnOK3dBOtBtgbYuZrwtIm/SyriANV xXeg== 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=gkyAigBcxeB9sTmXF9GJufgbDs99qzgoeJAd1MWy3/8=; b=Zi6m5/QejAwHDkdUG2QD0JQyZ3/UJbGzmE0GmltOhG+l2hNbkcfvz+HeSh24M4oty7 WDfkDiO9daCTNajtgWZw+Yl2p16/IBm2GuYKamP3i3NIbz0vyKV9RQD3O986pjyNr0gC kMD1keCozwNSM/HJXLt7V2jE4e+2Cx0GipvRj5Qzp1du45tcTYBRlXAI3yStYL4Qcy6D IJKQj6JALb25mZhrHXzW3oPbYj1FUnP94tpMeRu7M6/KKUAdaoDyz4mGvBsFE/QFUncW Z1nfuP7HxIHywPokC4O2PcezAILuxLxOx3yNkhJBpSFj5jhzG2P3KsLIIHr29hWNaRVC T1Xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="eYjy3/1M"; 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 j133si2105923ybg.247.2020.05.21.19.34.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 19:34:56 -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="eYjy3/1M"; 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]:42918 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jbxWS-00023s-8b for patch@linaro.org; Thu, 21 May 2020 22:34:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48158) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jbxWI-00023Z-AA for qemu-devel@nongnu.org; Thu, 21 May 2020 22:34:46 -0400 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]:35254) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jbxWH-00055l-7N for qemu-devel@nongnu.org; Thu, 21 May 2020 22:34:45 -0400 Received: by mail-pl1-x631.google.com with SMTP id q16so3822656plr.2 for ; Thu, 21 May 2020 19:34:44 -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=gkyAigBcxeB9sTmXF9GJufgbDs99qzgoeJAd1MWy3/8=; b=eYjy3/1MBhnXWugPc+CFxZeLIxiTC0jYd4kIUwzJV8T2KLpJ8jQYffGbx5qJFaY3j7 deRPgUhyPV4SE94sam6cWYBP5R2zj1LaKDSZJbJHQaKLsYczXCd2KbMk/7Zqiay2bWvV +da/AAj7xBe14iChYVnA7PoUzV5gu+daGIAmlZDyr+Zd613Wl5w8v1nq/loMNA5MG15P jF+EHWquY78+ZrfrTHq8Ps/oKuNUcoF8rMOPC9TjS+LGi40fnG9E1sWb6n/ORjmUXZ98 ANzbmk4z64vlH8Ztxw71oVjbC+0iN7hOE0FvO4je8HdOdIa676Yxho0+9cgrn2/FKmMM L59g== 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=gkyAigBcxeB9sTmXF9GJufgbDs99qzgoeJAd1MWy3/8=; b=NDPG1c44YcoTW6+U7vtrRj0GQAkHD0dBeVHor8IaT43CZKpY0IYip/eNWb+8A2Pax7 B/oYzAP80HpLXJLKdblkBOmZgwnKzYdOhu+7ySh8F/WqWygoY3MgdAZJMZeLDO5m3guo YU5lfiwFDjI3bSAlDJDEVQ03GONMVGXEixu7Csc3lUnC8W0GLRfJnhIl0IYPNybeCV5K 40b5z008XLJryrgEWtqiWnlR6ARQN8pLxm958FOkBAbukjvlMYFlW45W+QWaxjfs/nAL HZ81H6BkLZOrY1ZT3C1BenWbANuUBr1lAWj8UfIsvzghrCqNVQzP+6ag+DFeLosc68gB fiLQ== X-Gm-Message-State: AOAM5329gzG03tsbggdU42Bxf5hLFnFBr1zbdcI+XGz+oVAVWr5HEm92 1uJnA5wYSBn/T4rwHgr23r92FQEBIAo= X-Received: by 2002:a17:90b:3745:: with SMTP id ne5mr1822404pjb.68.1590114883474; Thu, 21 May 2020 19:34:43 -0700 (PDT) Received: from localhost.localdomain (174-21-143-238.tukw.qwest.net. [174.21.143.238]) by smtp.gmail.com with ESMTPSA id gt10sm5443755pjb.30.2020.05.21.19.34.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 19:34:42 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 01/25] Use bool for tracing variables Date: Thu, 21 May 2020 19:34:16 -0700 Message-Id: <20200522023440.26261-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200522023440.26261-1-richard.henderson@linaro.org> References: <20200522023440.26261-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::631; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x631.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 , alex.bennee@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Reviewed-by: Alex Bennée 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 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;