From nobody Tue Feb 10 16:18:53 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+90071+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+90071+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1653619433; cv=none; d=zohomail.com; s=zohoarc; b=QjBEeNgcUgE+Hp2fh4y3Zj7PnEJB9Kec6rtiRR9xwiZCL5Z9ad56ykZ34LswsS/3AV1ay8EAUMtf2JSRPRyWoDv/AGwRjDLhm/8Q0f9cgk3AKLhL1k8tochCyIKnRnd8hJozjxrsyQpLy4yYpPVcEk8m3e8eeAOTLLUzA4JRCmA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1653619433; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=r60QiDKcLeeE4IyhG27g+MzHZvqQ79nRx1Jd/ZaAbg8=; b=Xp42QOANW9tQtKnCA7oXqpJhHpAgP6EH/qrhBV04MSIseUOD/RzV3j72rQHMqaLyDTB34qxhinbU3K8IvFNu49pvE5mZRQ54uVKTgGp09qwD4/ID/tCMyVIa4hUxgfPiyZTgJh4MGdKpBGO92HRCPpJi8dUFfjGmLFERa0hJBEU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+90071+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 165361943384288.37263580996682; Thu, 26 May 2022 19:43:53 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 4KTsYY1788612xKzd2tNcHF0; Thu, 26 May 2022 19:43:53 -0700 X-Received: from smtp-fw-2101.amazon.com (smtp-fw-2101.amazon.com [72.21.196.25]) by mx.groups.io with SMTP id smtpd.web10.3205.1653619431365736140 for ; Thu, 26 May 2022 19:43:52 -0700 X-IronPort-AV: E=Sophos;i="5.91,254,1647302400"; d="scan'208";a="202322444" X-Received: from iad12-co-svc-p1-lb1-vlan2.amazon.com (HELO email-inbound-relay-iad-1a-a31e1d63.us-east-1.amazon.com) ([10.43.8.2]) by smtp-border-fw-2101.iad2.amazon.com with ESMTP; 27 May 2022 02:43:52 +0000 X-Received: from EX13MTAUWC001.ant.amazon.com (iad12-ws-svc-p26-lb9-vlan3.iad.amazon.com [10.40.163.38]) by email-inbound-relay-iad-1a-a31e1d63.us-east-1.amazon.com (Postfix) with ESMTPS id 738D79169D; Fri, 27 May 2022 02:43:50 +0000 (UTC) X-Received: from EX13D20UWC001.ant.amazon.com (10.43.162.244) by EX13MTAUWC001.ant.amazon.com (10.43.162.135) with Microsoft SMTP Server (TLS) id 15.0.1497.36; Fri, 27 May 2022 02:43:49 +0000 X-Received: from u79c5a0a55de558.ant.amazon.com (10.43.161.125) by EX13D20UWC001.ant.amazon.com (10.43.162.244) with Microsoft SMTP Server (TLS) id 15.0.1497.36; Fri, 27 May 2022 02:43:47 +0000 From: "Alexander Graf via groups.io" To: CC: Ard Biesheuvel , Leif Lindholm , Dandan Bi , Zhichao Gao , Liming Gao Subject: [edk2-devel] [PATCH 09/12] Scripts: Add bootlog decyphering script Date: Fri, 27 May 2022 04:43:14 +0200 Message-ID: <20220527024317.13476-10-graf@amazon.com> In-Reply-To: <20220527024317.13476-1-graf@amazon.com> References: <20220527024317.13476-1-graf@amazon.com> MIME-Version: 1.0 X-Originating-IP: [10.43.161.125] X-ClientProxiedBy: EX13D06UWC001.ant.amazon.com (10.43.162.91) To EX13D20UWC001.ant.amazon.com (10.43.162.244) Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,graf@amazon.com X-Gm-Message-State: PLxbHa7EjzUZOF9tUt92IyJnx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1653619433; bh=3tvp6YbEKxMZh3AU+B0ud/C3BCPfSWw+kolAduAIxDw=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=jN1ZRvWpEQgQEJsTYexZoZaVbI3uO32heV0jncHQcfTGFqGzb7Jkrq9u2BV3rk5k3xt CSHdJfoV4xqltS4srCqNZXDhHZxlKTfOEoH/C7kcs1dEr0YDSBc/d4442lge0T4RceiMm l/8aUdW3f1XCafQK5IVtLNtcImsAgfO/0X0= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1653619434671100025 Content-Type: text/plain; charset="utf-8" The bootlog itself is a binary data structure that is not immediately human readable. This commit adds a python script to generate a human readable form of it with Linux dmesg like time stamp information. The script can take multiple log sources and collate them into a single output, making it easier to correlate messages. Signed-off-by: Alexander Graf --- BaseTools/Scripts/ShowDebugLog.py | 88 +++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100755 BaseTools/Scripts/ShowDebugLog.py diff --git a/BaseTools/Scripts/ShowDebugLog.py b/BaseTools/Scripts/ShowDebu= gLog.py new file mode 100755 index 0000000000..f99b4b02f7 --- /dev/null +++ b/BaseTools/Scripts/ShowDebugLog.py @@ -0,0 +1,88 @@ +#!/usr/bin/python3 +## @file +# Dump Bootlog files +# +# Copyright (c) 2022, Amazon Development Center Germany GmbH. All rights = reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# + +from __future__ import print_function + +VersionNumber =3D '0.1' +__copyright__ =3D "Copyright (c) 2022, Amazon Development Center Germany G= mbH. All rights reserved.." + +import argparse +import os +import sys +import struct + +class DebugLog: + """Parses a Bootlog blob and provides a string representation + """ + + def __init__(self, log): + self.entries =3D [] + off =3D 0 + + signature, self.producer, extraheadertype, extraheadersize, msgext= raheadersize, lastbyte, self.tickspersecond =3D struct.unpack_from('<4s4sHB= BLQ', log) + if signature !=3D b'BTLH': + raise Exception("File has incorrect signature. Expected b'BTLH= '. Found %s." % signature) + if len(log) < lastbyte: + raise Exception("File smaller than total log contents (%d < %d= ). It was probably truncated." % (len(log), lastbyte)) + off =3D 4 + 4 + 2 + 1 + 1 + 4 + 8 + extraheadersize + + while off < lastbyte: + off =3D off + msgextraheadersize + time, =3D struct.unpack_from('