From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A5295C48BF6 for ; Mon, 26 Feb 2024 08:31:33 +0000 (UTC) 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) 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) 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) 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: 8bit 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sort decoder functions to be ascending in order of event number, same as the decoder tables. Signed-off-by: Nicholas Piggin --- 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) +total_insns = 0 + +def decode_instruction(eid, name, dumpfile): + global total_insns + ins_diff = read_dword(dumpfile) + total_insns += 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, size)) return True -total_insns = 0 - -def decode_instruction(eid, name, dumpfile): - global total_insns - ins_diff = read_dword(dumpfile) - total_insns += 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 +def decode_random(eid, name, dumpfile): + ret = read_dword(dumpfile) + size = 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 = read_qword(dumpfile) + print_event(eid, name, "0x%x" % (clock_data)) + return True + def __decode_checkpoint(eid, name, dumpfile, old): """Decode a checkpoint. @@ -252,25 +271,6 @@ def decode_checkpoint_init(eid, name, dumpfile): print_event(eid, name) return True -def decode_interrupt(eid, name, dumpfile): - print_event(eid, name) - return True - -def decode_clock(eid, name, dumpfile): - clock_data = read_qword(dumpfile) - print_event(eid, name, "0x%x" % (clock_data)) - return True - -def decode_random(eid, name, dumpfile): - ret = read_dword(dumpfile) - size = 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 -- 2.42.0