From 30e5c333fafb8c30795f146cda4b8d11ce89e4f4 Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Wed, 10 Oct 2012 12:44:03 -0400 Subject: [PATCH] PR14555: tweak & simplify warning messages for _stext=0 message handling --- runtime/transport/symbols.c | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/runtime/transport/symbols.c b/runtime/transport/symbols.c index 9930bdec6..7dce77683 100644 --- a/runtime/transport/symbols.c +++ b/runtime/transport/symbols.c @@ -1,7 +1,7 @@ /* -*- linux-c -*- * symbols.c - stp symbol and module functions * - * Copyright (C) Red Hat Inc, 2006-2011 + * Copyright (C) Red Hat Inc, 2006-2012 * * This file is part of systemtap, and is free software. You can * redistribute it and/or modify it under the terms of the GNU General @@ -60,22 +60,17 @@ static void _stp_do_relocation(const char __user *buf, size_t count) /* Detect actual kernel load address. */ if (!strcmp ("kernel", msg.module) && !strcmp ("_stext", msg.reloc)) { - if (msg.address == 0) { - #ifdef CONFIG_KALLSYMS - dbug_sym(1,"asking kernel for _stext load address"); - msg.address = kallsyms_lookup_name("_stext"); - if (msg.address == 0) { - _stp_warn("kallsyms_lookup_name() does not returned a suitable load address for _stext"); - } else { - dbug_sym(1, "found kernel _stext load address: 0x%lx\n", - (unsigned long) msg.address); - } - #else - _stp_warn("No load address for symbol _stext given. Stap will not be able to relocate the probe points!"); - #endif - } - if (_stp_kretprobe_trampoline != (unsigned long) -1) - _stp_kretprobe_trampoline += (unsigned long) msg.address; +#ifdef CONFIG_KALLSYMS + if (msg.address == 0) + msg.address = kallsyms_lookup_name("_stext"); +#endif + if (msg.address == 0) + _stp_warn("No load address found _stext. Kernel probes and addresses may not be available."); + else + dbug_sym(1, "found kernel _stext load address: 0x%lx\n", + (unsigned long) msg.address); + if (_stp_kretprobe_trampoline != (unsigned long) -1) + _stp_kretprobe_trampoline += (unsigned long) msg.address; } _stp_kmodule_update_address(msg.module, msg.reloc, msg.address); -- 2.43.5