From: Srinivasa Ds Date: Mon, 23 Apr 2007 05:58:49 +0000 (+0530) Subject: [POWERPC] Transparently handle <.symbol> lookup for kprobes X-Git-Tag: MMI-PSA29.97-13-9~43501^2~47 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=eb609e52d188775da738a1ffd1e982e6212c77d7;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git [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 Signed-off-by: Ananth N Mavinakayanahalli Signed-off-by: Paul Mackerras --- 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; addr = *(kprobe_opcode_t **)addr; \ } else if (name[0] != '.') \ addr = *(kprobe_opcode_t **)addr; \ + } else { \ + char dot_name[KSYM_NAME_LEN+1]; \ + dot_name[0] = '.'; \ + dot_name[1] = '\0'; \ + strncat(dot_name, name, KSYM_NAME_LEN); \ + addr = (kprobe_opcode_t *)kallsyms_lookup_name(dot_name); \ } \ }