From 696ec1549fcd846f9736a9c96e25f6ba555cd3e4 Mon Sep 17 00:00:00 2001 From: Stan Cox Date: Thu, 6 Aug 2009 16:20:39 -0400 Subject: [PATCH] Fix a couple of sdt_query reorg problems. * tapsets.cxx (sdt_query::handle_query_module): For uprobe probes: 1) find all same named probes to handle multiple probes per module 2) use new_base for uprobe probes to handle $$name * sdt_misc.exp: Test $$name --- tapsets.cxx | 5 +++-- testsuite/systemtap.base/sdt_misc.exp | 11 +++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/tapsets.cxx b/tapsets.cxx index c953dd78c..f91d15d3c 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -3390,7 +3390,8 @@ sdt_query::handle_query_module() while (get_next_probe()) { - if (!probes_handled.insert(probe_name).second) + if (probe_type != uprobe_type + && !probes_handled.insert(probe_name).second) continue; probe *new_base = new probe(*base_probe); @@ -3424,7 +3425,7 @@ sdt_query::handle_query_module() params[c->functor] = c->arg; } - dwarf_query q(base_probe, base_loc, dw, params, results); + dwarf_query q(new_base, new_location, dw, params, results); q.has_mark = true; // enables mid-statement probing dw.iterate_over_modules(&query_module, &q); } diff --git a/testsuite/systemtap.base/sdt_misc.exp b/testsuite/systemtap.base/sdt_misc.exp index 459b669ab..27f148d06 100644 --- a/testsuite/systemtap.base/sdt_misc.exp +++ b/testsuite/systemtap.base/sdt_misc.exp @@ -59,19 +59,19 @@ set fp [open $sup_stppath "w"] puts $fp " probe process(\"static_user_markers.x\").mark(\"test_probe_0\") { - printf(\"In test_probe_0 probe %#x\\n\", \$arg1) + printf(\"In %s probe %#x\\n\", \$\$name, \$arg1) } probe process(\"static_user_markers.x\").mark(\"test_probe_2\") { - printf(\"In test_probe_2 probe %#x\\n\", \$arg1) + printf(\"In %s probe %#x\\n\", \$\$name, \$arg1) } probe process(\"static_user_markers.x\").mark(\"test_probe_3\") { - printf(\"In test_probe_3 probe %#x %#x\\n\", \$arg1, \$arg2) + printf(\"In %s probe %#x %#x\\n\", \$\$name, \$arg1, \$arg2) } probe process(\"static_user_markers.x\").mark(\"test_probe_4\") { - printf(\"In test_probe_4 dtrace probe %#x %#x\\n\", \$arg1->a, \$arg1->b) + printf(\"In %s dtrace probe %#x %#x\\n\", \$\$name, \$arg1->a, \$arg1->b) } " close $fp @@ -98,6 +98,9 @@ if {[installtest_p]} { } else { set dtrace $srcdir/../dtrace } +if {[catch {exec $dtrace --types -h -s $sup_dpath} res]} { + verbose -log "unable to run $dtrace: $res" +} if {[catch {exec $dtrace --types -G -s $sup_dpath} res]} { verbose -log "unable to run $dtrace: $res" } -- 2.43.5