diff options
author | Frank Ch. Eigler <fche@elastic.org> | 2008-11-21 15:10:50 -0500 |
---|---|---|
committer | Frank Ch. Eigler <fche@elastic.org> | 2008-11-21 15:10:50 -0500 |
commit | b3c3ca7cb6c0280e8116845d6513b786ac0caf83 (patch) | |
tree | 8cc511540dedde3785a748a9e208d63745f6d2c7 /tapsets.cxx | |
parent | ce5cddc50edd07aeb34e5f7ea6ee4b5e229f6ea2 (diff) | |
download | systemtap-steved-b3c3ca7cb6c0280e8116845d6513b786ac0caf83.tar.gz systemtap-steved-b3c3ca7cb6c0280e8116845d6513b786ac0caf83.tar.xz systemtap-steved-b3c3ca7cb6c0280e8116845d6513b786ac0caf83.zip |
PR5689 part 2: separate skip counters for low-stack and reentrancy cases
Diffstat (limited to 'tapsets.cxx')
-rw-r--r-- | tapsets.cxx | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/tapsets.cxx b/tapsets.cxx index 601668d0..4b55470e 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -190,10 +190,10 @@ common_probe_entryfn_prologue (translator_output* o, string statestr, o->newline(1) << "< (MINSTACKSPACE + sizeof (struct thread_info)))) {"; // needed space // XXX: may need porting to platforms where task_struct is not at bottom of kernel stack // NB: see also CONFIG_DEBUG_STACKOVERFLOW - o->newline() << "if (unlikely (atomic_inc_return (& skipped_count) > MAXSKIPPED)) {"; - o->newline(1) << "atomic_set (& session_state, STAP_SESSION_ERROR);"; - o->newline() << "_stp_exit ();"; - o->newline(-1) << "}"; + o->newline() << "atomic_inc (& skipped_count);"; + o->newline() << "#ifdef STP_TIMING"; + o->newline() << "atomic_inc (& skipped_count_lowstack);"; + o->newline() << "#endif"; o->newline() << "goto probe_epilogue;"; o->newline(-1) << "}"; @@ -202,13 +202,11 @@ common_probe_entryfn_prologue (translator_output* o, string statestr, o->indent(-1); o->newline() << "c = per_cpu_ptr (contexts, smp_processor_id());"; - o->newline() << "if (unlikely (atomic_inc_return (&c->busy) != 1)) {"; - o->newline(1) << "if (atomic_inc_return (& skipped_count) > MAXSKIPPED) {"; - o->newline(1) << "atomic_set (& session_state, STAP_SESSION_ERROR);"; - // NB: We don't assume that we can safely call stp_error etc. in such - // a reentrant context. But this is OK: - o->newline() << "_stp_exit ();"; - o->newline(-1) << "}"; + o->newline() << "if (atomic_inc_return (& c->busy) != 1) {"; + o->newline(1) << "atomic_inc (& skipped_count);"; + o->newline() << "#ifdef STP_TIMING"; + o->newline() << "atomic_inc (& skipped_count_reentrant);"; + o->newline() << "#endif"; o->newline() << "atomic_dec (& c->busy);"; o->newline() << "goto probe_epilogue;"; o->newline(-1) << "}"; @@ -316,6 +314,12 @@ common_probe_entryfn_epilogue (translator_output* o, o->newline(-1) << "probe_epilogue:"; // context is free o->indent(1); + // 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 (! interruptible) o->newline() << "local_irq_restore (flags);"; else |