From nobody Wed Nov 27 04:46:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1701808933; cv=none; d=zohomail.com; s=zohoarc; b=VVs3ZpCULjUVmrDhu+WEpa7wL6yvcvmxjuh0tgsyWmumujkzU2vtd8xS2A419jBxyBii6BvXPvPczoPOx+y8DVy9uqBweuaj8jA2FHUoCL9XfyedMxyvb/h5BGx6rTDIBcBdMYQZLZpK33+dS77H/Y5577T5wq1F/lpYRJO476E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1701808933; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Y+OK2n1Fz+j7PdxiFIWkIMZ0hIcv40Fig/K+AFS5+zk=; b=kKEzFGrgRBYqIq8wyZ5igBYNvglghJ3G1129XzLnq5ZVaUDjQfIjBnu760HKZpLtLNaiRfZWPYzWkAT/dg+AY2FLwLy5IAgHuztO2hWqzDNQigDZ+QH6kwW/XMCdMdUoJCcFUoHiAHqfdwp6nVTedIBSHIImYsTdyysl3RHAwaA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1701808933684831.2349221775299; Tue, 5 Dec 2023 12:42:13 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rAcEF-0007PX-1j; Tue, 05 Dec 2023 15:41:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rAcED-0007OL-CR for qemu-devel@nongnu.org; Tue, 05 Dec 2023 15:41:13 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rAcEB-0002Ep-Ky for qemu-devel@nongnu.org; Tue, 05 Dec 2023 15:41:13 -0500 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-40bda47c489so42985715e9.3 for ; Tue, 05 Dec 2023 12:41:11 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id az33-20020a05600c602100b0040c03c3289bsm13514716wmb.37.2023.12.05.12.41.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 12:41:09 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 9758C5FBC6; Tue, 5 Dec 2023 20:41:06 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1701808870; x=1702413670; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Y+OK2n1Fz+j7PdxiFIWkIMZ0hIcv40Fig/K+AFS5+zk=; b=kE/hA+dXIb7p05MtCkoAnZF3DyyT/4/p4qGWNDfDGouMaIBQ1S6vmIk3eJozbxbqDq xs5GLckf0/03g+1jM5L8Fw/3Mvhxc3SPXgwzmefoEus19LaNz84B5PAQR7fl9W9ZQ003 30InIVhtQOKbDkyGncrz5sYwOy1giI7JCZwPnJy8Mvp1mEj2l63x2UT4NFewUoOYJueB I8oz0ayeWY9IdBJGuwDuLRbOj6RUwGWzNu5riOaxaO1MBSbcVf987C6jDex1LI2G5hY8 qsDrawLIBdeV9dTRFAkYUNrHh9hvE+nn0nYFbqRDGSQVLN0FFleX3ntBCrU+4KRTjDhQ lMCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701808870; x=1702413670; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Y+OK2n1Fz+j7PdxiFIWkIMZ0hIcv40Fig/K+AFS5+zk=; b=slGKLzKRDJ5XS/k1SKPKbwPI5l9/8MyeaCfIimTtvzO1yeQeIOZ5uO+yyFluTGMSMz Xskywz9py0khyRrwLVtF85zulvuNysbRqWK34S7EXkHJt7JWuYx+sTcVumvXlAvaXEOO ae4+QXdiS6I2Tpd6rBPZpQzzqmI4hRoWdbQX1k67YZPuwqKvKvJYPChkpONcw/fGqows rmHlU0zPAm/9qpbMEYIIrZKbE7V2N1V1oLr+ibCgqH+RMf3pYoyGcFwp1JzfuDQVMAvn 0kgANs1w9VSHvVxqMtMaYxZbBZPTaBNlc1/ggCeA157uY3yGEg0D+3alhkrL/5TmJ1L7 XMLw== X-Gm-Message-State: AOJu0Ywi4HMpOs0sM1T0XFVWU7h5FRIfgkozza31yIOGxG27cwbW+k/L tfNtNR1c5gZYK9SGR1TUGphgSw== X-Google-Smtp-Source: AGHT+IE+SYLWCK7eyRcJYpw1Bq3uOrgKxy2QIdPZIrUlG68Ez4zu9nvBvHK4JAr8xBU7VK5uVbBhag== X-Received: by 2002:a05:600c:2491:b0:40b:5e59:c565 with SMTP id 17-20020a05600c249100b0040b5e59c565mr928955wms.143.1701808870068; Tue, 05 Dec 2023 12:41:10 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Cleber Rosa , Beraldo Leal , Eduardo Habkost , Richard Henderson , Wainer dos Santos Moschetta , Paolo Bonzini , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , John Snow , Pavel Dovgalyuk , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PATCH 07/11] replay: make has_unread_data a bool Date: Tue, 5 Dec 2023 20:41:02 +0000 Message-Id: <20231205204106.95531-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231205204106.95531-1-alex.bennee@linaro.org> References: <20231205204106.95531-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32d.google.com 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_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1701808935685100002 For clarity given it only has two states. Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Pavel Dovgalyuk Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- replay/replay-internal.h | 4 ++-- replay/replay-internal.c | 4 ++-- replay/replay-snapshot.c | 6 +++--- replay/replay.c | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/replay/replay-internal.h b/replay/replay-internal.h index 98ca3748ed..1bc8fd5086 100644 --- a/replay/replay-internal.h +++ b/replay/replay-internal.h @@ -75,7 +75,7 @@ enum ReplayEvents { * @current_icount: number of processed instructions * @instruction_count: number of instructions until next event * @data_kind: current event - * @has_unread_data: 1 if event not yet processed + * @has_unread_data: true if event not yet processed * @file_offset: offset into replay log at replay snapshot * @block_request_id: current serialised block request id * @read_event_id: current async read event id @@ -85,7 +85,7 @@ typedef struct ReplayState { uint64_t current_icount; int instruction_count; unsigned int data_kind; - unsigned int has_unread_data; + bool has_unread_data; uint64_t file_offset; uint64_t block_request_id; uint64_t read_event_id; diff --git a/replay/replay-internal.c b/replay/replay-internal.c index 77d0c82327..634025096e 100644 --- a/replay/replay-internal.c +++ b/replay/replay-internal.c @@ -179,7 +179,7 @@ void replay_fetch_data_kind(void) replay_state.instruction_count =3D replay_get_dword(); } replay_check_error(); - replay_state.has_unread_data =3D 1; + replay_state.has_unread_data =3D true; if (replay_state.data_kind >=3D EVENT_COUNT) { error_report("Replay: unknown event kind %d", replay_state.data_kind); @@ -191,7 +191,7 @@ void replay_fetch_data_kind(void) =20 void replay_finish_event(void) { - replay_state.has_unread_data =3D 0; + replay_state.has_unread_data =3D false; replay_fetch_data_kind(); } =20 diff --git a/replay/replay-snapshot.c b/replay/replay-snapshot.c index 10a7cf7992..bf75c2ed28 100644 --- a/replay/replay-snapshot.c +++ b/replay/replay-snapshot.c @@ -47,8 +47,8 @@ static int replay_post_load(void *opaque, int version_id) =20 static const VMStateDescription vmstate_replay =3D { .name =3D "replay", - .version_id =3D 2, - .minimum_version_id =3D 2, + .version_id =3D 3, + .minimum_version_id =3D 3, .pre_save =3D replay_pre_save, .post_load =3D replay_post_load, .fields =3D (VMStateField[]) { @@ -56,7 +56,7 @@ static const VMStateDescription vmstate_replay =3D { VMSTATE_UINT64(current_icount, ReplayState), VMSTATE_INT32(instruction_count, ReplayState), VMSTATE_UINT32(data_kind, ReplayState), - VMSTATE_UINT32(has_unread_data, ReplayState), + VMSTATE_BOOL(has_unread_data, ReplayState), VMSTATE_UINT64(file_offset, ReplayState), VMSTATE_UINT64(block_request_id, ReplayState), VMSTATE_UINT64(read_event_id, ReplayState), diff --git a/replay/replay.c b/replay/replay.c index 0f7d766efe..d729214197 100644 --- a/replay/replay.c +++ b/replay/replay.c @@ -258,7 +258,7 @@ static void replay_enable(const char *fname, int mode) replay_state.data_kind =3D -1; replay_state.instruction_count =3D 0; replay_state.current_icount =3D 0; - replay_state.has_unread_data =3D 0; + replay_state.has_unread_data =3D false; =20 /* skip file header for RECORD and check it for PLAY */ if (replay_mode =3D=3D REPLAY_MODE_RECORD) { --=20 2.39.2