summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--tapsets.cxx8
2 files changed, 10 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 0ed341c9..8efb2228 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-11-30 Frank Ch. Eigler <fche@elastic.org>
+
+ * tapsets.cxx (common_probe_entryfn_prologue): Tweak
+ insufficient stack detection logic.
+
2006-11-30 David Smith <dsmith@redhat.com>
* main.cxx (printscript): Prints global embedded code. Not
diff --git a/tapsets.cxx b/tapsets.cxx
index 7c373cda..fb24e4d8 100644
--- a/tapsets.cxx
+++ b/tapsets.cxx
@@ -176,9 +176,11 @@ common_probe_entryfn_prologue (translator_output* o, string statestr)
o->newline() << "local_irq_save (flags);";
// Check for enough free enough stack space
- o->newline() << "if ((((unsigned long) (& c)) & (THREAD_SIZE-1))";
- o->newline(1) << "< (THREAD_SIZE - MINSTACKSPACE - sizeof (struct task_struct))) {";
- o->newline() << "if (atomic_inc_return (& skipped_count) > MAXSKIPPED) {";
+ o->newline() << "if (unlikely ((((unsigned long) (& c)) & (THREAD_SIZE-1))"; // free space
+ o->newline(1) << "< (MINSTACKSPACE + sizeof (struct task_struct)))) {"; // 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) << "}";