From nobody Tue Nov 26 11:44:38 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1708936293; cv=none; d=zohomail.com; s=zohoarc; b=SzSrkUjsjpugbSfS6mkHcL7ZP6YHZoZ+PyZG1Xu/NqeH2sAcgGLh7e/hy8OjNzJ08W2673GB2qBbnZFWZ9jKebua0Jahsa8Vn9+F5Lh4XN4czMKCB/xC/XUD5BibG6F1cmLcXJbGWMq/enOts7Ky5p85GmkC/04Zwo+BMpOZnpE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1708936293; h=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=lW7pjRlc1yD9ansqi/cSuRLP+dzdf12+uV6GzvgYzGA=; b=I3BtVjiJEinymg+DiE0YB71Ag5cRwXWeg889hMLqZ8wbI2G0Iciw5Jee6FbkrCfSRxAzPOJt0IxwwOF1cuZ0nNPmU0WyJzlPJ68DDBosoYvQIdUp61xJCx09epBG5pUx5gx16U7BlUbkqpm0xk1uquOsIgBv1TMUobFAn1pNdbc= 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 170893629366937.551981781319796; Mon, 26 Feb 2024 00:31:33 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1reWNP-0002FU-2a; Mon, 26 Feb 2024 03:30:19 -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 1reWNN-0002DW-TK for qemu-devel@nongnu.org; Mon, 26 Feb 2024 03:30:17 -0500 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1reWNL-0005cn-LM for qemu-devel@nongnu.org; Mon, 26 Feb 2024 03:30:17 -0500 Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-1dc96f64c10so5914275ad.1 for ; Mon, 26 Feb 2024 00:30:12 -0800 (PST) Received: from wheely.local0.net ([1.146.74.212]) by smtp.gmail.com with ESMTPSA id w16-20020a1709026f1000b001d9641003cfsm3511260plk.142.2024.02.26.00.30.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 00:30:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708936211; x=1709541011; 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=lW7pjRlc1yD9ansqi/cSuRLP+dzdf12+uV6GzvgYzGA=; b=bNjBL6bjtRGI6KoVTP59AZjFb79MZaqBOs6UxyrbtIeXu0dCM34BvJw8rga5mg0ySV GpvP3Fv7hi0czsQAqpfGmOApGjv174co97mUIrnMjeYu1MdMI5m9V4Jf+GWJ8g3FEJFK gBpEb/5EuPPw20iB4njNVBQ+Hc5BSpyc1GZ6rEDaUO7YIoS9BCKn2Y6zgAzfL0dJ3Tym GPsE8nKKsWjgNOgQMtEyzOutrJEszdMdrHGFbR4ZkHWhFKWpZF+ZyWOr9KKx/Zp8Mevd KxWHyH9V8pmKvydFQc/kRtTndY/NgD6+9GWhIGftBD/3KW0ZdjAUe07eofOfiufcjrC2 p17g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708936211; x=1709541011; 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=lW7pjRlc1yD9ansqi/cSuRLP+dzdf12+uV6GzvgYzGA=; b=p4uNcgPaJDMfZ9jl4ECdIOqZTl7bhhsLeuD+NRdFF+fC1hJY1cAQlXfTYb6ZGZAqXo zs69VUHIYByJwCrVQJSdkzQY6C1sXV104oIC7jdNrQPcaURb1hXnICJ3gc9hQTl6CP20 Ycfet92hzdrP3ITAHKWXzxptXUmVfVEm7j9Xo7lodFZNEFZmacSXSKXegkg9siasRxNm 8+9G+tiVSFzjl+sjUpN2AbiKdD0ZQvUniZZI7I5tmIDmOYt3yLqvsP+b5Jc7KvPlo2aF ZCvpEWiFvVcgl4ThCFxfn+8tI6tR8+yY8bc00fav+dEfvXtqAcllKzrEKucqyLbpe0l6 LXLg== X-Gm-Message-State: AOJu0YwyKZIcyu+9v5R06c5GCC7B0Gg2FfyLu/X4UI3Izn3PqV8VTMHY p2OwE/85fmyXIvdxTZyx+y/QYZkkUI5AmiK+n32ggMX2xzTtSxxD0TEucE7/ X-Google-Smtp-Source: AGHT+IEmcCLnAeqkTIGdNkIiiST8Wn0WIHETHhgeFt2uMN5I7GdZ8/PLUoq8lJxmAZ3TInkFaV5nuA== X-Received: by 2002:a17:902:6503:b0:1dc:499b:8e80 with SMTP id b3-20020a170902650300b001dc499b8e80mr4633094plk.54.1708936211326; Mon, 26 Feb 2024 00:30:11 -0800 (PST) From: Nicholas Piggin To: qemu-devel@nongnu.org Cc: Nicholas Piggin , Pavel Dovgalyuk , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Paolo Bonzini , John Snow , Cleber Rosa , Wainer dos Santos Moschetta , Beraldo Leal Subject: [PATCH v3 2/9] scripts/replay-dump.py: rejig decoders in event number order Date: Mon, 26 Feb 2024 18:29:38 +1000 Message-ID: <20240226082945.1452499-3-npiggin@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240226082945.1452499-1-npiggin@gmail.com> References: <20240226082945.1452499-1-npiggin@gmail.com> MIME-Version: 1.0 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=2607:f8b0:4864:20::629; envelope-from=npiggin@gmail.com; helo=mail-pl1-x629.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, FREEMAIL_FROM=0.001, 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 @gmail.com) X-ZM-MESSAGEID: 1708936294777100001 Content-Type: text/plain; charset="utf-8" Sort decoder functions to be ascending in order of event number, same as the decoder tables. Signed-off-by: Nicholas Piggin Reviewed-by: Alex Benn=C3=A9e --- scripts/replay-dump.py | 56 +++++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/scripts/replay-dump.py b/scripts/replay-dump.py index 419ee3257b..b82659cfb6 100755 --- a/scripts/replay-dump.py +++ b/scripts/replay-dump.py @@ -139,6 +139,19 @@ def swallow_bytes(eid, name, dumpfile, nr): """Swallow nr bytes of data without looking at it""" dumpfile.seek(nr, os.SEEK_CUR) =20 +total_insns =3D 0 + +def decode_instruction(eid, name, dumpfile): + global total_insns + ins_diff =3D read_dword(dumpfile) + total_insns +=3D ins_diff + print_event(eid, name, "+ %d -> %d" % (ins_diff, total_insns)) + return True + +def decode_interrupt(eid, name, dumpfile): + print_event(eid, name) + return True + def decode_exception(eid, name, dumpfile): print_event(eid, name) return True @@ -198,15 +211,6 @@ def decode_async_net(eid, name, dumpfile): print_event(eid, name, "net:%x flags:%x bytes:%d" % (net_id, flags, si= ze)) return True =20 -total_insns =3D 0 - -def decode_instruction(eid, name, dumpfile): - global total_insns - ins_diff =3D read_dword(dumpfile) - total_insns +=3D ins_diff - print_event(eid, name, "+ %d -> %d" % (ins_diff, total_insns)) - return True - def decode_shutdown(eid, name, dumpfile): print_event(eid, name) return True @@ -222,6 +226,21 @@ def decode_audio_out(eid, name, dumpfile): print_event(eid, name, "%d" % (audio_data)) return True =20 +def decode_random(eid, name, dumpfile): + ret =3D read_dword(dumpfile) + size =3D read_dword(dumpfile) + swallow_bytes(eid, name, dumpfile, size) + if (ret): + print_event(eid, name, "%d bytes (getrandom failed)" % (size)) + else: + print_event(eid, name, "%d bytes" % (size)) + return True + +def decode_clock(eid, name, dumpfile): + clock_data =3D read_qword(dumpfile) + print_event(eid, name, "0x%x" % (clock_data)) + return True + def __decode_checkpoint(eid, name, dumpfile, old): """Decode a checkpoint. =20 @@ -252,25 +271,6 @@ def decode_checkpoint_init(eid, name, dumpfile): print_event(eid, name) return True =20 -def decode_interrupt(eid, name, dumpfile): - print_event(eid, name) - return True - -def decode_clock(eid, name, dumpfile): - clock_data =3D read_qword(dumpfile) - print_event(eid, name, "0x%x" % (clock_data)) - return True - -def decode_random(eid, name, dumpfile): - ret =3D read_dword(dumpfile) - size =3D read_dword(dumpfile) - swallow_bytes(eid, name, dumpfile, size) - if (ret): - print_event(eid, name, "%d bytes (getrandom failed)" % (size)) - else: - print_event(eid, name, "%d bytes" % (size)) - return True - def decode_end(eid, name, dumpfile): print_event(eid, name) return False --=20 2.42.0