From nobody Tue Nov 26 22:19:55 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=1704726959; cv=none; d=zohomail.com; s=zohoarc; b=GK2zB/J3wZmeXalI/6cTEZz+dvmZ1+9TwZhk5Quz5xvy0PIOxfz6tqFk9C6ZQCknYywqCElf+467+aHnFLpdmWnZQoGhI8ivM4yr+k1KHST3c+hrFaCAcnco8S1+8ciwugMFb8xk4hJg0WGkRJRU/aF9cBSyRokoFlZy3myGaS0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1704726959; 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=SPOk6AJuTFsbsY/JbpngsdrxHBBFNIYVyd4S9YTkZ9o=; b=KDeVoOffFTCYLkEsCyA3TU1j/Q+BoN0PpebYRmhkKFNbuQpwqOjKaUjzWVpKxWusUS1i2VMZ2wCN/AYgDTROqC7FmUzYkHY+b8EYZpTmvq4wluH2oCrDCLF9FUXfW7F1L9xfPUzIw3ZXPUJ5d8pdHnmt81EpLY4+cf7BoU3x0o4= 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 1704726959651100.33263226403562; Mon, 8 Jan 2024 07:15:59 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rMrKI-0004FK-Oj; Mon, 08 Jan 2024 10:14:06 -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 1rMrKG-0004EK-W9 for qemu-devel@nongnu.org; Mon, 08 Jan 2024 10:14:05 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rMrKE-0001ai-HF for qemu-devel@nongnu.org; Mon, 08 Jan 2024 10:14:04 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-40d89446895so11540495e9.0 for ; Mon, 08 Jan 2024 07:14:02 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id j8-20020a05600c190800b0040d6d755c90sm119705wmq.42.2024.01.08.07.13.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 07:13:56 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 8D7FD5F94A; Mon, 8 Jan 2024 15:13:53 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704726840; x=1705331640; 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=SPOk6AJuTFsbsY/JbpngsdrxHBBFNIYVyd4S9YTkZ9o=; b=elbBRmRyT5xCIwaPYLGpbkkLhHL1pETurwbivmsWFxxAYyaCKJhGsmcVYT+Sprr0ip zJUnGMEg6K+WRtgaIxmF5Nx3prqfSjr4I6nHOhEF+gC0UXAgKLZY7ebhxWKuczS2f+Bk R2726ECtzNvRvooOr2iO2fa9JNqQrbqExWF12O0fNuWCF9CZNqigUl8GaHQU6WQQUh4z JkLh1gL4OVPYbr3npcRPVO77AG3k2wkvz+EZZ+0KEokO0rXwqtUQSmMn8Ahv9tGKv5UN ba2L+HyFSAvG0iEzCs3UQ7pbYfIXEEaOPeV2DDrh44OFQowe3VMoohLWLP2q8glxH24H SxHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704726840; x=1705331640; 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=SPOk6AJuTFsbsY/JbpngsdrxHBBFNIYVyd4S9YTkZ9o=; b=XvGpXpGjsCJ+OL9sdf04acm+JmAgfly9Ak+snMtQnsBZQQYHT7oyaw7JJ1kjOS9zkr NPhVlTyhQUpaEYQ54p0nBN6SEKoD7uXOSIJEDyy3y+XyyJutNuvvrLrpq5/Q5At0qdxl qbj0Xs/toPNBJL2bgDJCHhLZfV/gzV7VZ+sxOkhFAc6jtGqYVR3MHHL2hRyDnvneWnXU N3u2EtEXgx+4lPkfKa3tg8s41JiNQl76zQBpQsWsn98ga/It6nN2LLAh7eBKQcUqe4lu c0hImG7W5VPvs3FghRSzCusqtA//Bhz+jqN7Nq3b+Btvy4mE4xeddFevMuWkDJBBJBjW zZrA== X-Gm-Message-State: AOJu0Yz8n2sJaCfofbIY3Hvzz+SNXNYw+6syt0O0f0Ao8q9x1WGBIsMp cBRATUUxILY06dXDqCIzeucpv0fx299Tmg== X-Google-Smtp-Source: AGHT+IHR5k5TwixRpZ/ulpi5S8syMOx2df2djUykv9MpFgVvNnF4yiznCZBfpvVTfdof46esf6D1rw== X-Received: by 2002:a05:600c:35d1:b0:40d:887e:fc85 with SMTP id r17-20020a05600c35d100b0040d887efc85mr1906231wmq.32.1704726839847; Mon, 08 Jan 2024 07:13:59 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pavel Dovgalyuk , Richard Henderson , Pavel Dovgalyuk , Paolo Bonzini Subject: [PULL 08/13] replay: make has_unread_data a bool Date: Mon, 8 Jan 2024 15:13:47 +0000 Message-Id: <20240108151352.2199097-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240108151352.2199097-1-alex.bennee@linaro.org> References: <20240108151352.2199097-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::331; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x331.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: 1704726959996100001 For clarity given it only has two states. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pavel Dovgalyuk Reviewed-by: Richard Henderson Signed-off-by: Alex Benn=C3=A9e Message-Id: <20231211091346.14616-9-alex.bennee@linaro.org> diff --git a/replay/replay-internal.h b/replay/replay-internal.h index 98ca3748edb..1bc8fd50868 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 77d0c82327e..634025096ef 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 e5e39161e33..d4f6cb7cda8 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 (const 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), --=20 2.39.2