diff options
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | tapsets.cxx | 7 | ||||
-rw-r--r-- | translate.cxx | 9 |
3 files changed, 19 insertions, 6 deletions
@@ -1,4 +1,13 @@ +2005-10-18 Frank Ch. Eigler <fche@elastic.org> + + PR 1482 cont'd. + * translator.cxx (emit_module_init): Set aside a variable for + detailed probe point id. + * tapsets.cxx (emit_registrations): Use it. + (add_probe_point): Correct synthesized probe-point typo. + 2005-10-17 Martin Hunt <hunt@redhat.com> + PR 1482 * tapsets.cxx (emit_registrations): On failure, don't forget to unregister probe 0; diff --git a/tapsets.cxx b/tapsets.cxx index c174db2f..5fcef4aa 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -2330,7 +2330,7 @@ dwarf_derived_probe::add_probe_point(string const & funcname, string fn_or_stmt; if (q.has_function_str || q.has_function_num) fn_or_stmt = "function"; - if (q.has_inline_str || q.has_inline_num) + else if (q.has_inline_str || q.has_inline_num) fn_or_stmt = "inline"; else fn_or_stmt = "statement"; @@ -2552,7 +2552,10 @@ dwarf_derived_probe::emit_registrations (translator_output* o, o->newline() << "rc = register_kprobe (&(" << probe_name << "));"; } - o->newline() << "if (unlikely (rc)) break;"; + o->newline() << "if (unlikely (rc)) {"; + o->newline(1) << "probe_point = " << string_array_name (probenum) << "[i];"; + o->newline() << "break;"; + o->newline(-1) << "}"; o->newline(-1) << "}"; // if one failed, must roll back completed registations for this probe diff --git a/translate.cxx b/translate.cxx index a8b3ca12..5e9621cc 100644 --- a/translate.cxx +++ b/translate.cxx @@ -707,6 +707,7 @@ c_unparser::emit_module_init () o->newline() << "static int systemtap_module_init (void);"; o->newline() << "int systemtap_module_init () {"; o->newline(1) << "int rc = 0;"; + o->newline() << "const char *probe_point = \"\";"; o->newline() << "atomic_set (&session_state, STAP_SESSION_STARTING);"; // This signals any other probes that may be invoked in the next little @@ -727,6 +728,9 @@ c_unparser::emit_module_init () { o->newline() << "/* register probe #" << i << ", "; o->line() << session->probes[i]->locations.size() << " location(s) */"; + // default + o->newline() << "probe_point = " << + lex_cast_qstring (*session->probes[i]->tok) << ";"; session->probes[i]->emit_registrations (o, i); o->newline() << "if (unlikely (rc)) {"; @@ -735,11 +739,8 @@ c_unparser::emit_module_init () // probe from attempting to run. o->newline(1) << "atomic_set (&session_state, STAP_SESSION_ERROR);"; - // XXX: would be nice to print failing probe point o->newline() << "_stp_error (\"probe " << i << " registration failed" - << ", rc=%d, %s\\n\", rc, " - << lex_cast_qstring(*session->probes[i]->tok) - << ");"; + << ", rc=%d, %s\\n\", rc, probe_point);"; // We need to deregister any already probes set up - this is // essential for kprobes. |