From nobody Tue Nov 26 16:37:35 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=1706198994; cv=none; d=zohomail.com; s=zohoarc; b=A5pPGEzFVPrY+Dm6B7+f1znokfPom7xAJGk+nvY/ZaYGgq3z0gdWKp6CM/yiSOefJA0gZABOzgyUJPmeZgsGibVHdk3WVD3fWymgDwsUKca/LCVZFh9g0x0XX/gPTbFAP/Rgdr/GP6+evLkHHY8Gqb1Ieb1tkcsLx3TZAMWwtcs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706198994; 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=xCathHofE5nAYfNrhxY2aVLV9v0ArUIt8XjBeYaXknw=; b=gEZUng4h94yv0ATUgMVrqg8JFDpnPs5Uyk5YeM2Wayaneygs8NbG4EyDtZcB4zIKDh2znEzisRZ9dgQ8dGRy/JbIecGPHsrOLQBsuTTE1PSBgy3mH+S4thm5w4HUQJzpvQfCVtprLxZslJLjizTdiJpqR4fBvRg3qMHEKjITdYU= 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 1706198994800278.9378675276246; Thu, 25 Jan 2024 08:09:54 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rT2Hp-0006vI-OJ; Thu, 25 Jan 2024 11:09:05 -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 1rT2Hn-0006tm-Bh for qemu-devel@nongnu.org; Thu, 25 Jan 2024 11:09:03 -0500 Received: from mail-pj1-x102d.google.com ([2607:f8b0:4864:20::102d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rT2Hl-0000Ms-MP for qemu-devel@nongnu.org; Thu, 25 Jan 2024 11:09:03 -0500 Received: by mail-pj1-x102d.google.com with SMTP id 98e67ed59e1d1-2906bcae4feso2656265a91.3 for ; Thu, 25 Jan 2024 08:09:01 -0800 (PST) Received: from wheely.local0.net (110-175-3-177.tpgi.com.au. [110.175.3.177]) by smtp.gmail.com with ESMTPSA id oe7-20020a17090b394700b00293851b198csm14190pjb.56.2024.01.25.08.08.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 08:08:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706198940; x=1706803740; 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=xCathHofE5nAYfNrhxY2aVLV9v0ArUIt8XjBeYaXknw=; b=nV7oklE8XLyDNG1h8pPPZDV0HJpyPNSHtGsSXybhNYYPSwIfO+vL4jmmRVeghYAKb4 8H7sZ/6yzAgKE2kRg2WemgEU+zjCzQjf6S9lFtFF21czmUo7lrmHelgjJBeJMy9jx0B0 +8AoJLriop7uVaxuOLHZV5H1CHi1Tgylqf2GMrpyVZLdnA3YzX2xaRhht8Tuga/WIhtg XSfd1VMe/7XS5/a4+kV+qbonrYH7ur6QoiIgRRpPh68rX5yjhpvumaOFTpsrRCU/8gNJ 0/mqN03ZCfK+icKAuL7x9DKxTKG3ma+1ydNeNnV4+ZnPNR2it2L05fHzwviiGju0z3Je AmBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706198940; x=1706803740; 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=xCathHofE5nAYfNrhxY2aVLV9v0ArUIt8XjBeYaXknw=; b=wAmIkiDLrM34rmDuN9mXMyKc9zre01tOkil/ex25NmB/S1Q6nhNmCh42+N4WyEXzZT NrDYBMTzU60EK/Zjmdc3eBjMNlRlw3NxeLadfk/p1KTkljgvHF8OZAdqq3UJJOgz1HvZ aq2QypSuchegNM7sznUZ/WbSNEQpG2KNDU5aHlAwQaG3aPRPDbAN7rTtGLnBK7LEe4ub lMwsrfBMG4iHl3Zegge3rLKsZd7mUP8VWb4rd1x3pxu0Va5+6O7B188Sv3lBhRpskpay LU3MFmdb6wY6jZH6FF3YZnPIEfmbloLZd+309O4KoljRuJBmGkE2JG4zpyt3fkvMx38l yLzA== X-Gm-Message-State: AOJu0YyHS3YEbm2SMaDfegwi32sUZOhZK6XArGKEHzix7y6Grl+1Zopl tzUWYqY0vf9LtrKDJI9bIHboY1UtAgR9K9nCrEvMxMx1trNGqm9a01DCkkHl X-Google-Smtp-Source: AGHT+IFunAMcsDDVtG2FVN/xFXc73njkvk6lKoRcGL9Tem3cdEhL1zxhpgXOASFqGX0JtpN1Jb2BqQ== X-Received: by 2002:a17:90a:4411:b0:28e:73c0:85c with SMTP id s17-20020a17090a441100b0028e73c0085cmr783157pjg.76.1706198939712; Thu, 25 Jan 2024 08:08:59 -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 v2 3/4] scripts/replay-dump.py: rejig decoders in event number order Date: Fri, 26 Jan 2024 02:08:34 +1000 Message-ID: <20240125160835.480488-4-npiggin@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240125160835.480488-1-npiggin@gmail.com> References: <20240125160835.480488-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::102d; envelope-from=npiggin@gmail.com; helo=mail-pj1-x102d.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: 1706198995954100001 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 --- 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 35732da08f..a1d7ae0364 100755 --- a/scripts/replay-dump.py +++ b/scripts/replay-dump.py @@ -144,6 +144,19 @@ def swallow_bytes(eid, name, dumpfile, nr): dumpfile.seek(nr, os.SEEK_CUR) 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_interrupt(eid, name, dumpfile): + print_event(eid, name) + return True + def decode_exception(eid, name, dumpfile): print_event(eid, name) return True @@ -203,15 +216,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 @@ -227,6 +231,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 @@ -257,25 +276,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