This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
bugfix for pr14555
- From: Alexander Lochmann <alexander dot lochmann at tu-dortmund dot de>
- To: systemtap at sourceware dot org
- Date: Mon, 24 Sep 2012 21:20:43 +0200
- Subject: bugfix for pr14555
Hi all,
here is a patch draft fixing issue 14555.
let me know what you think about it.
greeting
Alex
>From c8c97b7d239418eade7a5d52210efd60473f15fc Mon Sep 17 00:00:00 2001
From: Alexander Lochmann <alexander.lochmann@tu-dortmund.de>
Date: Mon, 24 Sep 2012 19:45:10 +0200
Subject: [PATCH] Bugfix for pr14555
---
runtime/transport/symbols.c | 14 +++++++++++++-
1 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/runtime/transport/symbols.c b/runtime/transport/symbols.c
index 08f9265..9930bde 100644
--- a/runtime/transport/symbols.c
+++ b/runtime/transport/symbols.c
@@ -60,8 +60,20 @@ 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)) {
- dbug_sym(2, "found kernel _stext load address: 0x%lx\n",
+ 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;
}
--
1.7.2.5