Skip to contentSkip to conversation

perf: add libunwind support

PATCH In review Chong Lu 1 participant 6 messages Aug 29, 2014 – Sep 9, 2014

lore
Share & tools
lore

Chong Lu

author
#0 lore raw

cover perf: add libunwind support

The following changes since commit 669c07d6022174d01fe5a95b7b0faa9ef86da1e2:

bitbake: build/data: Write out more complete python run files (2014-08-28 15:12:45 +0100)

are available in the git repository at:

git://git.pokylinux.org/poky-contrib chonglu/libunwind
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=chonglu/libunwind

Chong Lu (2):
libunwind: add recipes
perf: add libunwind support

 meta/recipes-kernel/perf/perf-features.inc      |  2 +-
 meta/recipes-kernel/perf/perf.bb                |  5 ++++-
 meta/recipes-support/libunwind/libunwind.inc    | 30 +++++++++++++++++++++++++
 meta/recipes-support/libunwind/libunwind_1.1.bb |  4 ++++
 4 files changed, 39 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-support/libunwind/libunwind.inc
 create mode 100644 meta/recipes-support/libunwind/libunwind_1.1.bb
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH 1/2 libunwind: add recipes

Add libunwind from meta-oe to oe-core, since perf depends on it.

---
 meta/recipes-support/libunwind/libunwind.inc    | 30 +++++++++++++++++++++++++
 meta/recipes-support/libunwind/libunwind_1.1.bb |  4 ++++
 2 files changed, 34 insertions(+)
 create mode 100644 meta/recipes-support/libunwind/libunwind.inc
 create mode 100644 meta/recipes-support/libunwind/libunwind_1.1.bb
meta/recipes-support/libunwind/libunwind.inc new file +30 -0
new file mode 100644
index 0000000..b27b9e5
@@ -0,0 +1,30 @@
+DESCRIPTION = "a portable and efficient C programming interface (API) to determine the call-chain of a program"
+HOMEPAGE = "http://www.nongnu.org/libunwind"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=3fced11d6df719b47505837a51c16ae5"
+
+SRC_URI = "${SAVANNAH_NONGNU_MIRROR}/${BPN}/${BPN}-${PV}.tar.gz"
+
+inherit autotools
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[lzma] = "--enable-minidebuginfo,--disable-minidebuginfo,lzma"
+
+EXTRA_OECONF_arm = "--enable-debug-frame"
+
+CFLAGS += "${ATOMICOPS}"
+ATOMICOPS_armv5 = "-DAO_USE_PTHREAD_DEFS=1"
+ATOMICOPS_armv4 = "-DAO_USE_PTHREAD_DEFS=1"
+ATOMICOPS ?= ""
+
+LDFLAGS += "${LIBATOMICS}"
+LIBATOMICS_armv5 = "-latomic_ops"
+LIBATOMICS_armv4 = "-latomic_ops"
+LIBATOMICS ?= ""
+
+DEPENDS += "${DEPLIBATOMICS}"
+DEPLIBATOMICS_armv5 = "libatomics-ops"
+DEPLIBATOMICS_armv4 = "libatomics-ops"
+DEPLIBATOMICS ?= ""
+
+BBCLASSEXTEND = "native"
meta/recipes-support/libunwind/libunwind_1.1.bb new file +4 -0
new file mode 100644
index 0000000..bc38e36
@@ -0,0 +1,4 @@
+require libunwind.inc
+
+SRC_URI[md5sum] = "fb4ea2f6fbbe45bf032cd36e586883ce"
+SRC_URI[sha256sum] = "9dfe0fcae2a866de9d3942c66995e4b460230446887dbdab302d41a8aee8d09a"
Signature · 1 line
1.9.1
author
#2 lore raw

Re: [PATCH 1/2] libunwind: add recipes

Quoted 1 line · Chong Lu

Add libunwind from meta-oe to oe-core, since perf depends on it.

To be clearly, adding this recipes to perf allows it to do stack traces on ARM - thumb2 and MIPS targets.

Quoted 55 lines
---
  meta/recipes-support/libunwind/libunwind.inc    | 30 +++++++++++++++++++++++++
  meta/recipes-support/libunwind/libunwind_1.1.bb |  4 ++++
  2 files changed, 34 insertions(+)

create mode 100644 meta/recipes-support/libunwind/libunwind.inc create mode 100644 meta/recipes-support/libunwind/libunwind_1.1.bb

