From 71696fcfa2761a2d09a0538c0101913f1c41925c Mon Sep 17 00:00:00 2001 From: fche Date: Tue, 2 Aug 2005 16:46:43 +0000 Subject: [PATCH] 2005-08-02 Frank Ch. Eigler * tapsets.cxx (emit_registrations): Treat module_name="kernel" as if module_name="". --- ChangeLog | 5 +++++ tapsets.cxx | 18 ++++++------------ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8a3b56c93..84a26b9ca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-08-02 Frank Ch. Eigler + + * tapsets.cxx (emit_registrations): Treat module_name="kernel" + as if module_name="". + 2005-08-01 Graydon Hoare * staptree.{cxx,h} (probe_point::component): Add a ctor. diff --git a/tapsets.cxx b/tapsets.cxx index b4a1ce02f..a51efad70 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -1302,7 +1302,7 @@ probe_entry_struct_kprobe_name(unsigned probenum) void dwarf_derived_probe::emit_registrations (translator_output* o, unsigned probenum) { - if (module_name.empty()) + if (module_name.empty() || module_name == "kernel") { if (has_return) { @@ -1327,21 +1327,15 @@ dwarf_derived_probe::emit_registrations (translator_output* o, unsigned probenum o->indent(1); o->newline() << "struct module *mod = get_module(\"" << module_name << "\");"; o->newline() << "if (!mod)"; - o->indent(1); - o->newline() << "rc++"; - o->indent(-1); - o->newline() << "else"; - o->newline() << "{"; - o->indent(1); - o->newline() << probe_entry_struct_kprobe_name(probenum) + o->newline(1) << "rc++;"; + o->newline(-1) << "else {"; + o->newline(1) << probe_entry_struct_kprobe_name(probenum) << ".addr = (void *) (mod->module_core + 0x" << hex << addr << ");"; o->newline() << "rc = register_kprobe (&" << probe_entry_struct_kprobe_name(probenum) << ");"; - o->indent(-1); - o->newline() << "}"; - o->indent(-1); - o->newline() << "}"; + o->newline(-1) << "}"; + o->newline(-1) << "}"; } } -- 2.43.5