From b350f56b13f4e5acd5744cd71e4b26343aae8e6b Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 22 May 2009 18:01:18 -0700 Subject: PR10190: Suppress warnings for optional kprobes When a kernel.function or kprobe.function fails in registration, we usually print a WARNING and move on. With this patch, kprobes that have the optional '?' flag will not print any WARNING. --- testsuite/systemtap.base/badkprobe.exp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'testsuite') diff --git a/testsuite/systemtap.base/badkprobe.exp b/testsuite/systemtap.base/badkprobe.exp index c0815fbe..96ad5a3b 100644 --- a/testsuite/systemtap.base/badkprobe.exp +++ b/testsuite/systemtap.base/badkprobe.exp @@ -19,7 +19,20 @@ foreach bk $bad_kprobes { spawn stap -g -w -e "$script" "$bk" expect { -timeout 60 - -re "^WARNING: probe .*registration error.*\r\ncleanup ok" { pass $test } + -re "^WARNING: probe .*registration error.*\r\ncleanup ok\r\n" { pass $test } + eof { fail "$test (eof)" } + timeout { fail "$test (timeout)" } + } + catch {close} + catch {wait} +} + +foreach bk $bad_kprobes { + set test "bad optional kprobe registration: $bk" + spawn stap -g -w -e "$script" "$bk ?" + expect { + -timeout 60 + -re "^cleanup ok\r\n" { pass $test } eof { fail "$test (eof)" } timeout { fail "$test (timeout)" } } -- cgit From c9116e9980ad6e417697737f8d54a4a625811245 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 22 May 2009 19:55:50 -0700 Subject: Fix another kernel/kprobe.function conflict Both kernel.function and kprobe.function were defining a global array stap_unreg_kprobes to use in bulk kprobes unregistration. The compiler allowed the duplicate definition as long as they were the same size, as it was when exercised in buildok/thirtyone. kprobe.function now uses a separate stap_unreg_kprobes2, and the testcase is modified to produce an imbalanced number of probes. --- testsuite/buildok/thirtyone.stp | 1 + 1 file changed, 1 insertion(+) (limited to 'testsuite') diff --git a/testsuite/buildok/thirtyone.stp b/testsuite/buildok/thirtyone.stp index 8a97d84f..5f2f2da6 100755 --- a/testsuite/buildok/thirtyone.stp +++ b/testsuite/buildok/thirtyone.stp @@ -1,4 +1,5 @@ #! stap -p4 +probe kprobe.function("sys_stat") {} probe kprobe.function("sys_open") {} probe kernel.function("sys_close") {} -- cgit