X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=wrapper%2Fkallsyms.c;h=ba27b3399e64f95dc5d78381157d1f650df2c3be;hb=9874ec562e299f8abe680c89c810d8c2d5cec0aa;hp=d892a2f4860a3b783296b3a0ad8f87011114fea9;hpb=2d0428212cbfa3f8428feee160b095f48c2ac974;p=lttng-modules.git diff --git a/wrapper/kallsyms.c b/wrapper/kallsyms.c index d892a2f4..ba27b339 100644 --- a/wrapper/kallsyms.c +++ b/wrapper/kallsyms.c @@ -39,10 +39,26 @@ unsigned long do_get_kallsyms(void) memset(&probe, 0, sizeof(probe)); probe.pre_handler = dummy_kprobe_handler; probe.symbol_name = "kallsyms_lookup_name"; +#ifdef LTTNG_CONFIG_PPC64_ELF_ABI_V2 + /* + * With powerpc64 ABIv2, we need the global entry point of + * kallsyms_lookup_name to call it later, while kprobe_register would + * automatically adjust the global entry point to the local entry point, + * when a kprobe was registered at a function entry. So we add 4 bytes + * which is the length of one instruction to kallsyms_lookup_name to + * avoid the adjustment. + */ + probe.offset = 4; +#endif ret = register_kprobe(&probe); if (ret) return 0; +#ifdef LTTNG_CONFIG_PPC64_ELF_ABI_V2 + /* Substract 4 bytes to get what we originally want */ + addr = (unsigned long)(((char *)probe.addr) - 4); +#else addr = (unsigned long)probe.addr; +#endif #ifdef CONFIG_ARM #ifdef CONFIG_THUMB2_KERNEL if (addr)