From 2508b230c643707830bfc491c1606fe6d81bc92d Mon Sep 17 00:00:00 2001 From: fche Date: Tue, 18 Oct 2005 12:40:59 +0000 Subject: 2005-10-18 Frank Ch. Eigler 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. --- translate.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'translate.cxx') 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. -- cgit