From d4d172789b1ba4d9ca4f1c5fdf835eadd6c92a1d Mon Sep 17 00:00:00 2001 From: Housam Alamour Date: Sun, 22 Oct 2023 20:09:59 -0400 Subject: [PATCH] Added test case and documentation to NEWS --- NEWS | 10 +++++++++ testsuite/systemtap.base/debuginfod_probe.exp | 22 +++++++++++++++++++ 2 files changed, 32 insertions(+) mode change 100644 => 100755 testsuite/systemtap.base/debuginfod_probe.exp diff --git a/NEWS b/NEWS index 71e29b5cd..bc2880eb7 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,16 @@ - Tapset function print_ubacktrace_fileline() now understands DWARF5 (PR30407) +- Debuginfod probes may now be filtered by archive name. + This allows for probing only certain versions of a program + though a glob on the basename of the archive/package name. + For example if one of the files on the deubinfod server is + curl-minimal-8.0.1-5.fc38, the probe can be filtered to only + include the fedora 38 distro of the program (as in example below). + + # export DEBUGINFOD_URLS="URL1 URL2 ..." + # stap -e 'probe debuginfod.archive("*.fc38").process("/usr/*/curl").begin { log("Hello World") }' + - The kernel-user message transport system added framing codes, making the transport more reliable, but becoming incompatible across pre-5.0 versions. Use matching versions of stap and staprun. diff --git a/testsuite/systemtap.base/debuginfod_probe.exp b/testsuite/systemtap.base/debuginfod_probe.exp old mode 100644 new mode 100755 index 48258871e..669b0669a --- a/testsuite/systemtap.base/debuginfod_probe.exp +++ b/testsuite/systemtap.base/debuginfod_probe.exp @@ -98,6 +98,28 @@ if {"$debuginfod" == "" || $found_metadata_symbol != 0 || $found_jsonc != 0} the catch {close}; catch {wait} if {$pass == 1} then { pass $subtest } else { fail $subtest } + # Test 1d: package + set subtest "$test package" + set systemtap_script { + probe + debuginfod + .archive("*probe*") + .process("/usr/local/bin/hello") + .function("main") + { printf("HelloWorld\n") } + } + spawn sh -c "$stap_path -ve \'$systemtap_script\' -p2 2>&1" + wait_n_secs 5 + set pass 0 + expect { + -timeout 5 + -re {.*process\(\"f0aa15b8aba4f3c28cac3c2a73801fefa644a9f2\"\).function\(\"main\"\)*} { incr pass } + eof { } + timeout { fail "$subtest (timeout)" } + } + catch {close}; catch {wait} + if {$pass == 1} then { pass $subtest } else { fail $subtest } + # Cleanup catch { exec rm -rf "/tmp/staptest" } kill -INT $debuginfod_pid -- 2.43.5