Re: [PATCH perf/core 1/2] [RESEND] perf probe: Show the error reason comes from invalid DSO

From: Masami Hiramatsu
Date: Wed May 27 2015 - 19:42:53 EST


On 2015/05/27 21:50, Arnaldo Carvalho de Melo wrote:
> Em Wed, May 27, 2015 at 05:37:18PM +0900, Masami Hiramatsu escreveu:
>> Show the reason of error when dso__load* failed. This shows
>> when user gives wrong kernel image or wrong path.
>
>> Without this, perf probe shows an obscure message.
>> ----
>> $ perf probe -k ~/kbin/linux-3.x86_64/vmlinux -L vfs_read
>> Failed to find path of kernel module.
>> Error: Failed to show lines.
>> ----
>
>> With this, perf shows appropriate error message.
>> ----
>> $ perf probe -k ~/kbin/linux-3.x86_64/vmlinux -L vfs_read
>> Failed to find the path for kernel: Mismatching build id
>> Error: Failed to show lines.
>> ----
>> And
>> ----
>> $ perf probe -k /non-exist/kernel/vmlinux -L vfs_read
>> Failed to find the path for kernel: No such file or directory
>> Error: Failed to show lines.
>> ----
>
> Its better than before, and I am applying it.
>
> But please consider to change the message further, because when one
> specifies the vmlinux file to use with -k/--vmlinux, the tool is not
> trying to "find the path for kernel", it is trying to use a specific
> vmlinux file.
>
> I.e. the messages above are good if we do:
>
> perf probe -L vfs_read
>
> Here it _will_ try to find the path, as none was given.
>
> So, when -k/--vmlinux is used, I suggest that the message be:
>
> $ perf probe -k ~/kbin/linux-3.x86_64/vmlinux -L vfs_read
> The kernel file "~/kbin/linux-3.x86_64/vmlinux" could not be used: Mismatching build id
> Error: Failed to show lines.
>
> And:
>
> $ perf probe -k /non-exist/kernel/vmlinux -L vfs_read
> The kernel file "/non-exist/kernel/vmlinux" could not be used: No such file or directory
> Error: Failed to show lines.

Indeed! This looks better for me.

Thank you!

--
Masami HIRAMATSU
Linux Technology Research Center, System Productivity Research Dept.
Center for Technology Innovation - Systems Engineering
Hitachi, Ltd., Research & Development Group
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/