X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=src%2Fwrapper%2Fkallsyms.c;h=93017adc87a6ab40cec47989df3659e56a92b2f1;hb=67c5ffca487ea357b2e59841f51293ec25d85983;hp=d284876407a0396dbe9a3cd22f574961653b5dbf;hpb=cbb2c0a178a4154ec086c73b3247c255b8ac1fea;p=lttng-modules.git diff --git a/src/wrapper/kallsyms.c b/src/wrapper/kallsyms.c index d2848764..93017adc 100644 --- a/src/wrapper/kallsyms.c +++ b/src/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 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 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)