lkml.org 
[lkml]   [2014]   [Feb]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH -tip v2 4/8] perf-probe: Use _stext based address instead of the symbol name
(2014/02/03 16:49), Namhyung Kim wrote:
> On Wed, 29 Jan 2014 09:14:59 +0000, Masami Hiramatsu wrote:
>> diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
>> index 4a9f43b..120954b 100644
>> --- a/tools/perf/util/probe-event.c
>> +++ b/tools/perf/util/probe-event.c
>> @@ -387,6 +387,44 @@ static int add_module_to_probe_trace_events(struct probe_trace_event *tevs,
>> return ret;
>> }
>>
>> +/* Post processing the probe events */
>> +static int post_process_probe_trace_events(struct probe_trace_event *tevs,
>> + int ntevs, const char *module,
>> + bool uprobe)
>> +{
>> + struct symbol *sym;
>> + struct map *map;
>> + unsigned long stext = 0;
>> + char *tmp;
>> + int i;
>> +
>> + if (uprobe)
>> + return add_exec_to_probe_trace_events(tevs, ntevs, module);
>> +
>> + /* Note that currently _stext based probe is not for drivers */
>> + if (module)
>> + return add_module_to_probe_trace_events(tevs, ntevs, module);
>> +
>> + sym = __find_kernel_function_by_name("_stext", &map);
>
> Couldn't we just use kmap->ref_reloc_sym instead of the hard-coded
> "_stext"? You might want to check the Adrian's recent kaslr fixes (now
> in tip/perf/urgent).

Yeah, I just found Adrian's work and this series must be updated for that,
because symbol's address is now based on the real (relocated) address.
OK, I'll try to use a symbol in ref_reloc_sym. ;) Thank you for pointed it out!

Thanks!

--
Masami HIRAMATSU
IT Management Research Dept. Linux Technology Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt@hitachi.com




\
 
 \ /
  Last update: 2014-02-03 10:01    [W:0.081 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site