lkml.org 
[lkml]   [2019]   [Oct]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] perf report: Add warning when libunwind not compiled in
Em Fri, Oct 11, 2019 at 10:21:22AM +0800, Jin Yao escreveu:
> We received a user report that call-graph dwarf mode was enabled in perf
> record but perf report didn't unwind the callstack correctly. The reason was,
> libunwind was not compiled in.
>
> We can use 'perf -vv' to check the compiled libraries but it would be valuable
> to report a warning to user directly (especially valuable for perf newbie).
>
> The warning is,
>
> Warning:
> Please install libunwind development packages during the perf build.
>
> Both tui and stdio are supported.

Thanks, applied.

> Signed-off-by: Jin Yao <yao.jin@linux.intel.com>
> ---
> tools/perf/builtin-report.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
> index aae0e57c60fb..7accaf8ef689 100644
> --- a/tools/perf/builtin-report.c
> +++ b/tools/perf/builtin-report.c
> @@ -399,6 +399,13 @@ static int report__setup_sample_type(struct report *rep)
> PERF_SAMPLE_BRANCH_ANY))
> rep->nonany_branch_mode = true;
>
> +#ifndef HAVE_LIBUNWIND_SUPPORT
> + if (dwarf_callchain_users) {
> + ui__warning("Please install libunwind development packages "
> + "during the perf build.\n");
> + }
> +#endif
> +
> return 0;
> }
>
> --
> 2.17.1

--

- Arnaldo

\
 
 \ /
  Last update: 2019-10-14 16:14    [W:1.918 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site