meta/recipes-support/libunwind/libunwind.inc new file +30 -0
new file mode 100644
index 0000000..b27b9e5
@@ -0,0 +1,30 @@
+DESCRIPTION = "a portable and efficient C programming interface (API) to determine the call-chain of a program"
+HOMEPAGE = "http://www.nongnu.org/libunwind"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=3fced11d6df719b47505837a51c16ae5"
+
+SRC_URI = "${SAVANNAH_NONGNU_MIRROR}/${BPN}/${BPN}-${PV}.tar.gz"
+
+inherit autotools
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[lzma] = "--enable-minidebuginfo,--disable-minidebuginfo,lzma"
+
+EXTRA_OECONF_arm = "--enable-debug-frame"
+
+CFLAGS += "${ATOMICOPS}"
+ATOMICOPS_armv5 = "-DAO_USE_PTHREAD_DEFS=1"
+ATOMICOPS_armv4 = "-DAO_USE_PTHREAD_DEFS=1"
+ATOMICOPS ?= ""
+
+LDFLAGS += "${LIBATOMICS}"
+LIBATOMICS_armv5 = "-latomic_ops"
+LIBATOMICS_armv4 = "-latomic_ops"
+LIBATOMICS ?= ""
+
+DEPENDS += "${DEPLIBATOMICS}"
+DEPLIBATOMICS_armv5 = "libatomics-ops"
+DEPLIBATOMICS_armv4 = "libatomics-ops"
+DEPLIBATOMICS ?= ""
+
+BBCLASSEXTEND = "native"
meta/recipes-support/libunwind/libunwind_1.1.bb new file +4 -0
new file mode 100644
index 0000000..bc38e36
@@ -0,0 +1,4 @@
+require libunwind.inc
+
+SRC_URI[md5sum] = "fb4ea2f6fbbe45bf032cd36e586883ce"
+SRC_URI[sha256sum] = "9dfe0fcae2a866de9d3942c66995e4b460230446887dbdab302d41a8aee8d09a"
author
#3 lore raw

Re: [PATCH 1/2] libunwind: add recipes

In reply to Chong Lu

ping

Quoted 56 lines · Chong Lu

Add libunwind from meta-oe to oe-core, since perf depends on it.

---
  meta/recipes-support/libunwind/libunwind.inc    | 30 +++++++++++++++++++++++++
  meta/recipes-support/libunwind/libunwind_1.1.bb |  4 ++++
  2 files changed, 34 insertions(+)

create mode 100644 meta/recipes-support/libunwind/libunwind.inc create mode 100644 meta/recipes-support/libunwind/libunwind_1.1.bb

meta/recipes-support/libunwind/libunwind.inc new file +30 -0
new file mode 100644
index 0000000..b27b9e5
@@ -0,0 +1,30 @@
+DESCRIPTION = "a portable and efficient C programming interface (API) to determine the call-chain of a program"
+HOMEPAGE = "http://www.nongnu.org/libunwind"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=3fced11d6df719b47505837a51c16ae5"
+
+SRC_URI = "${SAVANNAH_NONGNU_MIRROR}/${BPN}/${BPN}-${PV}.tar.gz"
+
+inherit autotools
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[lzma] = "--enable-minidebuginfo,--disable-minidebuginfo,lzma"
+
+EXTRA_OECONF_arm = "--enable-debug-frame"
+
+CFLAGS += "${ATOMICOPS}"
+ATOMICOPS_armv5 = "-DAO_USE_PTHREAD_DEFS=1"
+ATOMICOPS_armv4 = "-DAO_USE_PTHREAD_DEFS=1"
+ATOMICOPS ?= ""
+
+LDFLAGS += "${LIBATOMICS}"
+LIBATOMICS_armv5 = "-latomic_ops"
+LIBATOMICS_armv4 = "-latomic_ops"
+LIBATOMICS ?= ""
+
+DEPENDS += "${DEPLIBATOMICS}"
+DEPLIBATOMICS_armv5 = "libatomics-ops"
+DEPLIBATOMICS_armv4 = "libatomics-ops"
+DEPLIBATOMICS ?= ""
+
+BBCLASSEXTEND = "native"
meta/recipes-support/libunwind/libunwind_1.1.bb new file +4 -0
new file mode 100644
index 0000000..bc38e36
@@ -0,0 +1,4 @@
+require libunwind.inc
+
+SRC_URI[md5sum] = "fb4ea2f6fbbe45bf032cd36e586883ce"
+SRC_URI[sha256sum] = "9dfe0fcae2a866de9d3942c66995e4b460230446887dbdab302d41a8aee8d09a"
author
#4 lore raw

PATCH 2/2 perf: add libunwind support

In reply to Chong Lu

Add a new feature named 'perf-libunwind'. Adding this support to perf allows it to do stack traces on ARM - thumb2 and MIPS targets. PERF_FEATURES variable in perf-features.inc will enable the perf-libunwind.

---
 meta/recipes-kernel/perf/perf-features.inc | 2 +-
 meta/recipes-kernel/perf/perf.bb           | 5 ++++-
 2 files changed, 5 insertions(+), 2 deletions(-)
