All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Jones <andrew.jones@linux.dev>
To: kvm@vger.kernel.org
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Thomas Huth <thuth@redhat.com>, Nadav Amit <nadav.amit@gmail.com>,
	Nikos Nikoleris <nikos.nikoleris@arm.com>
Subject: [kvm-unit-tests PATCH] runtime: Teach pretty-print-stacks about EFI debug info
Date: Wed, 28 Jun 2023 12:05:51 +0200	[thread overview]
Message-ID: <20230628100550.42786-2-andrew.jones@linux.dev> (raw)

When running a unit test built for EFI, pretty-print-stacks needs to
look at ${kernel}.efi.debug, where ${kernel} comes from the 'file'
field of unittests.cfg but has the .flat extension removed. Teach
the pretty-print-stacks script to do that by ensuring ${kernel}.efi
is passed to the script, giving it the ability to identify an EFI
kernel and know where it is, i.e. any prepended path to the filename
is maintained. To pass ${kernel}.efi we change run() to not needlessly
convert ${kernel}.flat to $(basename $kernel .flat), but rather
to ${kernel}.efi. The original change was needless because the EFI
$RUNTIME_arch_run scripts already do a $(basename $kernel .efi)
conversion.

Signed-off-by: Andrew Jones <andrew.jones@linux.dev>
---

This is based on "[kvm-unit-tests PATCH v3 0/6] arm64: improve
debuggability" which introduces .efi.debug files.

 scripts/pretty_print_stacks.py | 6 +++++-
 scripts/runtime.bash           | 2 +-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/scripts/pretty_print_stacks.py b/scripts/pretty_print_stacks.py
index 90026b724684..d990d30055d5 100755
--- a/scripts/pretty_print_stacks.py
+++ b/scripts/pretty_print_stacks.py
@@ -63,7 +63,11 @@ def main():
         sys.stderr.write('usage: %s <kernel>\n' % sys.argv[0])
         sys.exit(1)
 
-    binary = sys.argv[1].replace(".flat", ".elf")
+    binary = sys.argv[1]
+    if binary.endswith('.flat'):
+        binary = binary.replace('.flat', '.elf')
+    elif binary.endswith('.efi'):
+        binary += '.debug'
 
     with open("config.mak") as config_file:
         for line in config_file:
diff --git a/scripts/runtime.bash b/scripts/runtime.bash
index 785a7b627bfd..54f8ade6bc71 100644
--- a/scripts/runtime.bash
+++ b/scripts/runtime.bash
@@ -83,7 +83,7 @@ function run()
     local timeout="${9:-$TIMEOUT}" # unittests.cfg overrides the default
 
     if [ "${CONFIG_EFI}" == "y" ]; then
-        kernel=$(basename $kernel .flat)
+        kernel=${kernel/%.flat/.efi}
     fi
 
     if [ -z "$testname" ]; then
-- 
2.41.0


                 reply	other threads:[~2023-06-28 10:12 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230628100550.42786-2-andrew.jones@linux.dev \
    --to=andrew.jones@linux.dev \
    --cc=kvm@vger.kernel.org \
    --cc=nadav.amit@gmail.com \
    --cc=nikos.nikoleris@arm.com \
    --cc=pbonzini@redhat.com \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.