From 3e3bd7b6b9dd2ba282990f39d60e3ad5ecfec023 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Mon, 6 Apr 2009 16:11:30 -0700 Subject: PR10026: Read marker/tracepoint args directly We already stash the context variables for markers and tracepoints into the locals for the probe body, but then we were using separate functions to read those locals for each particular probe body. This patch instead teaches the unparser how to emit the local name directly for those context variables. The resulting code from the translator is much simpler now. --- elaborate.cxx | 3 +++ 1 file changed, 3 insertions(+) (limited to 'elaborate.cxx') diff --git a/elaborate.cxx b/elaborate.cxx index 34e6ab16..323261c7 100644 --- a/elaborate.cxx +++ b/elaborate.cxx @@ -3392,6 +3392,9 @@ typeresolution_info::visit_symbol (symbol* e) void typeresolution_info::visit_target_symbol (target_symbol* e) { + if (!e->probe_context_var.empty()) + return; + // This occurs only if a target symbol was not resolved over in // tapset.cxx land, that error was properly suppressed, and the // later unused-expression-elimination pass didn't get rid of it -- cgit From 7175b49227fb1f71f3bdd6060ef9f6499e42f035 Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Tue, 14 Apr 2009 13:13:43 -0400 Subject: PR10070: don't warn about side-effect-free probes in -t (timing) mode * elaborate.cxx (semantic_pass_opt4): Filter warning on s.timing. --- elaborate.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'elaborate.cxx') diff --git a/elaborate.cxx b/elaborate.cxx index 323261c7..b760173f 100644 --- a/elaborate.cxx +++ b/elaborate.cxx @@ -2433,7 +2433,8 @@ void semantic_pass_opt4 (systemtap_session& s, bool& relaxed_p) p->body = duv.require(p->body, true); if (p->body == 0) { - if (! s.suppress_warnings) + if (! s.suppress_warnings + && ! s.timing) // PR10070 s.print_warning ("side-effect-free probe '" + p->name + "'", p->tok); p->body = new null_statement(); -- cgit From e6fe60e7ac2b7068b97c828cee2502d34e77d89c Mon Sep 17 00:00:00 2001 From: Ananth N Mavinakayanahalli Date: Tue, 21 Apr 2009 17:07:22 +0530 Subject: From Prerna Saxena: Add the kprobe.function probe family --- elaborate.cxx | 1 + 1 file changed, 1 insertion(+) (limited to 'elaborate.cxx') diff --git a/elaborate.cxx b/elaborate.cxx index b760173f..47b77c9b 100644 --- a/elaborate.cxx +++ b/elaborate.cxx @@ -1441,6 +1441,7 @@ systemtap_session::systemtap_session (): user_file (0), be_derived_probes(0), dwarf_derived_probes(0), + kprobe_derived_probes(0), uprobe_derived_probes(0), utrace_derived_probes(0), itrace_derived_probes(0), -- cgit From ed82b7c902d6a2e26452ec51c9cdb9665dbf9e97 Mon Sep 17 00:00:00 2001 From: Wenji Huang Date: Mon, 27 Apr 2009 22:35:05 -0400 Subject: PR10102: tolerate mismatched optional probe * elaborate.cxx: Early return for mismatched optional probe. * testsuite/systemtap.base/optionalprobe.exp: New test case. * testsuite/systemtap.base/optionalprobe.stp: Ditto. --- elaborate.cxx | 3 +++ 1 file changed, 3 insertions(+) (limited to 'elaborate.cxx') diff --git a/elaborate.cxx b/elaborate.cxx index 47b77c9b..53f2a8f6 100644 --- a/elaborate.cxx +++ b/elaborate.cxx @@ -406,6 +406,9 @@ match_node::find_and_build (systemtap_session& s, sub_map_iterator_t i = sub.find (match); if (i == sub.end()) // no match { + if (loc->optional) /* PR10102: to tolerate mismatched optional probe */ + return; + string alternatives; for (sub_map_iterator_t i = sub.begin(); i != sub.end(); i++) alternatives += string(" ") + i->first.str(); -- cgit From 74efda8d847591a2146601ad085e6411340f3e98 Mon Sep 17 00:00:00 2001 From: Wenji Huang Date: Tue, 5 May 2009 19:26:38 -0400 Subject: PR10102: tolerate the failure related to optional probe This patch will make stap silently accept the failure related to optional probe. It puts try/catch around find_and_build which can cover most probe types. The specific treatment for dwarf_derived_probe in commit ed82b7c902d6a2e26452ec51c9cdb9665dbf9e97 is reverted. --- elaborate.cxx | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'elaborate.cxx') diff --git a/elaborate.cxx b/elaborate.cxx index 53f2a8f6..6fb3f197 100644 --- a/elaborate.cxx +++ b/elaborate.cxx @@ -406,9 +406,6 @@ match_node::find_and_build (systemtap_session& s, sub_map_iterator_t i = sub.find (match); if (i == sub.end()) // no match { - if (loc->optional) /* PR10102: to tolerate mismatched optional probe */ - return; - string alternatives; for (sub_map_iterator_t i = sub.begin(); i != sub.end(); i++) alternatives += string(" ") + i->first.str(); @@ -633,7 +630,18 @@ derive_probes (systemtap_session& s, // and set a flag on the copy permanently. bool old_loc_opt = loc->optional; loc->optional = loc->optional || optional; - s.pattern_root->find_and_build (s, p, loc, 0, dps); // <-- actual derivation! + try + { + s.pattern_root->find_and_build (s, p, loc, 0, dps); // <-- actual derivation! + } + catch (const semantic_error& e) + { + if (!loc->optional) + throw semantic_error(e); + else /* tolerate failure for optional probe */ + continue; + } + loc->optional = old_loc_opt; unsigned num_atend = dps.size(); -- cgit From 946e1a48eb5b92dcf17a064b62157124da661869 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 8 May 2009 19:30:42 -0700 Subject: Allow @cast failures to get optimized away We have the saved_conversion_error field, but I wasn't using it. Now @cast errors are saved in that field, so they're only seen if the optimizer doesn't remove the @cast. --- elaborate.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'elaborate.cxx') diff --git a/elaborate.cxx b/elaborate.cxx index 6fb3f197..7c4a5fca 100644 --- a/elaborate.cxx +++ b/elaborate.cxx @@ -3448,7 +3448,7 @@ typeresolution_info::visit_cast_op (cast_op* e) if (e->saved_conversion_error) throw (* (e->saved_conversion_error)); else - throw semantic_error("unresolved cast expression", e->tok); + throw semantic_error("type definition '" + e->type + "' not found", e->tok); } -- cgit