diff options
author | dsmith <dsmith> | 2007-03-21 19:54:14 +0000 |
---|---|---|
committer | dsmith <dsmith> | 2007-03-21 19:54:14 +0000 |
commit | 29fdb4e446261de732f2edfe76823041c3e03663 (patch) | |
tree | e10ee804d9989bf034a148d8229fb79e80d4f3bf /translate.cxx | |
parent | c45f6fbff2e7e32b1b9cd4c6e726fa202a4542cf (diff) | |
download | systemtap-steved-29fdb4e446261de732f2edfe76823041c3e03663.tar.gz systemtap-steved-29fdb4e446261de732f2edfe76823041c3e03663.tar.xz systemtap-steved-29fdb4e446261de732f2edfe76823041c3e03663.zip |
2007-03-21 David Smith <dsmith@redhat.com>
PR 4146
* tapsets.cxx (common_probe_entryfn_prologue): Added
'interruptible' parameter. If a probe is interruptible,
interrupts are not disabled while the probe executes. Preemption
is disabled however. Interruptible parameter defaults to false.
(common_probe_entryfn_epilogue): Ditto.
(be_derived_probe_group::emit_module_decl): Uses new
'interruptible' parameter to mark begin/end probes as
interruptible.
(probe_derived_probe_group::emit_module): Initialize
'actionremaining' with MAXACTION instead of initializing
'actioncount' with 0.
* translate.cxx (emit_common_header): Renamed 'actioncount' to
'actionremaining'. Turned logic around to initialize
actionremaining to MAXACTION or MAXACTION_INTERRUPTIBLE then
decrement it as actions occur.
(translate_pass): Added MAXACTION_INTERRUPTIBLE initialization.
* translate.h: Removed outdated comment portion.
* stap.1.in: Documented MAXACTION_INTERRUPTIBLE.
* NEWS: Added note about begin/end probes being run with
interrupts enabled.
Diffstat (limited to 'translate.cxx')
-rw-r--r-- | translate.cxx | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/translate.cxx b/translate.cxx index d3f9467a..e656c5ee 100644 --- a/translate.cxx +++ b/translate.cxx @@ -808,7 +808,7 @@ c_unparser::emit_common_header () o->newline() << "struct context {"; o->newline(1) << "atomic_t busy;"; o->newline() << "const char *probe_point;"; - o->newline() << "unsigned actioncount;"; + o->newline() << "int actionremaining;"; o->newline() << "unsigned nesting;"; o->newline() << "const char *last_error;"; // NB: last_error is used as a health flag within a probe. @@ -2045,9 +2045,9 @@ c_unparser::visit_statement (statement *s, unsigned actions) if (actions > 0) { - o->newline() << "c->actioncount += " << actions << ";"; + o->newline() << "c->actionremaining -= " << actions << ";"; // XXX: This check is inserted too frequently. - o->newline() << "if (unlikely (c->actioncount > MAXACTION)) {"; + o->newline() << "if (unlikely (c->actionremaining <= 0)) {"; o->newline(1) << "c->last_error = \"MAXACTION exceeded\";"; o->newline() << "goto " << outlabel << ";"; o->newline(-1) << "}"; @@ -2189,9 +2189,9 @@ c_unparser::visit_for_loop (for_loop *s) // condition o->newline(-1) << toplabel << ":"; - // Emit an explicit actioncount increment here to cover the act of - // iteration. Equivalently, it can stand for the evaluation of the - // condition expression. + // Emit an explicit action here to cover the act of iteration. + // Equivalently, it can stand for the evaluation of the condition + // expression. o->indent(1); visit_statement (0, 1); @@ -2413,8 +2413,8 @@ c_unparser::visit_foreach_loop (foreach_loop *s) // condition o->newline(-1) << toplabel << ":"; - // Emit an explicit actioncount increment here to cover the act of - // iteration. Equivalently, it can stand for the evaluation of the + // Emit an explicit action here to cover the act of iteration. + // Equivalently, it can stand for the evaluation of the // condition expression. o->indent(1); visit_statement (0, 1); @@ -4072,6 +4072,9 @@ translate_pass (systemtap_session& s) s.op->newline() << "#ifndef MAXACTION"; s.op->newline() << "#define MAXACTION 1000"; s.op->newline() << "#endif"; + s.op->newline() << "#ifndef MAXACTION_INTERRUPTIBLE"; + s.op->newline() << "#define MAXACTION_INTERRUPTIBLE (MAXACTION * 10)"; + s.op->newline() << "#endif"; s.op->newline() << "#ifndef MAXTRYLOCK"; s.op->newline() << "#define MAXTRYLOCK MAXACTION"; s.op->newline() << "#endif"; |