diff options
author | Charley Wang <chwang@redhat.com> | 2009-11-02 10:18:34 -0500 |
---|---|---|
committer | Charley Wang <chwang@redhat.com> | 2009-11-02 10:18:49 -0500 |
commit | f65166cc4689cff00717bc494d310c8317379d62 (patch) | |
tree | e610c27de0a1c857723f07c3b35bef4396031109 /tapsets.cxx | |
parent | 2c279bc4231e44dba80e5fdb10aa1626e412eab3 (diff) | |
download | systemtap-steved-f65166cc4689cff00717bc494d310c8317379d62.tar.gz systemtap-steved-f65166cc4689cff00717bc494d310c8317379d62.tar.xz systemtap-steved-f65166cc4689cff00717bc494d310c8317379d62.zip |
PR10849: make MAXSKIPPED overflow trigger an error message
Diffstat (limited to 'tapsets.cxx')
-rw-r--r-- | tapsets.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tapsets.cxx b/tapsets.cxx index c117b139..324237fa 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -228,8 +228,8 @@ common_probe_entryfn_epilogue (translator_output* o, // Check for excessive skip counts. o->newline() << "if (unlikely (atomic_read (& skipped_count) > MAXSKIPPED)) {"; - o->newline(1) << "atomic_set (& session_state, STAP_SESSION_ERROR);"; - o->newline() << "_stp_exit ();"; + o->newline(1) << "if (unlikely (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) << "}"; o->newline() << "#if INTERRUPTIBLE"; @@ -4634,8 +4634,8 @@ 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) << "atomic_set (& session_state, STAP_SESSION_ERROR);"; - s.op->newline() << "_stp_exit ();"; + s.op->newline(1) << "if (unlikely (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) << "}"; |