perf report: Add warning when libunwind not compiled in
PATCH 1/1 perf report: Add warning when libunwind not compiled in
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.
--- tools/perf/builtin-report.c | 7 +++++++ 1 file changed, 7 insertions(+)
tools/perf/builtin-report.c +7 -0
@@ -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 ; }
Signature · 1 line
2.17.1
Arnaldo Carvalho de Melo
AppliedEm Fri, Oct 11, 2019 at 10:21:22AM +0800, Jin Yao escreveu:
Quoted 7 lines
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).
Quoted 6 lines
The warning is,
Warning:
Please install libunwind development packages during the perf build.Both tui and stdio are supported.
Thanks, applied.
Quoted 25 lines
Signed-off-by Jin Yao <[email protected]>--- tools/perf/builtin-report.c | 7 +++++++ 1 file changed, 7 insertions(+)tools/perf/builtin-report.c +7
-0@@ -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 ; }Signature · 1 line
2.17.1
Signature · 1 line
- Arnaldo
The following commit has been merged into the perf/core branch of tip:
The following commit has been merged into the perf/core branch of tip:
Commit-ID: 800d3f561659b5436f8c57e7c26dd1f6928b5615 Gitweb: https://git.kernel.org/tip/800d3f561659b5436f8c57e7c26dd1f6928b5615 Author: Jin Yao <[email protected]> AuthorDate: Fri, 11 Oct 2019 10:21:22 +08:00 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitterDate: Tue, 15 Oct 2019 08:36:22 -03:00
perf report: Add warning when libunwind not compiled in
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 a perf newbie).
The warning is:
Warning:
Please install libunwind development packages during the perf build.
Both TUI and stdio are supported.
--- tools/perf/builtin-report.c | 7 +++++++ 1 file changed, 7 insertions(+)
tools/perf/builtin-report.c +7 -0
@@ -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 ; }