]> sourceware.org Git - systemtap.git/commitdiff
stap-prep: switch to using main vmlinuz file as debuginfod test download
authorFrank Ch. Eigler <fche@redhat.com>
Sun, 23 May 2021 18:12:32 +0000 (14:12 -0400)
committerFrank Ch. Eigler <fche@redhat.com>
Sun, 23 May 2021 18:12:32 +0000 (14:12 -0400)
Using the vdso* files only as the debuginfod tests gives us false
positives on platforms where the install vmlinuz files cannot be used
as a basis for debuginfod queries, because they're not elf nor
compressed-elf.  This new stap-prep tries to download the vmlinuz
debuginfo itself.  It's large, but at least once it's here, it's here!
And if it fails (as it will on those few platforms), the user is
advised to do full platform package-manager debuginfo download.

NEWS
stap-prep

diff --git a/NEWS b/NEWS
index 3e660bbcc8a4256ea04d84a55d0b9f1832252314..72c349ab32fa19312ccde199fd14c3ea3fb414f0 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,8 @@
 * What's new in version 4.6, PRERELEASE
 
+- stap-prep now tries to download the main kernel debuginfo file from
+  a debuginfod server, if configured.
+
 * What's new in version 4.5, 2021-05-07
 
 - Java probing support has been updated to work with the latest
index fd0c7e83b26546efe6b06732941ae250c5a2c930..6b1bf9e99446dafa5f7b858c73dd5e6a867e0e07 100755 (executable)
--- a/stap-prep
+++ b/stap-prep
@@ -17,11 +17,30 @@ echo "Configuring for kernel release $UNAME"
 # See if the configured debuginfod
 DEBUGINFOD=0
 prep_debuginfod() {
-    # choose a part of the kernel that elfutils 0.181 can decode
-    vdso=`ls -1 /lib/modules/$UNAME/vdso/*.so 2>/dev/null | head -1` # vdso32.so and/or vdso64.so or whatever
-    if debuginfod-find debuginfo "$vdso" > /dev/null 2>&1; then
-        DEBUGINFOD=1
-        echo "Will use debuginfod DEBUGINFOD_URLS=$DEBUGINFOD_URLS to fetch debuginfo."
+    # Choose a representative part - the vmlinuz file itself, which
+    # may be compressed-ELF or something else.  Previously, used a
+    # vdso* image only, but that false-positive tricks stap-prep on
+    # aarch64/s390x, due to rhbz 1891509 / elfutils PR25498
+    vmlinuz=/lib/modules/$UNAME/vmlinuz
+    
+    if [ -n "$DEBUGINFOD_URLS" ]; then
+        echo "Please wait, attempting to download $vmlinuz debuginfo"
+        if [ -z "$DEBUGINFOD_TIMEOUT" ]; then
+            DEBUGINFOD_TIMEOUT=300
+            export DEBUGINFOD_TIMEOUT
+            echo "Increasing DEBUGINFOD_TIMEOUT to $DEBUGINFOD_TIMEOUT temporarily"
+        fi
+        DEBUGINFOD_PROGRESS=1
+        export DEBUGINFOD_PROGRESS
+        if debuginfod-find debuginfo "$vmlinuz" > /dev/null; then
+            DEBUGINFOD=1
+            ls -ald `debuginfod-find debuginfo "$vmlinuz"`
+            echo "Download successful.  Assuming debuginfod server usage."
+        else
+            echo "Download failed."
+        fi
+    else
+        echo 'Debuginfo automatic downloading is not configured via $DEBUGINFOD_URLS'
     fi
 }
 
This page took 0.032102 seconds and 5 git commands to generate.