From patchwork Tue Dec 5 20:41:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 750389 Delivered-To: patch@linaro.org Received: by 2002:adf:9b9d:0:b0:333:3a04:f257 with SMTP id d29csp1896752wrc; Tue, 5 Dec 2023 12:42:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IETdpfcnfdBcHuyS/xGjJ+RdoQfUfdfov+D3VLxD1DSWSAK+wNtwLdkLOa+oClnFrXD5WJs X-Received: by 2002:a05:622a:315:b0:425:4043:50ce with SMTP id q21-20020a05622a031500b00425404350cemr2157455qtw.93.1701808933288; Tue, 05 Dec 2023 12:42:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701808933; cv=none; d=google.com; s=arc-20160816; b=uMF7P4p8GSPKwCOH3Xp6Oykp+yh94SOUg88FBKidrFt0LOLVVwd3+6e2UgbLv+A+Pj bhb+LHTYbWWnD13SkgSzRwbRrf1GfiBg4JWffgAzMGKAVJFHojfslsc3Gk+ApEtqaMhm dGWFDrprUnVLZUvoXAv/67aAygXtcuQl0AXx8IlePjsKLRxP5DVZo61R+3xdRdXCJdus JbXpueVVbO2/yEX9DL4MEydZLXuk8LB9/O7nh41sU2rn6nIHw1SGrfKDokkq0Km+ZrIk /owURXDlDfwGeZrMO+hHyWLkqiCqwxfFufIBWOxsWf/oBmrtxB3AxuMXv7AoaU8TARpK wing== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=Y+OK2n1Fz+j7PdxiFIWkIMZ0hIcv40Fig/K+AFS5+zk=; fh=WQskExECjOtS2oBrq9x2ue7OeVr6ye1r4N0aDOSz0G8=; b=SZIXffzLfsEZdYmKynOsaz7XdQO5PWXNSJL5lLxuCHx0UNouaJK+qGegV1QR4oakGh Ym5wSUEnzK5tIayn7nDfZPsxBZDj3VrmZPhThGwEh+5B0wylmEo9eYiAEk8mzf3Hy8Xu 6fwtydMSbyhLgiOx+6Bt7hHDo1Fsc0vkcOTE9zYtgLKj3Zxm3KEKzXN3HrQKprwkz+n9 qK+IqqylaywjP1zzXy9LkOzFKUw2HdJ/65MYm98rN4vCQINTXWaba6LjBF9L3XQryezE +rodrvvlaayb4RGc0o3DO2S5R9kc5ukViTYVfefSkY+/cmhfTBvld6a5h4XR8wcac2D2 zmQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="kE/hA+dX"; 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 fg22-20020a05622a581600b00425407be093si9686888qtb.407.2023.12.05.12.42.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Dec 2023 12:42:13 -0800 (PST) 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="kE/hA+dX"; 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] 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) 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-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) 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) From: =?utf-8?q?Alex_Benn=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_Lureau?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , John Snow , Pavel Dovgalyuk , =?utf-8?q?Alex_Benn=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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org For clarity given it only has two states. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Pavel Dovgalyuk --- 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 = replay_get_dword(); } replay_check_error(); - replay_state.has_unread_data = 1; + replay_state.has_unread_data = true; if (replay_state.data_kind >= EVENT_COUNT) { error_report("Replay: unknown event kind %d", replay_state.data_kind); @@ -191,7 +191,7 @@ void replay_fetch_data_kind(void) void replay_finish_event(void) { - replay_state.has_unread_data = 0; + replay_state.has_unread_data = false; replay_fetch_data_kind(); } 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) static const VMStateDescription vmstate_replay = { .name = "replay", - .version_id = 2, - .minimum_version_id = 2, + .version_id = 3, + .minimum_version_id = 3, .pre_save = replay_pre_save, .post_load = replay_post_load, .fields = (VMStateField[]) { @@ -56,7 +56,7 @@ static const VMStateDescription vmstate_replay = { 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 = -1; replay_state.instruction_count = 0; replay_state.current_icount = 0; - replay_state.has_unread_data = 0; + replay_state.has_unread_data = false; /* skip file header for RECORD and check it for PLAY */ if (replay_mode == REPLAY_MODE_RECORD) {