From nobody Sun Nov 24 12:52:42 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=1723733483; cv=none; d=zohomail.com; s=zohoarc; b=K+AUCux6GdloA9CkSJjqEkYLTornupNlMaNsZZVzVgdE99qy1Dl9knKSBNIIgjPpznbMHEv/pV7WUM7aWgttJ+pCt6ZBK+zz9INpl5+i+RlHWqP1d3/QV08BWkTOOYWWuqh13C4u8pCrAG8G2JpBzAy3FDZLJwxbv1EOmlk9kcM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1723733483; 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=6AOhP2ldyW9UA6bgoSKwypPabALbgykDRW8dOBoMAIA=; b=nQPvtIE8Xig1XE9zaP49qUkEMgpnm4OYYtCYMyZ6LcKacjp0wI2tBdFP2AT6wdaw2QZfy7a28CWGYUdiT5Vovs0uo6NB9gOaJ4FMzZucGuksQsBPdc4fW7YVmlZL01aUVNxIavuwyb+XfCv5AoKPLf5C72Gkv/ZwI+neNRzB/Eg= 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 1723733483522257.0627435121636; Thu, 15 Aug 2024 07:51:23 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sebnK-0004Ns-CZ; Thu, 15 Aug 2024 10:49:42 -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 1sebn2-0003PJ-EU for qemu-devel@nongnu.org; Thu, 15 Aug 2024 10:49:25 -0400 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sebn0-0000DO-7m for qemu-devel@nongnu.org; Thu, 15 Aug 2024 10:49:24 -0400 Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-a7d26c2297eso125796066b.2 for ; Thu, 15 Aug 2024 07:49:21 -0700 (PDT) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a83838cfb47sm113120066b.74.2024.08.15.07.49.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Aug 2024 07:49:14 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 9E07F5FC0F; Thu, 15 Aug 2024 15:49:12 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723733361; x=1724338161; 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=6AOhP2ldyW9UA6bgoSKwypPabALbgykDRW8dOBoMAIA=; b=lLj4QVBvlQoFeurEdEgjWfYD5kb9gn2VDyHmg2dMYG62EXDUNRAEXoaRsaIEnLnGbE mjLn5y5ERcarD/AprsvNQtye1Je9XlPxSAozqYt3iCRcMrLgquWQbk3xqCF1GGp+fefK X2un2xKnGNj2XH/Hr2Ssp4FTp9JUD83rjS+qeGiZoAE7jpbFieaGS/o31CeUddiWXRCf ukb98IkrFkwWqvtt1vj3fra2w73Zguw0Dpink2rJ1TFkQmxMADa3kCyWt5a+6D4380K2 5hngoaLn3DNb1ob3Mhtr3v2x0RedQx5XklpNgZPmhU8bEKsDugYteEKLPmJCSaOU15dp 9FaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723733361; x=1724338161; 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=6AOhP2ldyW9UA6bgoSKwypPabALbgykDRW8dOBoMAIA=; b=Q/XyubXhtb7zya+t0CTymL2n5SI4Q6fhPdgx/JidklTS9cyStSs2d0lYodEpEr+5gx bnO0QU+OL6RGr8tCafSVitIPgGXbBHosrIMiH0Us9ss/VNMfGmt+QMKEmGdfWEYzUl2k 1ovT6oVV3bP/5iR9ZwlEG0vOV9zsBYALkaU2AJNDXcp7KGigMBgftMn+G7Q8edink+IO JclFwDXbs81ECVBDCjPbFQlBpF3PYLj6pHC3m+ONn6qy4QOx260znkLR/RxgFLeUxjUg KBgTeB3aAos0mHV0p5D86aLAHpct5pzNV4i0prIKQYfPuGZbmqmVAvVsC3QaDfnlNr7s u24g== X-Gm-Message-State: AOJu0YyT9FREyIzf1ymc8FG2Qd9fRFtDhAndUzpMGCwH3YEBLx7OYcpJ wrmmodsXVdLK6fzfrUXrm/HZ2u3nE+NXOMjm3VWvC/rCUodjQGpk55I1eFgxkFw= X-Google-Smtp-Source: AGHT+IGTR7+5pIbUmpdxbLtANIQPNulj2j4SMqLKCNgnhSxUZyB6aSJXv9qzgNLMrIcPORNUVg3hkQ== X-Received: by 2002:a17:907:e2e2:b0:a77:d773:54ec with SMTP id a640c23a62f3a-a8366c0beefmr428795666b.8.1723733360172; Thu, 15 Aug 2024 07:49:20 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Nicholas Piggin , =?UTF-8?q?Alex=20Benn=C3=A9e?= , John Snow , Cleber Rosa Subject: [PULL 10/21] scripts/replay-dump.py: rejig decoders in event number order Date: Thu, 15 Aug 2024 15:49:00 +0100 Message-Id: <20240815144911.1931487-11-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240815144911.1931487-1-alex.bennee@linaro.org> References: <20240815144911.1931487-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::62c; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x62c.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: 1723733484008116600 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 Message-Id: <20240813202329.1237572-11-alex.bennee@linaro.org> 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