lkml.org 
[lkml]   [2016]   [Apr]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC] perf probe: Fix offline module name missmatch issue
From
Date
Thanks Masami,

On Tuesday 26 April 2016 07:49 AM, Masami Hiramatsu wrote:
> On Tue, 26 Apr 2016 06:24:38 +0900
> Masami Hiramatsu <mhiramat@kernel.org> wrote:
>>> +/*
>>> + * NOTE:
>>> + * '.gnu.linkonce.this_module' section of kernel module elf directly
>>> + * maps to 'struct module' from linux/module.h. This section contains
>>> + * actual module name which will be used by kernel after loading it.
>>> + * But, we cannot use 'struct module' here since linux/module.h is not
>>> + * exposed to user-space. Offset of 'name' has remained same from long
>>> + * time, so hardcoding it here.
>>> + */
> BTW, is there no way to get the module name avoiding to access
> this "hidden" data structure?
> This looks very tricky way...

So this is the same approach kernel use to find module name when module is
loaded. Please refer this function for more detail:

kernel/module.c :: static struct module *setup_load_info(...)

Regards,
Ravi

\
 
 \ /
  Last update: 2016-04-26 11:21    [W:0.082 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site