Re: [PATCH 2/2] perf tools: Show correct function name for srcline of callchains

From: Jiri Olsa
Date: Wed Nov 01 2017 - 08:14:41 EST


On Tue, Oct 31, 2017 at 11:06:54AM +0900, Namhyung Kim wrote:
> When libbfd is not used, it doesn't show proper function name and reuse
> the original symbol of the sample. That's because it passes the
> original sym to inline_list__append(). As `addr2line -f` returns
> function names as well, use that to create ad inline_sym and pass it to
> inline_list__append().
>
> For example, following data shows that inlined entries of main have same
> name (main).
>
> Before:
> $ perf report -g srcline -q | head
> 45.22% inlining libm-2.26.so [.] __hypot_finite
> |
> ---__hypot_finite ??:0
> |
> |--44.15%--hypot ??:0
> | main complex:589
> | main complex:597
> | main complex:654
> | main complex:664
> | main inlining.cpp:14
>
> After:
> $ perf report -g srcline -q | head
> 45.22% inlining libm-2.26.so [.] __hypot_finite
> |
> ---__hypot_finite
> |
> |--44.15%--hypot
> | std::__complex_abs complex:589 (inlined)
> | std::abs<double> complex:597 (inlined)
> | std::_Norm_helper<true>::_S_do_it<double> complex:654 (inlined)
> | std::norm<double> complex:664 (inlined)
> | main inlining.cpp:14
>
> Cc: Jin Yao <yao.jin@xxxxxxxxxxxxxxx>
> Cc: Milian Wolff <milian.wolff@xxxxxxxx>
> Signed-off-by: Namhyung Kim <namhyung@xxxxxxxxxx>

looks ok

Reviewed-by: Jiri Olsa <jolsa@xxxxxxxxxx>

jirka