Re: [PATCH -tip v3 01/11] [BUGFIX] perf-probe: Fix to do exit call for symbol maps

From: Masami Hiramatsu
Date: Mon Feb 17 2014 - 06:44:18 EST


(2014/02/17 16:56), Namhyung Kim wrote:
> Hi Masami,
>
> On Thu, 06 Feb 2014 05:32:04 +0000, Masami Hiramatsu wrote:
>> Some perf-probe commands do symbol_init() but doesn't
>> do exit call. This fixes that to call symbol_exit()
>> and releases machine if needed.
>> This also merges init_vmlinux() and init_user_exec()
>> because both of them are doing similar things.
>> (init_user_exec() just skips init vmlinux related
>> symbol maps)
>>
>> Changes from v2:
>> - Not to set symbol_conf.try_vmlinux_path in init_symbol_maps()
>> (Thanks to Namhyung Kim!)
>>
>> Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@xxxxxxxxxxx>
>
> [SNIP]
>> -int show_line_range(struct line_range *lr, const char *module)
>> +static int __show_line_range(struct line_range *lr, const char *module)
>> {
>> int l = 1;
>> struct line_node *ln;
>> @@ -573,10 +568,6 @@ int show_line_range(struct line_range *lr, const char *module)
>> char *tmp;
>>
>> /* Search a line range */
>> - ret = init_vmlinux();
>> - if (ret < 0)
>> - return ret;
>> -
>> dinfo = open_debuginfo(module);
>> if (!dinfo) {
>> pr_warning("Failed to open debuginfo file.\n");
>> @@ -646,6 +637,19 @@ end:
>> return ret;
>> }
>>
>> +int show_line_range(struct line_range *lr, const char *module)
>> +{
>> + int ret;
>> +
>> + ret = init_symbol_maps(false);
>> + if (ret < 0)
>> + return ret;
>> + ret = __show_line_range(lr, module);
>> + exit_symbol_maps();
>
> Wouldn't it be better moving init/exit_symbol_maps() to a common
> location if they're used by every operations?

Oh, that's a good idea.:)
Since this just introduces init/exit_symbol_maps() to fix issue
by replacing old one. I think it's better to be done after this series.

Thank you,



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


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/