summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfche <fche>2006-11-30 21:09:54 +0000
committerfche <fche>2006-11-30 21:09:54 +0000
commitd05a1d002e625b460bd3d0023163564b0e0bb26d (patch)
tree2b9b75b21ec74d8cdda63d637e3d41ba2afc7e16
parent396a86ddf9550e4f2e850173dacd42346a521079 (diff)
downloadsystemtap-steved-d05a1d002e625b460bd3d0023163564b0e0bb26d.tar.gz
systemtap-steved-d05a1d002e625b460bd3d0023163564b0e0bb26d.tar.xz
systemtap-steved-d05a1d002e625b460bd3d0023163564b0e0bb26d.zip
2006-11-30 Frank Ch. Eigler <fche@elastic.org>
* tapsets.cxx (common_probe_entryfn_prologue): Tweak insufficient stack detection logic.
-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) << "}";