All of lore.kernel.org
 help / color / mirror / Atom feed
* [kvm-unit-tests PATCH] runtime: Teach pretty-print-stacks about EFI debug info
@ 2023-06-28 10:05 Andrew Jones
  0 siblings, 0 replies; only message in thread
From: Andrew Jones @ 2023-06-28 10:05 UTC (permalink / raw)
  To: kvm; +Cc: Paolo Bonzini, Thomas Huth, Nadav Amit, Nikos Nikoleris

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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2023-06-28 10:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-28 10:05 [kvm-unit-tests PATCH] runtime: Teach pretty-print-stacks about EFI debug info Andrew Jones

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.