From nobody Sun Nov 24 13:23:27 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=1723580868; cv=none; d=zohomail.com; s=zohoarc; b=fQ47cK/G3b9YOwVYGrr6Gjsh6zmQ9p2Ih4ImSpcpjRh6CLktdsfwW0Re4twJPCHwcp9dLAhXCzKyU/3ifinwPLe5gup7FRNXxEaU5SKrPSnPF19WLZlAdBsCGAc4FdXrjLWXqDnQVlRuY3TohVmLkt8STGH7Pa0IV7EvSKVr+Vg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1723580868; 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=pP0Fo+KnSDTrFxCsw1YiRuncAlRjF4c9n6ZeDd0O4VU=; b=c5HzX1kJ2C0qS6WHSwF7GHGDXn42EirptksJ5rrMtzYQL+bqKPNgamZgwTkbuBVbyJ1udIArKG9HPPHKTtkyHd5ygauarYm+sJxqZYTP2GryPYYXEZqtw9bHGEKDbnkOyLhkRSQ6uHCQLiesfK2eVHkaEsmbwDdHAkIbMYzTgeg= 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 1723580868641571.3839486310237; Tue, 13 Aug 2024 13:27:48 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sdy47-0007Ct-I5; Tue, 13 Aug 2024 16:24:23 -0400 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 1sdy3q-0005qt-Px for qemu-devel@nongnu.org; Tue, 13 Aug 2024 16:24:07 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sdy3R-0006DT-Eo for qemu-devel@nongnu.org; Tue, 13 Aug 2024 16:24:03 -0400 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-3687f8fcab5so3109925f8f.3 for ; Tue, 13 Aug 2024 13:23:40 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36e4c937b6esm11248588f8f.32.2024.08.13.13.23.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Aug 2024 13:23:34 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 57C3D5FA49; Tue, 13 Aug 2024 21:23:30 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723580619; x=1724185419; 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=pP0Fo+KnSDTrFxCsw1YiRuncAlRjF4c9n6ZeDd0O4VU=; b=pXgLsNT/D4EXpwpfUrA0Uw2zS0di6wz3L2Id80E1ZKHlOD7eTDMO/PrSRGqe8TN7YR fF7qAwJ5MxB9Z7oI+7eh2sNXvdxSInyuUNC6QMfxGdRgDkXlhmSwZCJugeywxPV0vTfH J7/ll70aDm0C8559pnEbe9X8Bty8UYlJR0vx3mllf9Ep/iD8uj6z4jdj/4dS5lEX7WAU yLEgFrUzx8aDtbqHCm+RSQAaZPwoiGDS948e82pj0sb7SYFyZAJirsCph4tfsYAaN802 2jKlTgY/DG/dt0eHTM51VO1gTFF3QRc5UHxfwMEMu4HjcSkESvNw09I71flgqBHrmU2X yCRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723580619; x=1724185419; 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=pP0Fo+KnSDTrFxCsw1YiRuncAlRjF4c9n6ZeDd0O4VU=; b=RSUQjn9ke2VyDTEo1ZX9b7HPz/ugX+hbKJUgQCMMXnIDo9uBZFnalo7jHlEAeB7wHr bK4oVvXhKb19b277v+lsIDoY+6bxmlTGEwomlKa4Fl3hx+RmnfpXqDLctZWJ+MxVI2Yr PiyWwa3vNuTAP7Llr2XFQJs3fu3SjqULikJ28y6JptF+InStK+MtqMIrBSBRVFW/Kqz6 3EklqyQnckrzsHy/fYWZ1CZuqhMq3spZ6jcLPoEINrwYUT2CNxvWpNtXwXN63LX5qO7R KI2hsxJzq7+pWKbo+f8fILAzNH1TH0WJ6mEXaN0IXAFxmkeAOG5Ww+QLa0FKrOCLx7R2 ID1w== X-Gm-Message-State: AOJu0Yy2zrICYvseCob0pbvuwVMneV5R7Y9YZ1g3hDoOwo7MOA5+8nkf Q7svfYxUKp7HMX5TBc6WkwK3w855Tadzar4PLb/mGiWfCECTiCQN18+r4xaztsg= X-Google-Smtp-Source: AGHT+IEjeN+yfY+rxMvEizfQNxPZLwKOV4SUh6vlc05jRoq2+k4GPdPO0K9pvBdrUZFGIm+wBb0R5Q== X-Received: by 2002:adf:ce89:0:b0:367:9237:611d with SMTP id ffacd0b85a97d-371778221d4mr570039f8f.60.1723580618620; Tue, 13 Aug 2024 13:23:38 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alistair Francis , Michael Roth , Palmer Dabbelt , Mahmoud Mandour , Pavel Dovgalyuk , Yoshinori Sato , Weiwei Li , Eduardo Habkost , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Markus Armbruster , David Hildenbrand , Beraldo Leal , Liu Zhiwei , Eric Auger , Song Gao , =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-arm@nongnu.org, Peter Xu , Jiri Pirko , Eric Blake , Fabiano Rosas , qemu-s390x@nongnu.org, Peter Maydell , "Michael S. Tsirkin" , Daniel Henrique Barboza , John Snow , Alexandre Iooss , Konstantin Kostiuk , Pierrick Bouvier , Cleber Rosa , Ilya Leoshkevich , qemu-riscv@nongnu.org, Thomas Huth , Paolo Bonzini , Richard Henderson , Jason Wang , Bin Meng , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Nicholas Piggin Subject: [PATCH v2 10/21] scripts/replay-dump.py: rejig decoders in event number order Date: Tue, 13 Aug 2024 21:23:18 +0100 Message-Id: <20240813202329.1237572-11-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240813202329.1237572-1-alex.bennee@linaro.org> References: <20240813202329.1237572-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::42e; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42e.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: 1723580869437116600 From: Nicholas Piggin Sort decoder functions to be ascending in order of event number, same as the decoder tables. Reviewed-by: Alex Benn=C3=A9e Signed-off-by: Nicholas Piggin Message-Id: <20240813050638.446172-3-npiggin@gmail.com> Signed-off-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.39.2