Skip to contentSkip to conversation

perf-scripting/perf-tui features, v3

PATCH Applied [email protected] 3 participants 6 messages Jul 9, 2012 – Jul 10, 2012

lore
Share & tools
lore
#0 lore raw

cover perf-scripting/perf-tui features, v3

From: Tom Zanussi <[email protected]>

This patchset enables the Perl and Python bindings for perf, as well as the perf TUI (text-based UI).

These are now turned on by default via a new variable, PERF_FEATURES_ENABLE, which can be overridden if the default set of perf features aren't desired (perf-scripting and perf-tui).

Because perf isn't normally enabled except in sdk builds, which contains most of the additional packages that these features drag in anyway e.g. Python and Perl, it shouldn't be too bothersome to unconidtionally turn the perf features on if perf itself is enabled. Future work will probably allow these features to be disabled individually using PACKAGECONFIG for example.

These changes need corresponding changes made to linux-yocto and posted separately on the yocto and linux-yocto mailing lists.

This patchset depends on the associated kernel changes posted along with the original patchset:

http://www.mail-archive.com/[email protected]/msg07279.html
http://www.mail-archive.com/[email protected]/msg07286.html

Bruce Ashfield submitted a SRCREV update for the 3.4 kernel today that you'll also need to build this.

I just started testing this, it works so far, but thought I'd put it out there now in case there were comments before putting too much effort into that, and possibly giving other people a chance to try it out.

This patchset has been build-tested on the following machines:

qemuarm

The following changes since commit 5051e9837fa698e03d0a7a8a918ee7aa98409ce1:
Robert P. J. Day (1):
bitbake: usermanual: Fix missing markup

are available in the git repository at:

git://git.yoctoproject.org/poky-contrib.git tzanussi/perf-scripting-v3
http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=tzanussi/perf-scripting-v3

Tom Zanussi (3):
perf: add perf.inc
perf: add perf-scripting feature
perf: add perf-tui feature

 meta/recipes-kernel/perf/perf.inc    |   22 ++++++++++++++++++++++
 meta/recipes-kernel/perf/perf_3.4.bb |   18 +++++++++++++++---
 2 files changed, 37 insertions(+), 3 deletions(-)
 create mode 100644 meta/recipes-kernel/perf/perf.inc
#1 lore raw

PATCH 1/3 perf: add perf.inc

From: Tom Zanussi <[email protected]>

Add a perf.inc to contain utility functions and definitions and to avoid cluttering up the main recipe.

---
 meta/recipes-kernel/perf/perf.inc    |   22 ++++++++++++++++++++++
 meta/recipes-kernel/perf/perf_3.4.bb |    2 ++
 2 files changed, 24 insertions(+), 0 deletions(-)
 create mode 100644 meta/recipes-kernel/perf/perf.inc
meta/recipes-kernel/perf/perf.inc new file +22 -0
new file mode 100644
index 0000000..d112751
@@ -0,0 +1,22 @@
+PERF_FEATURES_ENABLE ?= "perf-scripting perf-tui"
+
+def perf_feature_enabled(feature, trueval, falseval, d):
+    """
+    Check which perf features are enabled.
+
+    The PERF_FEATURES_ENABLE variable lists the perf features to
+    enable.  Override it if you want something different from what's
+    listed above, which is the default.  If empty, the build won't
+    enable any features (which may be exactly what you want, just a
+    barebones perf without any extra baggage, what you get if you
+    specify an empty feature list).
+
+    Available perf features:
+      perf-scripting: enable support for Perl and Python bindings
+      perf-tui: enable support for the perf TUI (via libnewt)
+
+    """
+    enabled_features = d.getVar("PERF_FEATURES_ENABLE", True) or ""
+    if feature in enabled_features:
+		return trueval
+    return falseval
meta/recipes-kernel/perf/perf_3.4.bb +2 -0
index 381332e..d494243 100644
@@ -11,6 +11,8 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
 
 PR = "r1"
 
+require perf.inc
+
 BUILDPERF_libc-uclibc = "no"
 
 DEPENDS = "virtual/kernel \
Signature · 1 line
1.7.0.4
#2 lore raw

PATCH 2/3 perf: add perf-scripting feature

From: Tom Zanussi <[email protected]>

