diff options
author | Dave Brolley <brolley@redhat.com> | 2009-11-09 14:59:45 -0500 |
---|---|---|
committer | Dave Brolley <brolley@redhat.com> | 2009-11-09 14:59:45 -0500 |
commit | 52cd76fae6eee285a4d8345ee595f0b8a2907d7b (patch) | |
tree | c25ea6497334a08c1762b25b72565dd4b8a8baf8 /tapsets.cxx | |
parent | 64211010978d0e35c80ec7c119f1986a48f97543 (diff) | |
parent | dd905cf4dd14d5d53d0bc3696acaba04bda57bb5 (diff) | |
download | systemtap-steved-52cd76fae6eee285a4d8345ee595f0b8a2907d7b.tar.gz systemtap-steved-52cd76fae6eee285a4d8345ee595f0b8a2907d7b.tar.xz systemtap-steved-52cd76fae6eee285a4d8345ee595f0b8a2907d7b.zip |
Merge branch 'master' of ssh://sources.redhat.com/git/systemtap
Diffstat (limited to 'tapsets.cxx')
-rw-r--r-- | tapsets.cxx | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/tapsets.cxx b/tapsets.cxx index 6566c89f..2a893c95 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -228,7 +228,7 @@ common_probe_entryfn_epilogue (translator_output* o, // Check for excessive skip counts. o->newline() << "if (unlikely (atomic_read (& skipped_count) > MAXSKIPPED)) {"; - o->newline(1) << "if (unlikely (atomic_cmpxchg(& session_state, STAP_SESSION_RUNNING, STAP_SESSION_ERROR) == STAP_SESSION_RUNNING))"; + o->newline(1) << "if (unlikely (pseudo_atomic_cmpxchg(& session_state, STAP_SESSION_RUNNING, STAP_SESSION_ERROR) == STAP_SESSION_RUNNING))"; o->newline() << "_stp_error (\"Skipped too many probes, check MAXSKIPPED or try again with stap -t for more details.\");"; o->newline(-1) << "}"; @@ -2911,6 +2911,16 @@ dwarf_derived_probe::saveargs(dwarf_query& q, Dwarf_Die* scope_die, dwarf_var_ex dwarf_type_name(&type_die, type_name)) args.insert("$return:"+type_name); + /* Pretend that we aren't in a .return for a moment, just so we can + * check whether variables are accessible. We don't want any of the + * entry-saving code generated during listing mode. This works + * because the set of $context variables available in a .return + * probe (apart from $return) is the same set as available for the + * corresponding .call probe, since we collect those variables at + * .call time. */ + bool saved_has_return = has_return; + q.has_return = has_return = false; + Dwarf_Die arg; vector<Dwarf_Die> scopes = q.dw.getscopes_die(scope_die); if (dwarf_child (&scopes[0], &arg) == 0) @@ -2937,8 +2947,7 @@ dwarf_derived_probe::saveargs(dwarf_query& q, Dwarf_Die* scope_die, dwarf_var_ex /* trick from visit_target_symbol_context */ target_symbol *tsym = new target_symbol; - token *t = new token; - tsym->tok = t; + tsym->tok = q.base_loc->tok; tsym->base_name = "$"; tsym->base_name += arg_name; @@ -2949,6 +2958,9 @@ dwarf_derived_probe::saveargs(dwarf_query& q, Dwarf_Die* scope_die, dwarf_var_ex args.insert("$"+string(arg_name)+":"+type_name); } while (dwarf_siblingof (&arg, &arg) == 0); + + /* restore the .return status of the probe */ + q.has_return = has_return = saved_has_return; } @@ -4660,7 +4672,7 @@ uprobe_derived_probe_group::emit_module_decls (systemtap_session& s) s.op->newline() << "#endif"; // NB: duplicates common_entryfn_epilogue, but then this is not a probe entry fn epilogue. s.op->newline() << "if (unlikely (atomic_inc_return (& skipped_count) > MAXSKIPPED)) {"; - s.op->newline(1) << "if (unlikely (atomic_cmpxchg(& session_state, STAP_SESSION_RUNNING, STAP_SESSION_ERROR) == STAP_SESSION_RUNNING))"; + s.op->newline(1) << "if (unlikely (pseudo_atomic_cmpxchg(& session_state, STAP_SESSION_RUNNING, STAP_SESSION_ERROR) == STAP_SESSION_RUNNING))"; s.op->newline() << "_stp_error (\"Skipped too many probes, check MAXSKIPPED or try again with stap -t for more details.\");"; s.op->newline(-1) << "}"; s.op->newline(-1) << "}"; |