From patchwork Tue Aug 13 20:23:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 818860 Delivered-To: patch@linaro.org Received: by 2002:adf:cd01:0:b0:367:895a:4699 with SMTP id w1csp431060wrm; Tue, 13 Aug 2024 13:27:48 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUXfdIoezizhjhZKS3n57WBfl2n5xll542gpEC4e5zU7093OqaPyxIyGJUYCrOyof/I996fwLvh9ppOhXWWiu9D X-Google-Smtp-Source: AGHT+IEWX3D6sHLO475+azH51ALSM/q6Ejf9ya4abtX0baQEIcPth8+RMlx0pyNI4mOY5Xu9g+0T X-Received: by 2002:a05:622a:a0b:b0:453:4bb3:7714 with SMTP id d75a77b69052e-4535ba64015mr6509241cf.1.1723580868290; Tue, 13 Aug 2024 13:27:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723580868; cv=none; d=google.com; s=arc-20160816; b=lizzdE94AGNalm4zyXeLg0W510bW+FfIvIkRvTxK57xQd9huTS5iGJ3g+CzpAlun3o 4MM8ql8pRYHtCnj+CDKjdJppo7sQAkOiIZSRQMshOfldUPNvppT0drS4G4FPO9PUmuVO q7ZLUKMqN0wlQJeSyXY5+Ec2P/w5zWahDgmmc2WoQGP4KnsyJy+2x5dDEzL3nRndBhaY R7rE4POMuaZcueLhw+z02gv8Lhjn7MBeZuvPs3wU2jMrMZ+FdHxiiIOMf9p4yv/LkaCf OFU6XpzdjrjS20frtBFg7ErqCnWH+me18c5HojdyET9ijLHlNE2euEpcNSJd0dVLVC0R IfjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=pP0Fo+KnSDTrFxCsw1YiRuncAlRjF4c9n6ZeDd0O4VU=; fh=2Uj2tGQCTXopsDH26iMBTwdsgctwEBjqGya0Hcf7oYs=; b=B3hluQLugXkBGaH0cNH+zwdjrHpMAdAxaXyrLCFBUtrJcf7ncrmHDL+uWscFt5KWPk /ivVTfypKFU6LhzLKNmo821uhNLcXBYY8nb03t4HwyOLM9iWgLjY5OEfESB88xTejIKF 4jJ4vkL8IICOwc86Gn1uFQ6CxR9XLDMmOrGDt7f9hiKhyRZgn6sA2il3DeHZxpfNeKx+ im+bLgZ2/7aIZxF0XGP6DQH6Fq/9LYv6o0GAp4JIP83Fzt/xSdTqVGY9Uye0fZMcBAik XLQXa8LddH2TYj2H8i/nX6p0J5bfEyqDFOldWaP6h3v/hjDAQm23EfGb46uqmiiydloo 1mZQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="pXgLsNT/"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-4531c1ad03fsi91410041cf.86.2024.08.13.13.27.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Aug 2024 13:27:48 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="pXgLsNT/"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org 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) 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-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) 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) From: =?utf-8?q?Alex_Benn=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_Lureau?= , Markus Armbruster , David Hildenbrand , Beraldo Leal , Liu Zhiwei , Eric Auger , Song Gao , =?utf-8?q?Alex_Benn=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_Mathieu-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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Nicholas Piggin Sort decoder functions to be ascending in order of event number, same as the decoder tables. Reviewed-by: Alex Bennée Signed-off-by: Nicholas Piggin Message-Id: <20240813050638.446172-3-npiggin@gmail.com> Signed-off-by: Alex Bennée --- 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