From 16e8f21f336bcfc16a1174be8a8143668dbd0118 Mon Sep 17 00:00:00 2001 From: jistone Date: Fri, 8 Dec 2006 02:17:09 +0000 Subject: 2006-12-07 Josh Stone PR 3624. * tapsets.cxx (struct be_derived_probe): Add a new priority parameter for begin/end probes, and a comparison function for sorting. (be_builder::build): Parse the priority & pass it to be_derived_probe. (be_derived_probe_group::emit_module_init, emit_module_exit): Sort the probe list by priority before emitting any code. (register_standard_tapsets): Add new begin/end variants. * parse.cxx (parser::parse_literal): Allow negative numeric literals, by checking for a '-' unary operator right before a number. testsuite/ * systemtap.base/be_order.exp, systemtap.base/be_order.stp, semok/beginend.stp: New tests for begin/end priorities. * lib/stap_run.exp: Anchor OUTPUT_CHECK_STRING to the end of output. * systemtap.base/maxactive.exp: Fix to compare output to the end. * systemtap.base/probefunc.exp: Ditto. * systemtap.samples/ioblocktest.exp: Ditto. * systemtap.samples/ioblocktest.stp: Ditto. * systemtap.samples/tcptest.exp: Ditto. --- testsuite/systemtap.base/be_order.stp | 37 +++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 testsuite/systemtap.base/be_order.stp (limited to 'testsuite/systemtap.base/be_order.stp') diff --git a/testsuite/systemtap.base/be_order.stp b/testsuite/systemtap.base/be_order.stp new file mode 100644 index 00000000..eb8ef0c8 --- /dev/null +++ b/testsuite/systemtap.base/be_order.stp @@ -0,0 +1,37 @@ +/* + * add.stp + * + * Check that ordering of begin/end probes works + */ + +probe begin { log("systemtap starting probe") } +probe end { log("systemtap ending probe") } + +global beginstr, endstr + +probe begin { beginstr .= "c" } +probe begin(1) { beginstr .= "d" } +probe begin(-1) { beginstr .= "b" } +probe begin(0) { beginstr .= "c" } +probe begin(9223372036854775807) { beginstr .= "e" } +probe begin(-9223372036854775808) { beginstr .= "a" } + +probe end { endstr .= "x" } +probe end(1) { endstr .= "y" } +probe end(-1) { endstr .= "w" } +probe end(0) { endstr .= "x" } +probe end(9223372036854775807) { + endstr .= "z" + + if (beginstr == "abccde") + log("systemtap test success") + else + printf("systemtap test failure - beginstr:%s != abccde\n", beginstr) + + if (endstr == "vwxxyz") + log("systemtap test success") + else + printf("systemtap test failure - endstr:%s != vwxxyz\n", endstr) +} +probe end(-9223372036854775808) { endstr .= "v" } + -- cgit