From patchwork Wed May 13 18:09:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 186685 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp684652ilb; Wed, 13 May 2020 11:12:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwQqAqsDOAOzW/3cSZzkfe6vVcqXuLUD02Fmwwb4tDdbol1uZvwzsn3FKYJRn7OMFMhB++H X-Received: by 2002:a05:6214:70a:: with SMTP id b10mr920736qvz.186.1589393522967; Wed, 13 May 2020 11:12:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589393522; cv=none; d=google.com; s=arc-20160816; b=YR1FOhIDilssYxfjF4+UQLP6XbN/n9ziedppvmtvD/3KzkRIWI24BeiIK/S88c23Wr Ox+98fKPeiGZ0Igw5iyqU/T9thgOQRlP2JjmlDUdpxz82vMXbLXEeNmoukpKNWTexFAR 9rGHY1Xorr6naJ2MD79svO1Tv3XZOMIypxU9vNjcQMwCLy+T/PEH4QrhJ6N7sq4glsTI oxGsVh5Ksk+gP1TU9M8vKi/yE9zKiqHTZGXmgNe+lI62OlrlBZLdqBRenyW9VLm8lFnS RExnzuXsxeMdllf1QEwAyy/vGv8mhlXXZ3n7U2VwjzsSbVMvdQ+QUnc23Mm1TvSJ8U23 JSBw== 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=ZgV2/q17x6H7Sn6RUMsv4Yoy4IHja1Ijjf8wQZe1BeM=; b=uLG7tRCDhUQAavHeKXwAe84/49OZgZXW/MLD91kwRzKf/sk67JxWTuikdki+rBDINV vJpLsFB6whW725gZxzXtb2JS5rCCCHn0HF9FWFf3aKQKCKk+Cnv1/3h23BmqH9TyB8pu tu5ZUFCTbIN+4mzgI6SSq8lQ14Cg5ptBYhRe/3WrR5V3kf0pc5uvGEIZ+g4Y6LG63CDu 7y8K8HD4ek27ME60VPZap85UC7nMLE/XI9bG55ESgkM63qaPeKw5XcybKcjuLsFQo96c wBucbAnFEpsL6y2SQ9q7slZvDetov4HzRXegLWvxY/sGFgLmeUBriaa5krGMMm6l5SsJ bXGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="hJzWjm/P"; 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 u20si302692qtj.286.2020.05.13.11.12.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 13 May 2020 11:12:02 -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="hJzWjm/P"; 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]:60320 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jYvrO-0005ZM-Bi for patch@linaro.org; Wed, 13 May 2020 14:12:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36394) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYvpP-0003gI-5N for qemu-devel@nongnu.org; Wed, 13 May 2020 14:09:59 -0400 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]:44302) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jYvpO-0000Ki-Ag for qemu-devel@nongnu.org; Wed, 13 May 2020 14:09:58 -0400 Received: by mail-pf1-x432.google.com with SMTP id x13so85146pfn.11 for ; Wed, 13 May 2020 11:09:57 -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=ZgV2/q17x6H7Sn6RUMsv4Yoy4IHja1Ijjf8wQZe1BeM=; b=hJzWjm/Ppdu4ojt5uk9DhZXaiL2o1DLHMEPiJMtnDM4oyAVwviuFTUy+5enIa72Q4S qGYwo4XgeI4PIrCqPfTwaa2P1TYWMFjZNku0E0qNigNbIOmWr+Z+KGqZmWhUJRMnwK0W ANkSzqKY5ScNQZ3hL1x9JnWqL3ti8mp2yEzt8xMunPqEGFwgAjfnTOWdUVnyZTbrEHCU gEzguY0YUhTtk2WssiW2ffhA2zxSr2eNX0V+wF49jhWDeogaSVxm9AhErt8Ycvs5dWRw uD7rfqfOijhklUm8J/QVI4RYgKN3bsXaA4YME6qCx75sGhEPC4TrpfDTc4XAcTBXfxbG xhrw== 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=ZgV2/q17x6H7Sn6RUMsv4Yoy4IHja1Ijjf8wQZe1BeM=; b=J8YxVJG+B1fZ1tskhxtbn5zFEqbBi0WFep9+tcODWjOt6EzBI8PNtOx3Z5KC154foo f2VYSUK9DJWRV+KogiaC2rNoNnqWLtWLB1AYJG/X42+szeUkd0+feKgGhaDPYyR5dX/x TGYpihTaD2hPFQtMe5ZlMncGyxpI0JCl0FFoLY2FY2deoPECvZnkG61k0zVaXH3xcFO/ K0LrqieFHcSwNzL2SiKCR+K16EKZtYjY+6ag5vDtMH6E5bg8S5mVfbV55CutonEJcX6B gSBYvUchvG4PGW+cmiRCh72IZrSPKeC5cyHkMV+lQORupFP4h1V23HoWQLlF6D5ch1dc UUgA== X-Gm-Message-State: AOAM530+EZBL6fz27TSirzKyNrKYuKEb7FrYcz2gcplBGqB/9xuf1pL2 8Z4dZ1gVwG8I2errru/s6251Hp4sZgg= X-Received: by 2002:a63:150:: with SMTP id 77mr495647pgb.136.1589393396669; Wed, 13 May 2020 11:09:56 -0700 (PDT) Received: from localhost.localdomain (174-21-143-238.tukw.qwest.net. [174.21.143.238]) by smtp.gmail.com with ESMTPSA id i185sm197361pfg.14.2020.05.13.11.09.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 May 2020 11:09:55 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [RISU 1/9] Use bool for tracing variables Date: Wed, 13 May 2020 11:09:45 -0700 Message-Id: <20200513180953.20376-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200513180953.20376-1-richard.henderson@linaro.org> References: <20200513180953.20376-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::432; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x432.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" 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: Peter Maydell 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;