summaryrefslogtreecommitdiffstats
path: root/translate.cxx
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@elastic.org>2008-11-21 15:10:50 -0500
committerFrank Ch. Eigler <fche@elastic.org>2008-11-21 15:10:50 -0500
commitb3c3ca7cb6c0280e8116845d6513b786ac0caf83 (patch)
tree8cc511540dedde3785a748a9e208d63745f6d2c7 /translate.cxx
parentce5cddc50edd07aeb34e5f7ea6ee4b5e229f6ea2 (diff)
downloadsystemtap-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 'translate.cxx')
-rw-r--r--translate.cxx21
1 files changed, 13 insertions, 8 deletions
diff --git a/translate.cxx b/translate.cxx
index 8bae5275..74fa609f 100644
--- a/translate.cxx
+++ b/translate.cxx
@@ -863,6 +863,10 @@ c_unparser::emit_common_header ()
o->newline() << "atomic_t session_state = ATOMIC_INIT (STAP_SESSION_STARTING);";
o->newline() << "atomic_t error_count = ATOMIC_INIT (0);";
o->newline() << "atomic_t skipped_count = ATOMIC_INIT (0);";
+ o->newline() << "#ifdef STP_TIMING";
+ o->newline() << "atomic_t skipped_count_lowstack = ATOMIC_INIT (0);";
+ o->newline() << "atomic_t skipped_count_reentrant = ATOMIC_INIT (0);";
+ o->newline() << "#endif";
o->newline();
o->newline() << "struct context {";
o->newline(1) << "atomic_t busy;";
@@ -1349,9 +1353,13 @@ c_unparser::emit_module_exit ()
{
string vn = c_varname (session->globals[i]->name);
o->newline() << "ctr = atomic_read (& global.s_" << vn << "_lock_skip_count);";
- o->newline() << "if (ctr) _stp_warn (\"Variable `%s' lock timeouts: %d\\n\", "
+ o->newline() << "if (ctr) _stp_warn (\"Skipped due to global '%s' lock timeout: %d\\n\", "
<< lex_cast_qstring(vn) << ", ctr);";
}
+ o->newline() << "ctr = atomic_read (& skipped_count_lowstack);";
+ o->newline() << "if (ctr) _stp_warn (\"Skipped due to low stack: %d\\n\", ctr);";
+ o->newline() << "ctr = atomic_read (& skipped_count_reentrant);";
+ o->newline() << "if (ctr) _stp_warn (\"Skipped due to reentrancy: %d\\n\", ctr);";
o->newline(-1) << "}";
o->newline () << "#endif";
o->newline() << "_stp_print_flush();";
@@ -1717,12 +1725,9 @@ c_unparser::emit_unlocks(const varuse_collecting_visitor& vut)
if (numvars) // is there a chance that any lock attempt failed?
{
- o->newline() << "if (atomic_read (& skipped_count) > MAXSKIPPED) {";
- // XXX: In this known non-reentrant context, we could print a more
- // informative error.
- o->newline(1) << "atomic_set (& session_state, STAP_SESSION_ERROR);";
- o->newline() << "_stp_exit();";
- o->newline(-1) << "}";
+ // Formerly, we checked skipped_count > MAXSKIPPED here, and set
+ // SYSTEMTAP_SESSION_ERROR if so. But now, this check is shared
+ // via common_probe_entryfn_epilogue().
if (session->verbose>1)
clog << endl;
@@ -4770,7 +4775,7 @@ emit_symbol_data (systemtap_session& s)
it != ctx.undone_unwindsym_modules.end();
it ++)
{
- s.print_warning ("missing unwind/symbol data for module `" + (*it) + "'");
+ s.print_warning ("missing unwind/symbol data for module '" + (*it) + "'");
}
}