summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStan Cox <scox@redhat.com>2009-08-06 16:20:39 -0400
committerStan Cox <scox@redhat.com>2009-08-06 16:20:39 -0400
commit696ec1549fcd846f9736a9c96e25f6ba555cd3e4 (patch)
tree1163b7f5387979538bb9c06ecd75616de6ea168a
parentc54731e1d0e627a0fb1bb46a63e675c65932cb6c (diff)
downloadsystemtap-steved-696ec1549fcd846f9736a9c96e25f6ba555cd3e4.tar.gz
systemtap-steved-696ec1549fcd846f9736a9c96e25f6ba555cd3e4.tar.xz
systemtap-steved-696ec1549fcd846f9736a9c96e25f6ba555cd3e4.zip
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
-rw-r--r--tapsets.cxx5
-rw-r--r--testsuite/systemtap.base/sdt_misc.exp11
2 files changed, 10 insertions, 6 deletions
diff --git a/tapsets.cxx b/tapsets.cxx
index c953dd78..f91d15d3 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 459b669a..27f148d0 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"
}