Add a new feature named 'perf-scripting'. Adding this into the PERF_FEATURES variable in perf.inc will enable perf scripting on a target, which will turn on all the language bindings currently available in perf (Perl and Python), if perf is included in an image.

If 'perf-scripting' isn't named as a feature (the default), all perf language bindings will be disabled and unavailable.

---
 meta/recipes-kernel/perf/perf_3.4.bb |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
meta/recipes-kernel/perf/perf_3.4.bb +9 -3
index d494243..e96552c 100644
@@ -9,7 +9,7 @@ as well."
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
 
-PR = "r1"
+PR = "r2"
 
 require perf.inc
 
@@ -21,7 +21,8 @@ DEPENDS = "virtual/kernel \
            ${MLPREFIX}binutils \
           "
 
-RDEPENDS_${PN} += "elfutils perl perl-modules python"
+SCRIPTING_RDEPENDS = "${@perf_feature_enabled('perf-scripting', 'perl perl-modules python', '',d)}"
+RDEPENDS_${PN} += "elfutils ${SCRIPTING_RDEPENDS}"
 
 PROVIDES = "virtual/perf"
 
@@ -45,6 +46,8 @@ export PERL_ARCHLIB = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/${@get_perl_version
 S = "${STAGING_KERNEL_DIR}"
 B = "${WORKDIR}/${BPN}-${PV}"
 
+SCRIPTING_DEFINES = "${@perf_feature_enabled('perf-scripting', '', 'NO_LIBPERL=1 NO_LIBPYTHON=1',d)}"
+
 EXTRA_OEMAKE = \
 		'-C ${S}/tools/perf \
 		O=${B} \
@@ -53,7 +56,7 @@ EXTRA_OEMAKE = \
 		CC="${CC}" \
 		AR="${AR}" \
 		prefix=/usr \
-		NO_GTK2=1 NO_NEWT=1 NO_DWARF=1 \
+		NO_GTK2=1 NO_NEWT=1 NO_DWARF=1 ${SCRIPTING_DEFINES} \
 		'
 
 do_compile() {
@@ -62,6 +65,9 @@ do_compile() {
 
 do_install() {
 	oe_runmake DESTDIR=${D} install
+	if [ "${@perf_feature_enabled('perf-scripting', 1, 0, d)}" = "1" ]; then
+		oe_runmake DESTDIR=${D} install-python_ext
+	fi
 }
 
 PACKAGE_ARCH = "${MACHINE_ARCH}"
Signature · 1 line
1.7.0.4
#3 lore raw

PATCH 3/3 perf: add perf-tui feature

In reply to [email protected]

From: Tom Zanussi <[email protected]>

Add a new feature named 'perf-tui'. Adding this into the PERF_FEATURES variable in perf.inc will enable the perf TUI (Text-base UI) user interface on a target, which adds libnewt and turns on the perf text UI options in perf, if perf is included in an image.

If 'perf-tui' isn't named as a feature (the default), the perf TUI will be disabled and unavailable.

---
 meta/recipes-kernel/perf/perf_3.4.bb |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
meta/recipes-kernel/perf/perf_3.4.bb +6 -2
index e96552c..ccb7425 100644
@@ -9,16 +9,19 @@ as well."
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
 
-PR = "r2"
+PR = "r3"
 
 require perf.inc
 
 BUILDPERF_libc-uclibc = "no"
 
+TUI_DEPENDS = "${@perf_feature_enabled('perf-tui', 'libnewt', '',d)}"
+
 DEPENDS = "virtual/kernel \
            virtual/${MLPREFIX}libc \
            ${MLPREFIX}elfutils \
            ${MLPREFIX}binutils \
+           ${TUI_DEPENDS} \
           "
 
 SCRIPTING_RDEPENDS = "${@perf_feature_enabled('perf-scripting', 'perl perl-modules python', '',d)}"
@@ -47,6 +50,7 @@ S = "${STAGING_KERNEL_DIR}"
 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)}"
 
 EXTRA_OEMAKE = \
 		'-C ${S}/tools/perf \
@@ -56,7 +60,7 @@ EXTRA_OEMAKE = \
 		CC="${CC}" \
 		AR="${AR}" \
 		prefix=/usr \
-		NO_GTK2=1 NO_NEWT=1 NO_DWARF=1 ${SCRIPTING_DEFINES} \
+		NO_GTK2=1 ${TUI_DEFINES} NO_DWARF=1 ${SCRIPTING_DEFINES} \
 		'
 
 do_compile() {
Signature · 1 line
1.7.0.4
#4 lore raw
In reply to [email protected]
Quoted 43 lines · On Mon, 2012-07-09 at 12:07 -0500, [email protected] wrote:

From: Tom Zanussi <[email protected]>

This patchset enables the Perl and Python bindings for perf, as well as the perf TUI (text-based UI).

These are now turned on by default via a new variable, PERF_FEATURES_ENABLE, which can be overridden if the default set of perf features aren't desired (perf-scripting and perf-tui).

Because perf isn't normally enabled except in sdk builds, which contains most of the additional packages that these features drag in anyway e.g. Python and Perl, it shouldn't be too bothersome to unconidtionally turn the perf features on if perf itself is enabled. Future work will probably allow these features to be disabled individually using PACKAGECONFIG for example.

These changes need corresponding changes made to linux-yocto and posted separately on the yocto and linux-yocto mailing lists.

This patchset depends on the associated kernel changes posted along with the original patchset:

http://www.mail-archive.com/[email protected]/msg07279.html
http://www.mail-archive.com/[email protected]/msg07286.html

Bruce Ashfield submitted a SRCREV update for the 3.4 kernel today that you'll also need to build this.

I just started testing this, it works so far, but thought I'd put it out there now in case there were comments before putting too much effort into that, and possibly giving other people a chance to try it out.

This patchset has been build-tested on the following machines:

qemuarm

The following changes since commit 5051e9837fa698e03d0a7a8a918ee7aa98409ce1:
Robert P. J. Day (1):
bitbake: usermanual: Fix missing markup

are available in the git repository at:

Quoted 7 lines

git://git.yoctoproject.org/poky-contrib.git tzanussi/perf-scripting-v3
http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=tzanussi/perf-scripting-v3

Tom Zanussi (3):
perf: add perf.inc
perf: add perf-scripting feature
perf: add perf-tui feature

Merged to master, thanks.

Richard

Applied
#5 lore raw
In reply to [email protected]
Quoted 51 lines · On 07/09/2012 10:07 AM, [email protected] wrote:

From: Tom Zanussi <[email protected]>

This patchset enables the Perl and Python bindings for perf, as well as the perf TUI (text-based UI).

These are now turned on by default via a new variable, PERF_FEATURES_ENABLE, which can be overridden if the default set of perf features aren't desired (perf-scripting and perf-tui).

Because perf isn't normally enabled except in sdk builds, which contains most of the additional packages that these features drag in anyway e.g. Python and Perl, it shouldn't be too bothersome to unconidtionally turn the perf features on if perf itself is enabled. Future work will probably allow these features to be disabled individually using PACKAGECONFIG for example.

These changes need corresponding changes made to linux-yocto and posted separately on the yocto and linux-yocto mailing lists.

This patchset depends on the associated kernel changes posted along with the original patchset:

http://www.mail-archive.com/[email protected]/msg07279.html
http://www.mail-archive.com/[email protected]/msg07286.html

Bruce Ashfield submitted a SRCREV update for the 3.4 kernel today that you'll also need to build this.

I just started testing this, it works so far, but thought I'd put it out there now in case there were comments before putting too much effort into that, and possibly giving other people a chance to try it out.

This patchset has been build-tested on the following machines:

qemuarm

The following changes since commit 5051e9837fa698e03d0a7a8a918ee7aa98409ce1:
Robert P. J. Day (1):
bitbake: usermanual: Fix missing markup

are available in the git repository at:

git://git.yoctoproject.org/poky-contrib.git tzanussi/perf-scripting-v3
http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=tzanussi/perf-scripting-v3

Tom Zanussi (3):
perf: add perf.inc
perf: add perf-scripting feature
perf: add perf-tui feature

Quoted 6 lines
  meta/recipes-kernel/perf/perf.inc    |   22 ++++++++++++++++++++++
  meta/recipes-kernel/perf/perf_3.4.bb |   18 +++++++++++++++---
  2 files changed, 37 insertions(+), 3 deletions(-)

create mode 100644 meta/recipes-kernel/perf/perf.inc

Merged into OE-Core