meta/recipes-kernel/perf/perf-features.inc +1 -1
index b8859ab..2dbbb47 100644
@@ -1,4 +1,4 @@
-PERF_FEATURES_ENABLE ?= "perf-scripting perf-tui"
+PERF_FEATURES_ENABLE ?= "perf-scripting perf-tui perf-libunwind"
 
 def perf_feature_enabled(feature, trueval, falseval, d):
     """
meta/recipes-kernel/perf/perf.bb +4 -1
index bfd210c..ab94a05 100644
@@ -20,6 +20,7 @@ BUILDPERF_libc-uclibc = "no"
 # to cover a wide range of kernel we add both dependencies
 TUI_DEPENDS = "${@perf_feature_enabled('perf-tui', 'libnewt slang', '',d)}"
 SCRIPTING_DEPENDS = "${@perf_feature_enabled('perf-scripting', 'perl python', '',d)}"
+LIBUNWIND_DEPENDS = "${@perf_feature_enabled('perf-libunwind', 'libunwind', '',d)}"
 
 DEPENDS = "virtual/kernel \
     virtual/${MLPREFIX}libc \
@@ -27,6 +28,7 @@ DEPENDS = "virtual/kernel \
     ${MLPREFIX}binutils \
     ${TUI_DEPENDS} \
     ${SCRIPTING_DEPENDS} \
+    ${LIBUNWIND_DEPENDS} \
     bison flex \
 "
 
@@ -62,6 +64,7 @@ B = "${WORKDIR}/${BPN}-${PV}"
 
 SCRIPTING_DEFINES = "${@perf_feature_enabled('perf-scripting', '', 'NO_LIBPERL=1 NO_LIBPYTHON=1',d)}"
 TUI_DEFINES = "${@perf_feature_enabled('perf-tui', '', 'NO_NEWT=1',d)}"
+LIBUNWIND_DEFINES = "${@perf_feature_enabled('perf-libunwind', '', 'NO_LIBUNWIND=1',d)}"
 
 # The LDFLAGS is required or some old kernels fails due missing
 # symbols and this is preferred than requiring patches to every old
@@ -76,7 +79,7 @@ EXTRA_OEMAKE = '\
     CC="${CC}" \
     AR="${AR}" \
     perfexecdir=${libexecdir} \
-    NO_GTK2=1 ${TUI_DEFINES} NO_DWARF=1 NO_LIBUNWIND=1 ${SCRIPTING_DEFINES} \
+    NO_GTK2=1 ${TUI_DEFINES} NO_DWARF=1 ${LIBUNWIND_DEFINES} ${SCRIPTING_DEFINES} \
 '
 
 EXTRA_OEMAKE += "\
Signature · 1 line
1.9.1
author
#5 lore raw

ping

Quoted 57 lines · Chong Lu

Add a new feature named 'perf-libunwind'. Adding this support to perf allows it to do stack traces on ARM - thumb2 and MIPS targets. PERF_FEATURES variable in perf-features.inc will enable the perf-libunwind.

---
  meta/recipes-kernel/perf/perf-features.inc | 2 +-
  meta/recipes-kernel/perf/perf.bb           | 5 ++++-
  2 files changed, 5 insertions(+), 2 deletions(-)
meta/recipes-kernel/perf/perf-features.inc +1 -1
index b8859ab..2dbbb47 100644
@@ -1,4 +1,4 @@
-PERF_FEATURES_ENABLE ?= "perf-scripting perf-tui"
+PERF_FEATURES_ENABLE ?= "perf-scripting perf-tui perf-libunwind"
 
  def perf_feature_enabled(feature, trueval, falseval, d):
      """
meta/recipes-kernel/perf/perf.bb +4 -1
index bfd210c..ab94a05 100644
@@ -20,6 +20,7 @@ BUILDPERF_libc-uclibc = "no"
  # to cover a wide range of kernel we add both dependencies
  TUI_DEPENDS = "${@perf_feature_enabled('perf-tui', 'libnewt slang', '',d)}"
  SCRIPTING_DEPENDS = "${@perf_feature_enabled('perf-scripting', 'perl python', '',d)}"
+LIBUNWIND_DEPENDS = "${@perf_feature_enabled('perf-libunwind', 'libunwind', '',d)}"
 
  DEPENDS = "virtual/kernel \
      virtual/${MLPREFIX}libc \
@@ -27,6 +28,7 @@ DEPENDS = "virtual/kernel \
      ${MLPREFIX}binutils \
      ${TUI_DEPENDS} \
      ${SCRIPTING_DEPENDS} \
+    ${LIBUNWIND_DEPENDS} \
      bison flex \
  "
 
@@ -62,6 +64,7 @@ B = "${WORKDIR}/${BPN}-${PV}"
 
  SCRIPTING_DEFINES = "${@perf_feature_enabled('perf-scripting', '', 'NO_LIBPERL=1 NO_LIBPYTHON=1',d)}"
  TUI_DEFINES = "${@perf_feature_enabled('perf-tui', '', 'NO_NEWT=1',d)}"
+LIBUNWIND_DEFINES = "${@perf_feature_enabled('perf-libunwind', '', 'NO_LIBUNWIND=1',d)}"
 
  # The LDFLAGS is required or some old kernels fails due missing
  # symbols and this is preferred than requiring patches to every old
@@ -76,7 +79,7 @@ EXTRA_OEMAKE = '\
      CC="${CC}" \
      AR="${AR}" \
      perfexecdir=${libexecdir} \
-    NO_GTK2=1 ${TUI_DEFINES} NO_DWARF=1 NO_LIBUNWIND=1 ${SCRIPTING_DEFINES} \
+    NO_GTK2=1 ${TUI_DEFINES} NO_DWARF=1 ${LIBUNWIND_DEFINES} ${SCRIPTING_DEFINES} \
  '
 
  EXTRA_OEMAKE += "\