* [Buildroot] [PATCH 2/7] package/perf: if numactl (libnuma) is enabled, depend on it
2015-03-18 21:42 [Buildroot] [PATCH 1/7] package/perf: if slang is enabled, depend on it Steven Noonan
@ 2015-03-18 21:42 ` Steven Noonan
2015-03-18 21:42 ` [Buildroot] [PATCH 3/7] package/perf: if libunwind " Steven Noonan
` (5 subsequent siblings)
6 siblings, 0 replies; 12+ messages in thread
From: Steven Noonan @ 2015-03-18 21:42 UTC (permalink / raw)
To: buildroot
Signed-off-by: Steven Noonan <steven@uplinklabs.net>
---
package/perf/perf.mk | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/package/perf/perf.mk b/package/perf/perf.mk
index 2b0702c..6b74b00 100644
--- a/package/perf/perf.mk
+++ b/package/perf/perf.mk
@@ -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
--
2.3.3
^ permalink raw reply related [flat|nested] 12+ messages in thread* [Buildroot] [PATCH 3/7] package/perf: if libunwind is enabled, depend on it
2015-03-18 21:42 [Buildroot] [PATCH 1/7] package/perf: if slang is enabled, depend on it Steven Noonan
2015-03-18 21:42 ` [Buildroot] [PATCH 2/7] package/perf: if numactl (libnuma) " Steven Noonan
@ 2015-03-18 21:42 ` Steven Noonan
2015-03-18 21:43 ` [Buildroot] [PATCH 4/7] package/perf: build outside kernel tree Steven Noonan
` (4 subsequent siblings)
6 siblings, 0 replies; 12+ messages in thread
From: Steven Noonan @ 2015-03-18 21:42 UTC (permalink / raw)
To: buildroot
Signed-off-by: Steven Noonan <steven@uplinklabs.net>
---
package/perf/perf.mk | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/package/perf/perf.mk b/package/perf/perf.mk
index 6b74b00..f35abc9 100644
--- a/package/perf/perf.mk
+++ b/package/perf/perf.mk
@@ -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
--
2.3.3
^ permalink raw reply related [flat|nested] 12+ messages in thread* [Buildroot] [PATCH 4/7] package/perf: build outside kernel tree
2015-03-18 21:42 [Buildroot] [PATCH 1/7] package/perf: if slang is enabled, depend on it Steven Noonan
2015-03-18 21:42 ` [Buildroot] [PATCH 2/7] package/perf: if numactl (libnuma) " Steven Noonan
2015-03-18 21:42 ` [Buildroot] [PATCH 3/7] package/perf: if libunwind " Steven Noonan
@ 2015-03-18 21:43 ` Steven Noonan
2015-03-19 23:21 ` Arnout Vandecappelle
2015-03-18 21:43 ` [Buildroot] [PATCH 5/7] package/perf: patch installation paths Steven Noonan
` (3 subsequent siblings)
6 siblings, 1 reply; 12+ messages in thread
From: Steven Noonan @ 2015-03-18 21:43 UTC (permalink / raw)
To: buildroot
This is necessary for introducing patches.
Signed-off-by: Steven Noonan <steven@uplinklabs.net>
---
package/perf/perf.mk | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/package/perf/perf.mk b/package/perf/perf.mk
index f35abc9..68bb430 100644
--- a/package/perf/perf.mk
+++ b/package/perf/perf.mk
@@ -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
--
2.3.3
^ permalink raw reply related [flat|nested] 12+ messages in thread* [Buildroot] [PATCH 4/7] package/perf: build outside kernel tree
2015-03-18 21:43 ` [Buildroot] [PATCH 4/7] package/perf: build outside kernel tree Steven Noonan
@ 2015-03-19 23:21 ` Arnout Vandecappelle
2015-03-20 3:08 ` Steven Noonan
0 siblings, 1 reply; 12+ messages in thread
From: Arnout Vandecappelle @ 2015-03-19 23:21 UTC (permalink / raw)
To: buildroot
On 18/03/15 22:43, Steven Noonan wrote:
> 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
--
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
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Buildroot] [PATCH 4/7] package/perf: build outside kernel tree
2015-03-19 23:21 ` Arnout Vandecappelle
@ 2015-03-20 3:08 ` Steven Noonan
0 siblings, 0 replies; 12+ messages in thread
From: Steven Noonan @ 2015-03-20 3:08 UTC (permalink / raw)
To: buildroot
On Thu, Mar 19, 2015 at 4:21 PM, Arnout Vandecappelle <arnout@mind.be> wrote:
> On 18/03/15 22:43, Steven Noonan wrote:
>> 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.
Indeed.
> - 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.
>
> - It requires an expensive second extract of the entire kernel.
Expensive on what? Isn't everyone using SSDs these days? ;)
>
> 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.
I think this is probably the path to take, but I'm not entirely a fan of it.
> 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
>
> --
> 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
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Buildroot] [PATCH 5/7] package/perf: patch installation paths
2015-03-18 21:42 [Buildroot] [PATCH 1/7] package/perf: if slang is enabled, depend on it Steven Noonan
` (2 preceding siblings ...)
2015-03-18 21:43 ` [Buildroot] [PATCH 4/7] package/perf: build outside kernel tree Steven Noonan
@ 2015-03-18 21:43 ` Steven Noonan
2015-07-14 22:06 ` Romain Naour
2015-03-18 21:43 ` [Buildroot] [PATCH 6/7] package/perf: add patch to prevent crash on empty history buffer Steven Noonan
` (2 subsequent siblings)
6 siblings, 1 reply; 12+ messages in thread
From: Steven Noonan @ 2015-03-18 21:43 UTC (permalink / raw)
To: buildroot
Signed-off-by: Steven Noonan <steven@uplinklabs.net>
---
package/perf/0001-fix-install-paths.patch | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
create mode 100644 package/perf/0001-fix-install-paths.patch
diff --git a/package/perf/0001-fix-install-paths.patch b/package/perf/0001-fix-install-paths.patch
new file mode 100644
index 0000000..6046362
--- /dev/null
+++ b/package/perf/0001-fix-install-paths.patch
@@ -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
--
2.3.3
^ permalink raw reply related [flat|nested] 12+ messages in thread* [Buildroot] [PATCH 6/7] package/perf: add patch to prevent crash on empty history buffer
2015-03-18 21:42 [Buildroot] [PATCH 1/7] package/perf: if slang is enabled, depend on it Steven Noonan
` (3 preceding siblings ...)
2015-03-18 21:43 ` [Buildroot] [PATCH 5/7] package/perf: patch installation paths Steven Noonan
@ 2015-03-18 21:43 ` Steven Noonan
2015-03-18 21:43 ` [Buildroot] [PATCH 7/7] package/perf: use correct definition of ARCH on x86_64 Steven Noonan
2015-07-14 15:45 ` [Buildroot] [PATCH 1/7] package/perf: if slang is enabled, depend on it Romain Naour
6 siblings, 0 replies; 12+ messages in thread
From: Steven Noonan @ 2015-03-18 21:43 UTC (permalink / raw)
To: buildroot
Signed-off-by: Steven Noonan <steven@uplinklabs.net>
---
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
diff --git a/package/perf/0002-fix-crash-on-empty-buffer.patch b/package/perf/0002-fix-crash-on-empty-buffer.patch
new file mode 100644
index 0000000..b8383cf
--- /dev/null
+++ b/package/perf/0002-fix-crash-on-empty-buffer.patch
@@ -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;
--
2.3.3
^ permalink raw reply related [flat|nested] 12+ messages in thread* [Buildroot] [PATCH 7/7] package/perf: use correct definition of ARCH on x86_64
2015-03-18 21:42 [Buildroot] [PATCH 1/7] package/perf: if slang is enabled, depend on it Steven Noonan
` (4 preceding siblings ...)
2015-03-18 21:43 ` [Buildroot] [PATCH 6/7] package/perf: add patch to prevent crash on empty history buffer Steven Noonan
@ 2015-03-18 21:43 ` Steven Noonan
2015-07-14 15:45 ` [Buildroot] [PATCH 1/7] package/perf: if slang is enabled, depend on it Romain Naour
6 siblings, 0 replies; 12+ messages in thread
From: Steven Noonan @ 2015-03-18 21:43 UTC (permalink / raw)
To: buildroot
LINUX_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.
Signed-off-by: Steven Noonan <steven@uplinklabs.net>
---
package/perf/perf.mk | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/package/perf/perf.mk b/package/perf/perf.mk
index 68bb430..3cc6a04 100644
--- a/package/perf/perf.mk
+++ b/package/perf/perf.mk
@@ -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 \
--
2.3.3
^ permalink raw reply related [flat|nested] 12+ messages in thread* [Buildroot] [PATCH 1/7] package/perf: if slang is enabled, depend on it
2015-03-18 21:42 [Buildroot] [PATCH 1/7] package/perf: if slang is enabled, depend on it Steven Noonan
` (5 preceding siblings ...)
2015-03-18 21:43 ` [Buildroot] [PATCH 7/7] package/perf: use correct definition of ARCH on x86_64 Steven Noonan
@ 2015-07-14 15:45 ` Romain Naour
2015-07-14 17:00 ` Romain Naour
6 siblings, 1 reply; 12+ messages in thread
From: Romain Naour @ 2015-07-14 15:45 UTC (permalink / raw)
To: buildroot
Hi Steven,
Le 18/03/2015 22:42, Steven Noonan a ?crit :
> Signed-off-by: Steven Noonan <steven@uplinklabs.net>
> ---
> package/perf/perf.mk | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/package/perf/perf.mk b/package/perf/perf.mk
> index f6591a6..2b0702c 100644
> --- a/package/perf/perf.mk
> +++ b/package/perf/perf.mk
> @@ -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
> ifeq ($(BR2_PACKAGE_ELFUTILS),y)
> PERF_DEPENDENCIES += elfutils
> else
>
^ permalink raw reply [flat|nested] 12+ messages in thread* [Buildroot] [PATCH 1/7] package/perf: if slang is enabled, depend on it
2015-07-14 15:45 ` [Buildroot] [PATCH 1/7] package/perf: if slang is enabled, depend on it Romain Naour
@ 2015-07-14 17:00 ` Romain Naour
0 siblings, 0 replies; 12+ messages in thread
From: Romain Naour @ 2015-07-14 17:00 UTC (permalink / raw)
To: buildroot
Le 14/07/2015 17:45, Romain Naour a ?crit :
> Hi Steven,
>
> Le 18/03/2015 22:42, Steven Noonan a ?crit :
>> Signed-off-by: Steven Noonan <steven@uplinklabs.net>
>> ---
>> package/perf/perf.mk | 4 ++++
>> 1 file changed, 4 insertions(+)
>>
>> diff --git a/package/perf/perf.mk b/package/perf/perf.mk
>> index f6591a6..2b0702c 100644
>> --- a/package/perf/perf.mk
>> +++ b/package/perf/perf.mk
>> @@ -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
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.
>
> So, you need to enable newt before.
>
> Can you rework this patch and resubmit ?
>
> Best regards,
> Romain Naour
>
>> ifeq ($(BR2_PACKAGE_ELFUTILS),y)
>> PERF_DEPENDENCIES += elfutils
>> else
>>
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
>
^ permalink raw reply [flat|nested] 12+ messages in thread