package/perf: if slang is enabled, depend on it
PATCH 1/7 package/perf: if slang is enabled, depend on it
--- package/perf/perf.mk | 4 ++++ 1 file changed, 4 insertions(+)
package/perf/perf.mk +4 -0
@@ -34,6 +34,10 @@ ifeq ($(BR2_arc),y) PERF_MAKE_FLAGS += NO_BACKTRACE=1 endif +ifeq ($(BR2_PACKAGE_SLANG),y) + PERF_DEPENDENCIES += slang +endif + ifeq ($(BR2_PACKAGE_ELFUTILS),y) PERF_DEPENDENCIES += elfutils else
Signature · 1 line
2.3.3
PATCH 2/7 package/perf: if numactl (libnuma) is enabled, depend on it
--- package/perf/perf.mk | 4 ++++ 1 file changed, 4 insertions(+)
package/perf/perf.mk +4 -0
@@ -34,6 +34,10 @@ ifeq ($(BR2_arc),y) PERF_MAKE_FLAGS += NO_BACKTRACE=1 endif +ifeq ($(BR2_PACKAGE_NUMACTL),y) + PERF_DEPENDENCIES += numactl +endif + ifeq ($(BR2_PACKAGE_SLANG),y) PERF_DEPENDENCIES += slang endif
Signature · 1 line
2.3.3
PATCH 3/7 package/perf: if libunwind is enabled, depend on it
In reply to Steven Noonan--- package/perf/perf.mk | 4 ++++ 1 file changed, 4 insertions(+)
package/perf/perf.mk +4 -0
@@ -34,6 +34,10 @@ ifeq ($(BR2_arc),y) PERF_MAKE_FLAGS += NO_BACKTRACE=1 endif +ifeq ($(BR2_PACKAGE_LIBUNWIND),y) + PERF_DEPENDENCIES += libunwind +endif + ifeq ($(BR2_PACKAGE_NUMACTL),y) PERF_DEPENDENCIES += numactl endif
Signature · 1 line
2.3.3
PATCH 4/7 package/perf: build outside kernel tree
In reply to Steven NoonanThis is necessary for introducing patches.
--- package/perf/perf.mk | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
package/perf/perf.mk +9 -9
@@ -5,10 +5,10 @@ ################################################################################ # Source taken from the Linux kernel tree -PERF_SOURCE = PERF_VERSION = $(call qstrip,$(BR2_LINUX_KERNEL_VERSION)) +PERF_SOURCE = linux-$(PERF_VERSION).tar.xz -PERF_DEPENDENCIES = linux host-flex host-bison +PERF_DEPENDENCIES = host-flex host-bison PERF_MAKE_FLAGS = \ $(LINUX_MAKE_FLAGS) \
@@ -53,29 +53,29 @@ else endif define PERF_BUILD_CMDS - $(Q)if test ! -f $(LINUX_DIR)/tools/perf/Makefile ; then \ + $(Q)if test ! -f $(@D)/tools/perf/Makefile ; then \ echo "Your kernel version is too old and does not have the perf tool." ; \ echo "At least kernel 2.6.31 must be used." ; \ exit 1 ; \ fi $(Q)if test "$(BR2_PACKAGE_ELFUTILS)" = "" ; then \ - if ! grep -q NO_LIBELF $(LINUX_DIR)/tools/perf/Makefile* ; then \ - if ! test -r $(LINUX_DIR)/tools/perf/config/Makefile ; then \ + if ! grep -q NO_LIBELF $(@D)/tools/perf/Makefile* ; then \ + if ! test -r $(@D)/tools/perf/config/Makefile ; then \ echo "The perf tool in your kernel cannot be built without libelf." ; \ echo "Either upgrade your kernel to >= 3.7, or enable the elfutils package." ; \ exit 1 ; \ fi \ fi \ fi - $(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools/perf \ - $(PERF_MAKE_FLAGS) O=$(@D) + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/tools/perf \ + $(PERF_MAKE_FLAGS) endef # After installation, we remove the Perl and Python scripts from the # target. define PERF_INSTALL_TARGET_CMDS - $(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools/perf \ - $(PERF_MAKE_FLAGS) O=$(@D) install + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/tools/perf \ + $(PERF_MAKE_FLAGS) install $(RM) -rf $(TARGET_DIR)/usr/libexec/perf-core/scripts/ endef
Signature · 1 line
2.3.3
PATCH 4/7 package/perf: build outside kernel tree
Quoted 1 line · Steven Noonan
This is necessary for introducing patches.
Although I think it's really messy to build perf within the the linux source
like we do now, your proposed approach has some showstopper drawbacks.
- It doesn't work for LINUX_OVERRIDE_SRCDIR or BR2_LINUX_KERNEL_CUSTOM_LOCAL.
- Any custom patches to the kernel are not taken into account, and I believe perf uses the private headers so there's a risk there.
- It requires an expensive second extract of the entire kernel.
As an alternative, you could copy in just the perf stuff from the linux source
as a POST_EXTRACT_HOOK.
Or you could apply the patches on the kernel sources instead of on the perf
directory. But that would be a bit more complicated.
Or you could add a LINUX_POST_PATCH_HOOK to apply the perf patches. I'm not
entirely sure if that would work though.
Regards,
Arnout
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286500 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
PATCH 4/7 package/perf: build outside kernel tree
Quoted 7 lines · Arnout Vandecappelle
Quoted 1 line · Steven Noonan
This is necessary for introducing patches.
Although I think it's really messy to build perf within the the linux source
like we do now, your proposed approach has some showstopper drawbacks.- It doesn't work for
LINUX_OVERRIDE_SRCDIRorBR2_LINUX_KERNEL_CUSTOM_LOCAL.
Indeed.
Quoted 2 lines
- Any custom patches to the kernel are not taken into account, and I believe perf uses the private headers so there's a risk there.
Quite possibly so.
Quoted 2 lines
- It requires an expensive second extract of the entire kernel.
Expensive on what? Isn't everyone using SSDs these days? ;)
Quoted 6 lines
As an alternative, you could copy in just the perf stuff from the linux source
as aPOST_EXTRACT_HOOK.Or you could apply the patches on the kernel sources instead of on the perf
directory. But that would be a bit more complicated.
I think this is probably the path to take, but I'm not entirely a fan of it.
Quoted 14 lines
Or you could add a
LINUX_POST_PATCH_HOOKto apply the perf patches. I'm not
entirely sure if that would work though.Regards,
Arnout--
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286500 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
PATCH 5/7 package/perf: patch installation paths
In reply to Steven Noonan--- package/perf/0001-fix-install-paths.patch | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 package/perf/0001-fix-install-paths.patch
package/perf/0001-fix-install-paths.patch new file +20 -0
@@ -0,0 +1,20 @@ +--- a/tools/perf/config/Makefile 2014-02-13 23:00:14.000000000 +0100 ++++ b/tools/perf/config/Makefile 2014-02-17 20:01:33.370539725 +0100 +@@ -561,7 +561,7 @@ + bindir = $(prefix)/$(bindir_relative) + mandir = share/man + infodir = share/info +-perfexecdir = libexec/perf-core ++perfexecdir = lib/perf + sharedir = $(prefix)/share + template_dir = share/perf-core/templates + htmldir = share/doc/perf-doc +@@ -573,7 +573,7 @@ + ETC_PERFCONFIG = etc/perfconfig + endif + ifeq ($(IS_X86_64),1) +-lib = lib64 ++lib = lib + else + lib = lib + endif
Signature · 1 line
2.3.3
PATCH 5/7 package/perf: patch installation paths
Hi Steven,
Le 18/03/2015 22:43, Steven Noonan a ?crit :
package/perf/0001-fix-install-paths.patch
Quoted 7 lines
Signed-off-by Steven Noonan <[email protected]>--- package/perf/0001-fix-install-paths.patch | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 package/perf/0001-fix-install-paths.patchpackage/perf/0001-fix-install-paths.patch +0
-0
I added your series in my Linux tools series, so your series will be marked as superseded in patchwork.
However patches 5/7 and 6/7 are not necessary anymore, they now belong to your custom linux patches. See BR2_LINUX_KERNEL_PATCH in [1].
They will marked rejected in patchwork.
[1] http://buildroot.org/downloads/manual/manual.html#customize-patches
Thanks !
Best regards,
Romain Naour
PATCH 6/7 package/perf: add patch to prevent crash on empty history buffer
In reply to Steven Noonan--- package/perf/0002-fix-crash-on-empty-buffer.patch | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 package/perf/0002-fix-crash-on-empty-buffer.patch
package/perf/0002-fix-crash-on-empty-buffer.patch new file +11 -0
@@ -0,0 +1,11 @@ +--- a/tools/perf/ui/browsers/hists.c ++++ b/tools/perf/ui/browsers/hists.c +@@ -1059,7 +1059,7 @@ do_offset: + } + first = false; + } +- } else { ++ } else if (nd) { + browser->top = nd; + h = rb_entry(nd, struct hist_entry, rb_node); + h->row_offset = 0;
Signature · 1 line
2.3.3
PATCH 7/7 package/perf: use correct definition of ARCH on x86_64
In reply to Steven NoonanLINUX_MAKE_FLAGS defines ARCH=$(KERNEL_ARCH), and KERNEL_ARCH is x86_64 on a 64-bit x86 kernel build. The perf Makefiles expect that the ARCH will be "x86" on both 32-bit x86 and 64-bit x86.
I didn't experience issues with the Linux 3.14.x version of perf, but this issue cropped up once I started building 3.19.x.
--- package/perf/perf.mk | 6 ++++++ 1 file changed, 6 insertions(+)
package/perf/perf.mk +6 -0
@@ -10,8 +10,14 @@ PERF_SOURCE = linux-$(PERF_VERSION).tar.xz PERF_DEPENDENCIES = host-flex host-bison +PERF_ARCH=$(KERNEL_ARCH) +ifeq ($(KERNEL_ARCH),x86_64) +PERF_ARCH=x86 +endif + PERF_MAKE_FLAGS = \ $(LINUX_MAKE_FLAGS) \ + ARCH=$(PERF_ARCH) \ NO_LIBAUDIT=1 \ NO_NEWT=1 \ NO_GTK2=1 \
Signature · 1 line
2.3.3
PATCH 1/7 package/perf: if slang is enabled, depend on it
In reply to Steven NoonanHi Steven,
Le 18/03/2015 22:42, Steven Noonan a ?crit :
Quoted 10 lines
Signed-off-by Steven Noonan <[email protected]>--- package/perf/perf.mk | 4 ++++ 1 file changed, 4 insertions(+)package/perf/perf.mk +0
-0
package/perf/perf.mk ifeq ($(BR2_arc),y) · line 40
Quoted 7 lines
package/perf/perf.mk +4
-0@@ -34,6 +34,10 @@ ifeq ($(BR2_arc),y) PERF_MAKE_FLAGS += NO_BACKTRACE=1 endif +ifeq ($(BR2_PACKAGE_SLANG),y) + PERF_DEPENDENCIES += slang +endif +
The slang support can't be enabled simply by adding the slang package dependency, because newt support is disabled in PERF_MAKE_FLAGS:
PERF_MAKE_FLAGS = NO_NEWT=1
In tools/perl/config/Makefile, the slang support is disabled here (kernel 4.2-rc2):
ifdef NO_NEWT
NO_SLANG=1
endif
So, you need to enable newt before.
Can you rework this patch and resubmit ?
Best regards,
Romain Naour
Quoted 4 lines
package/perf/perf.mk +0
-0ifeq ($(BR2_PACKAGE_ELFUTILS),y) PERF_DEPENDENCIES += elfutils else
PATCH 1/7 package/perf: if slang is enabled, depend on it
Le 14/07/2015 17:45, Romain Naour a ?crit :
Quoted 24 lines
Hi Steven,
Le 18/03/2015 22:42, Steven Noonan a ?crit :
Quoted 10 lines
Signed-off-by Steven Noonan <[email protected]>--- package/perf/perf.mk | 4 ++++ 1 file changed, 4 insertions(+)package/perf/perf.mk +0
-0package/perf/perf.mk ifeq ($(BR2_arc),y) · line 40
Quoted 7 lines
package/perf/perf.mk +4
-0@@ -34,6 +34,10 @@ ifeq ($(BR2_arc),y) PERF_MAKE_FLAGS += NO_BACKTRACE=1 endif +ifeq ($(BR2_PACKAGE_SLANG),y) + PERF_DEPENDENCIES += slang +endif +The slang support can't be enabled simply by adding the slang package dependency, because newt support is disabled in
PERF_MAKE_FLAGS:
Quoted 7 lines
PERF_MAKE_FLAGS= NO_NEWT=1In
tools/perl/config/Makefile, the slang support is disabled here (kernel 4.2-rc2):ifdef
NO_NEWT
NO_SLANG=1
endif
It turn out, that NO_NEWT=1 in PERF_MAKE_FLAGS doesn't drive the Perf configuration...
It seems that slang and libunwind depends on eflutils package... but the dependency issue can be fixed in a followup patch.
In think, we can merge your patches as is except patches 5/7 and 6/7.
I'll post a new series with your patches in it.
Best regards,
Romain Naour.
Quoted 18 lines
So, you need to enable newt before.
Can you rework this patch and resubmit ?
Best regards,
Romain Naourpackage/perf/perf.mk ifeq ($(BR2_arc),y) · line 43
Quoted 4 lines
package/perf/perf.mk +0
-0ifeq ($(BR2_PACKAGE_ELFUTILS),y) PERF_DEPENDENCIES += elfutils else_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot