kallsyms_lookup_name
Abu Rasheda
rcpilot2010 at gmail.com
Mon Aug 8 14:21:30 EDT 2011
>
> - grep kallsyms_lookup from /proc/kallsyms (it is there on SL 5.5 and SL
>> 6.0. You can edit your program and assign something like:
>>
>> int (*my_kallsyms_lookup_name)(const char *name) = (void *) KALLSYMS;
>>
>> where KALLSYMS is address found above, or your loading script can feed
>> this address.
>>
>
> This is what i am currently doing but i need a cleaner way of doing this.
>
Sometime, this is only thing you have, and this is pretty clean. You can
write a script, which could pass module parameter for the address of the
function.
> if your kernel is compiled with kprobe, you can use it to get address too.
>>
>
> How do i do it using kprobes? To register a kprobe, i need the address of
> kallsyms_lookup_name which is what i want in the first place.
>
I think following should work.
struct kprobe kp;
memset(&kp, 0, sizeof(kp));
kp.symbol_name = "kallsyms_lookup_name";
if (!register_kprobe(&kp))
{
my_kallsyms_lookup_name = (void *) kp.addr;
unregister_kprobe(&kp);
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110808/3e827836/attachment.html
More information about the Kernelnewbies
mailing list