From 1472a4e17771f9076a7aa83c8cd2f4a1364a9a94 Mon Sep 17 00:00:00 2001 From: fche Date: Fri, 4 Nov 2005 21:46:14 +0000 Subject: 2005-11-04 Frank Ch. Eigler * tapsets.cxx (dwarf_derived_probe::emit_registrations): Add possible kprobe address prechecking logic. Set kretprobes maxactive to zero. * translate.cxx (emit_module_init): Set a more helpful default probe_point value for use in registration errors. Exit properly after registration failure of probe #0. --- translate.cxx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'translate.cxx') diff --git a/translate.cxx b/translate.cxx index bdacdcca..0c1ce84f 100644 --- a/translate.cxx +++ b/translate.cxx @@ -825,9 +825,13 @@ c_unparser::emit_module_init () { o->newline() << "/* register probe #" << i << ", "; o->line() << session->probes[i]->locations.size() << " location(s) */"; - // default + + // By default, mark the first location as the site of possible + // registration failure. This is helpful since non-dwarf + // derived_probes tend to have only a single location. + assert (session->probes[i]->locations.size() > 0); o->newline() << "probe_point = " << - lex_cast_qstring (*session->probes[i]->tok) << ";"; + lex_cast_qstring (*session->probes[i]->locations[0]) << ";"; session->probes[i]->emit_registrations (o, i); o->newline() << "if (unlikely (rc)) {"; @@ -843,6 +847,8 @@ c_unparser::emit_module_init () // essential for kprobes. if (i > 0) o->newline() << "goto unregister_" << (i-1) << ";"; + else + o->newline() << "goto out;"; o->newline(-1) << "}"; } -- cgit