diff options
author | Srinivasa Ds <srinivasa@in.ibm.com> | 2007-04-23 01:58:49 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-05-02 06:04:32 -0400 |
commit | eb609e52d188775da738a1ffd1e982e6212c77d7 (patch) | |
tree | c3fdca2f59b661210f7b44ddf6efc6c65ee16e86 /include/asm-powerpc/kprobes.h | |
parent | 14d1d2f25bca1c4ed45704c8019f6c971c40bba4 (diff) |
[POWERPC] Transparently handle <.symbol> lookup for kprobes
When data symbols are not present in kernel image, user needs to add
dot(".") before function name explicitly, that he wants to probe in kprobe
module on ppc64.
for ex:-
When data symbols are missing on ppc64,
====================
[root@llm27lp1 ~]# cat /proc/kallsyms | grep do_fork
c00000000006283c T .do_fork
==============================
User needs add "." to "do_fork"
kp.symbol_name = ".do_fork";
============================
This makes kprobe modules unportable. This fixes the problem.
Signed-off-by: Srinivasa Ds <srinivasa@in.ibm.com>
Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'include/asm-powerpc/kprobes.h')
-rw-r--r-- | include/asm-powerpc/kprobes.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/asm-powerpc/kprobes.h b/include/asm-powerpc/kprobes.h index f850ca7020ed..fc713e595982 100644 --- a/include/asm-powerpc/kprobes.h +++ b/include/asm-powerpc/kprobes.h | |||
@@ -64,6 +64,12 @@ typedef unsigned int kprobe_opcode_t; | |||
64 | addr = *(kprobe_opcode_t **)addr; \ | 64 | addr = *(kprobe_opcode_t **)addr; \ |
65 | } else if (name[0] != '.') \ | 65 | } else if (name[0] != '.') \ |
66 | addr = *(kprobe_opcode_t **)addr; \ | 66 | addr = *(kprobe_opcode_t **)addr; \ |
67 | } else { \ | ||
68 | char dot_name[KSYM_NAME_LEN+1]; \ | ||
69 | dot_name[0] = '.'; \ | ||
70 | dot_name[1] = '\0'; \ | ||
71 | strncat(dot_name, name, KSYM_NAME_LEN); \ | ||
72 | addr = (kprobe_opcode_t *)kallsyms_lookup_name(dot_name); \ | ||
67 | } \ | 73 | } \ |
68 | } | 74 | } |
69 | 75 | ||