perf --call-graph dwarf doesn't record correct call graph

Bug #1590236 reported by zhongwei
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
libunwind (Ubuntu)
Fix Released
High
Unassigned
Xenial
Confirmed
High
Unassigned
linux (Ubuntu)
Confirmed
High
Unassigned
Xenial
Confirmed
High
Unassigned

Bug Description

1. What you expected to happen
Profiling program by "perf --call-graph dwarf" shows correct call-graph in perf report

2. What actually happened
perf report doesn't show correct call graph. Then perf is re-builded from source. During building, perf configure detection says stock libunwind's debug_frame feature is not enabled. It leads perf can't record program's call-graph correctly.

3. How it is solved on my local machine
  a. get libunwind source by apt-get source libunwind-dev.
  b. enable CONFIG_DEBUG_FRAME in libunwind configuration: autoreconfig -i && ./configure --enable-debug-frame
  c. build libunwind and install it to /usr/lib/local
  d. get kernel source by apt-get source linux and compile perf with following command:
       CFLAGS=-I/usr/local/include/ LDFLAGS="-lunwind -L/usr/local/lib/" make
  e. perf call-graph works!

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: libunwind-dev (not installed)
ProcVersionSignature: Ubuntu 4.4.0-22.40-generic 4.4.8
Uname: Linux 4.4.0-22-generic aarch64
ApportVersion: 2.20.1-0ubuntu2
Architecture: arm64
Date: Wed Jun 8 03:33:05 2016
JournalErrors:
 Error: command ['journalctl', '-b', '--priority=warning', '--lines=1000'] failed with exit code 1: Hint: You are currently not seeing messages from other users and the system.
       Users in the 'systemd-journal' group can see all messages. Pass -q to
       turn off this notice.
 No journal files were opened due to insufficient permissions.
SourcePackage: libunwind
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
zhongwei (zhongwei-yao) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in libunwind (Ubuntu):
status: New → Confirmed
Revision history for this message
Maxim Kuvyrkov (maxim-kuvyrkov) wrote :

Perf utility from linux-tools is affected for AArch64.

Revision history for this message
Maxim Kuvyrkov (maxim-kuvyrkov) wrote :

IMO, the AArch64 libunwind port (included via AArch64-port.diff debian patch) should be setting enable_debug_frame to "yes" for aarch64 alongside arm in confirure.ac:

AC_MSG_CHECKING([whether to load .debug_frame sections])
AC_ARG_ENABLE(debug_frame,
AS_HELP_STRING([--enable-debug-frame],[Load the ".debug_frame" section if available]),, [
case "${target_arch}" in
  (arm) enable_debug_frame=yes;;
  (*) enable_debug_frame=no;;
esac])
if test x$enable_debug_frame = xyes; then
  AC_DEFINE([CONFIG_DEBUG_FRAME], [], [Enable Debug Frame])
fi
AC_MSG_RESULT([$enable_debug_frame])

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in linux (Ubuntu):
status: New → Confirmed
Brad Figg (brad-figg)
affects: linux-meta (Ubuntu) → linux (Ubuntu)
Changed in linux (Ubuntu):
status: New → Confirmed
Revision history for this message
Andy Whitcroft (apw) wrote :

We may need to rebuild perf after libunwind is rebuilt.

Changed in libunwind (Ubuntu Xenial):
importance: Undecided → High
Changed in linux (Ubuntu):
importance: Undecided → High
Changed in linux (Ubuntu Xenial):
importance: Undecided → High
Changed in libunwind (Ubuntu):
importance: Undecided → High
Changed in libunwind (Ubuntu Xenial):
status: New → Confirmed
Changed in linux (Ubuntu Xenial):
status: New → Confirmed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package libunwind - 1.1-4.1ubuntu1

---------------
libunwind (1.1-4.1ubuntu1) yakkety; urgency=medium

  * Configure with --enable-debug-frame. LP: #1590236.

 -- Matthias Klose <email address hidden> Mon, 19 Sep 2016 13:28:08 +0200

Changed in libunwind (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.