From 223f5b6b6e2c945c442a5dde7e63e637237f575b Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 10 Sep 2008 18:30:45 -0700 Subject: Ensure that "stap -l ..." only prints probe names, not variables. --- testsuite/ChangeLog | 4 ++++ testsuite/systemtap.base/probe_list.exp | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 testsuite/systemtap.base/probe_list.exp (limited to 'testsuite') diff --git a/testsuite/ChangeLog b/testsuite/ChangeLog index 3effc92f..288705b1 100644 --- a/testsuite/ChangeLog +++ b/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2008-09-10 Josh Stone + + * systemtap.base/probe_list.exp: New test for correct probe listing. + 2008-09-09 Frank Ch. Eigler * systemtap.base/uprobes.*: Tweak regexps for read-only src tree diff --git a/testsuite/systemtap.base/probe_list.exp b/testsuite/systemtap.base/probe_list.exp new file mode 100644 index 00000000..b3e6884b --- /dev/null +++ b/testsuite/systemtap.base/probe_list.exp @@ -0,0 +1,19 @@ +# This test ensures that "-l" lists only include probe names, and not any of +# the local variables. There was a bug that "-l" would print variables that +# couldn't be optimized away, due to an incorrect assumption in the +# implementation. + +# NB: This is a bit abusively formed. Currently -l internally writes "probe" +# and "{}" around its argument. For this test we want to introduce a variable +# that can't be optimized away. The trailing comment mark lets the auto "{}" +# get ignored. +spawn stap -l "begin { if (a) next }#" + +expect { + # the output should not include anything else, like the 'a' local. + -re "^begin\r\n$" { + pass "probe list is correct" + return + } +} +fail "probe list is incorrect" -- cgit