From patchwork Tue Dec 5 20:40:58 2023 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: 750394 Delivered-To: patch@linaro.org Received: by 2002:adf:9b9d:0:b0:333:3a04:f257 with SMTP id d29csp1897083wrc; Tue, 5 Dec 2023 12:43:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IFAswqmC87h6hmX/2YDZSJqTRbXF7+ls1TlpoB05uAuiZ42KQvJJvRlNRbh8lYzysAQ7n0I X-Received: by 2002:ad4:4e52:0:b0:67a:9cd5:1178 with SMTP id eb18-20020ad44e52000000b0067a9cd51178mr1591569qvb.14.1701808985937; Tue, 05 Dec 2023 12:43:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701808985; cv=none; d=google.com; s=arc-20160816; b=GTBtp+OUL6/6nYgWd3ke8+ObE30zov85VBXk/7OBXz502aF4EHlmacwHnEghlA2WL4 FM2uJHVXP4MA39LZ+/pE7vnlAWsuYBFIa6P/N+C0NBaGi8qDqEfs60Zcc8N4YhMJbQnn C3IAVRvPo3ULjg+nQT1NnsXY6Qvr6/5Bc0LscxRASJqdOGa5fn2aAtyrsRAYaJyzWI65 PmRY7oK3b2m+y9qQwcmt1pMiw8fNhix6k+YZhRB3x7pfSP5Z4JMnYlaxbzeV0bfWIGuJ GQrETgCRFKDKclNg5rrAuk5f0CHNMRZvlbqck1BNrI+EiKwlbiz6GlaXZ6MBS+YZCIRE 9Dfw== 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=bOmchX4uNJ3czMjsDLMZ3je7KxzFjicIJgluCE6g86g=; fh=WQskExECjOtS2oBrq9x2ue7OeVr6ye1r4N0aDOSz0G8=; b=OQtR5RMChwvmLhpQgul6ZiKPle3PpvWJew8D7AZ4Q8WSacu+kVN3PcRNNqT4HAniTs /jfGNqkTCK2CoFL6jvUqtbSov/bGk8IbLwIKfX9TU8dWVHJ9KX0p3qci0rrGu1KBytO5 FaF3FCSZn+2vW4SJenEOpiKrk6/HK/hWjWd7btufSk1/04j87gEXMisjPdxrraQEt2ZR EQUzMXp7JPzB59dIQRK+OJ3Ynz0MZ4LkUNDu/c5+tQVnA894fDqdBr3EiJ1ORR6hKqDt 4DQPYcP8nEeIiEjcffB8bkVAjleYYihB0cUAU1QmEitbpU1yrn2cp89DtewIOH/UbyZZ KSRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=soLzwRrM; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id bs19-20020a05620a471300b0077dd2def9b5si13152817qkb.330.2023.12.05.12.43.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Dec 2023 12:43:05 -0800 (PST) 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=soLzwRrM; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rAcED-0007OT-I0; Tue, 05 Dec 2023 15:41:13 -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 1rAcEB-0007Np-Ou for qemu-devel@nongnu.org; Tue, 05 Dec 2023 15:41:11 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rAcE8-0002E6-FJ for qemu-devel@nongnu.org; Tue, 05 Dec 2023 15:41:11 -0500 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-40a4848c6e1so65989785e9.1 for ; Tue, 05 Dec 2023 12:41:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1701808867; x=1702413667; 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=bOmchX4uNJ3czMjsDLMZ3je7KxzFjicIJgluCE6g86g=; b=soLzwRrME1j0yKYKYsimtYQGAIBOzcwBVvflKgL6JW1VQ58/oy3aCxD38/mVSPG/sb sznfyRW8sYwT/xBhDH5Y5wRzT266iX8sdnRDJBURrnXYiglRKHPnOQnyLMHxz0SpLhy0 li2t+iEQ6Wx/9B0PrvBd6bcaUBLx3ghz+98DGBYxv3Tme5cnUYz3uugbG/dyKoREIOcB Azl6/N2n9Fp3+x7GI7XnPEpIr7wL/Q1WtZqdJ2P1cOgw5aziUis6SakF0aW8d4LkPu8X 2R/2e3iuRdwXWLag9dH1+pzdSqA4sKSYbVWhBjUSnl5WT46ODlPXvRZKg/WSlkOSEcsa rAsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701808867; x=1702413667; 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=bOmchX4uNJ3czMjsDLMZ3je7KxzFjicIJgluCE6g86g=; b=ITmrzzEFMwqQMt2mSFkGtqbEsbSCohM52lANtM+phqvPZfSD4+QPoZJc8pT+Fuy1LT wjAtdLsm6VL+qaWe9bP9HAtDE+xfqdUsor22x3vwZOmIm2kvfA3vFP05sCee/+yA/G3B vvVgt4A1C5mH+8kfNyViCexMpO8u7QRvGYqjxlvXjiK+o/cpyGp7HNIobLiLRJ6vOu4k ZibqLqpJjyp/NcWQRiivZz0KVHPAhFaX2VGimtD4MqliH5KnU//hQyzHoawBzCY4f9zX 7rnkBygbobCGcU+Ia48JWcMxHc5ujel1La6iR//UANw2J7Fs8rMxWD3pUg0ucKrSsrpL jQxg== X-Gm-Message-State: AOJu0YwmEE4PUU5QDyhu1Rs3MZdFg02mHsTYgUCDHNz2WEZNPNh5euhf 71fn4okONfnxnRRtFfhZyu//7A== X-Received: by 2002:a7b:cb98:0:b0:40b:5e21:bdd6 with SMTP id m24-20020a7bcb98000000b0040b5e21bdd6mr863698wmi.101.1701808867046; Tue, 05 Dec 2023 12:41:07 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id d13-20020a05600c34cd00b0040b540ff0a5sm19913400wmq.19.2023.12.05.12.41.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 12:41:06 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 49C4B5FBBD; Tue, 5 Dec 2023 20:41:06 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Cleber Rosa , Beraldo Leal , Eduardo Habkost , Richard Henderson , Wainer dos Santos Moschetta , Paolo Bonzini , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , John Snow , Pavel Dovgalyuk , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH 03/11] scripts/replay-dump: update to latest format Date: Tue, 5 Dec 2023 20:40:58 +0000 Message-Id: <20231205204106.95531-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231205204106.95531-1-alex.bennee@linaro.org> References: <20231205204106.95531-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32c.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 To help debugging replay logs I've implemented decode_plain and decode_char_write as well as put in a new table for the current format of log. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- scripts/replay-dump.py | 70 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 64 insertions(+), 6 deletions(-) diff --git a/scripts/replay-dump.py b/scripts/replay-dump.py index b89dc29555..8b9f914534 100755 --- a/scripts/replay-dump.py +++ b/scripts/replay-dump.py @@ -115,6 +115,11 @@ def decode_unimp(eid, name, _unused_dumpfile): print("%s not handled - will now stop" % (name)) return False +def decode_plain(eid, name, _unused_dumpfile): + "Plain events without additional data" + print_event(eid, name, "no data") + return True + # Checkpoint decoder def swallow_async_qword(eid, name, dumpfile): "Swallow a qword of data without looking at it" @@ -151,6 +156,12 @@ def decode_instruction(eid, name, dumpfile): print_event(eid, name, "0x%x" % (ins_diff)) return True +def decode_char_write(eid, name, dumpfile): + res = read_dword(dumpfile) + offset = read_dword(dumpfile) + print_event(eid, name, "%d -> %d" % (offset, res)) + return True + def decode_audio_out(eid, name, dumpfile): audio_data = read_dword(dumpfile) print_event(eid, name, "%d" % (audio_data)) @@ -193,10 +204,10 @@ def decode_clock(eid, name, dumpfile): # pre-MTTCG merge v5_event_table = [Decoder(0, "EVENT_INSTRUCTION", decode_instruction), Decoder(1, "EVENT_INTERRUPT", decode_interrupt), - Decoder(2, "EVENT_EXCEPTION", decode_unimp), + Decoder(2, "EVENT_EXCEPTION", decode_plain), Decoder(3, "EVENT_ASYNC", decode_async), Decoder(4, "EVENT_SHUTDOWN", decode_unimp), - Decoder(5, "EVENT_CHAR_WRITE", decode_unimp), + Decoder(5, "EVENT_CHAR_WRITE", decode_char_write), Decoder(6, "EVENT_CHAR_READ_ALL", decode_unimp), Decoder(7, "EVENT_CHAR_READ_ALL_ERROR", decode_unimp), Decoder(8, "EVENT_CLOCK_HOST", decode_clock), @@ -215,10 +226,10 @@ def decode_clock(eid, name, dumpfile): # post-MTTCG merge, AUDIO support added v6_event_table = [Decoder(0, "EVENT_INSTRUCTION", decode_instruction), Decoder(1, "EVENT_INTERRUPT", decode_interrupt), - Decoder(2, "EVENT_EXCEPTION", decode_unimp), + Decoder(2, "EVENT_EXCEPTION", decode_plain), Decoder(3, "EVENT_ASYNC", decode_async), Decoder(4, "EVENT_SHUTDOWN", decode_unimp), - Decoder(5, "EVENT_CHAR_WRITE", decode_unimp), + Decoder(5, "EVENT_CHAR_WRITE", decode_char_write), Decoder(6, "EVENT_CHAR_READ_ALL", decode_unimp), Decoder(7, "EVENT_CHAR_READ_ALL_ERROR", decode_unimp), Decoder(8, "EVENT_AUDIO_OUT", decode_audio_out), @@ -250,7 +261,7 @@ def decode_clock(eid, name, dumpfile): Decoder(10, "EVENT_SHUTDOWN_GUEST_RESET", decode_unimp), Decoder(11, "EVENT_SHUTDOWN_GUEST_PANIC", decode_unimp), Decoder(12, "EVENT_SHUTDOWN___MAX", decode_unimp), - Decoder(13, "EVENT_CHAR_WRITE", decode_unimp), + Decoder(13, "EVENT_CHAR_WRITE", decode_char_write), Decoder(14, "EVENT_CHAR_READ_ALL", decode_unimp), Decoder(15, "EVENT_CHAR_READ_ALL_ERROR", decode_unimp), Decoder(16, "EVENT_AUDIO_OUT", decode_audio_out), @@ -268,6 +279,49 @@ def decode_clock(eid, name, dumpfile): Decoder(28, "EVENT_CP_RESET", decode_checkpoint), ] +# Shutdown cause added +v12_event_table = [Decoder(0, "EVENT_INSTRUCTION", decode_instruction), + Decoder(1, "EVENT_INTERRUPT", decode_interrupt), + Decoder(2, "EVENT_EXCEPTION", decode_plain), + Decoder(3, "EVENT_ASYNC", decode_async), + Decoder(4, "EVENT_ASYNC", decode_async), + Decoder(5, "EVENT_ASYNC", decode_async), + Decoder(6, "EVENT_ASYNC", decode_async), + Decoder(6, "EVENT_ASYNC", decode_async), + Decoder(8, "EVENT_ASYNC", decode_async), + Decoder(9, "EVENT_ASYNC", decode_async), + Decoder(10, "EVENT_ASYNC", decode_async), + Decoder(11, "EVENT_SHUTDOWN", decode_unimp), + Decoder(12, "EVENT_SHUTDOWN_HOST_ERR", decode_unimp), + Decoder(13, "EVENT_SHUTDOWN_HOST_QMP_QUIT", decode_unimp), + Decoder(14, "EVENT_SHUTDOWN_HOST_QMP_RESET", decode_unimp), + Decoder(14, "EVENT_SHUTDOWN_HOST_SIGNAL", decode_unimp), + Decoder(15, "EVENT_SHUTDOWN_HOST_UI", decode_unimp), + Decoder(16, "EVENT_SHUTDOWN_GUEST_SHUTDOWN", decode_unimp), + Decoder(17, "EVENT_SHUTDOWN_GUEST_RESET", decode_unimp), + Decoder(18, "EVENT_SHUTDOWN_GUEST_PANIC", decode_unimp), + Decoder(19, "EVENT_SHUTDOWN_GUEST_SUBSYSTEM_RESET", decode_unimp), + Decoder(20, "EVENT_SHUTDOWN_GUEST_SNAPSHOT_LOAD", decode_unimp), + Decoder(21, "EVENT_SHUTDOWN___MAX", decode_unimp), + Decoder(22, "EVENT_CHAR_WRITE", decode_char_write), + Decoder(23, "EVENT_CHAR_READ_ALL", decode_unimp), + Decoder(24, "EVENT_CHAR_READ_ALL_ERROR", decode_unimp), + Decoder(25, "EVENT_AUDIO_IN", decode_unimp), + Decoder(26, "EVENT_AUDIO_OUT", decode_audio_out), + Decoder(27, "EVENT_RANDOM", decode_unimp), + Decoder(28, "EVENT_CLOCK_HOST", decode_clock), + Decoder(29, "EVENT_CLOCK_VIRTUAL_RT", decode_clock), + Decoder(30, "EVENT_CP_CLOCK_WARP_START", decode_checkpoint), + Decoder(31, "EVENT_CP_CLOCK_WARP_ACCOUNT", decode_checkpoint), + Decoder(32, "EVENT_CP_RESET_REQUESTED", decode_checkpoint), + Decoder(33, "EVENT_CP_SUSPEND_REQUESTED", decode_checkpoint), + Decoder(34, "EVENT_CP_CLOCK_VIRTUAL", decode_checkpoint), + Decoder(35, "EVENT_CP_CLOCK_HOST", decode_checkpoint), + Decoder(36, "EVENT_CP_CLOCK_VIRTUAL_RT", decode_checkpoint), + Decoder(37, "EVENT_CP_INIT", decode_checkpoint_init), + Decoder(38, "EVENT_CP_RESET", decode_checkpoint), +] + def parse_arguments(): "Grab arguments for script" parser = argparse.ArgumentParser() @@ -283,9 +337,13 @@ def decode_file(filename): version = read_dword(dumpfile) junk = read_qword(dumpfile) + # see REPLAY_VERSION print("HEADER: version 0x%x" % (version)) - if version == 0xe02007: + if version == 0xe0200c: + event_decode_table = v12_event_table + replay_state.checkpoint_start = 30 + elif version == 0xe02007: event_decode_table = v7_event_table replay_state.checkpoint_start = 12 elif version == 0xe02006: