diff mbox

[OpenWrt-Devel] package/devel/perf: fix build for kernel 4.1

Message ID 1444914092-29029-1-git-send-email-ardeleanalex@gmail.com
State Superseded
Headers show

Commit Message

Alexandru Ardelean Oct. 15, 2015, 1:01 p.m. UTC
This fix contains 2 parts:
 - kernel 4.1: backport upstream patch "perf build: Do not fail on missing Build file"
 - add +liblzma dependency

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
---
 package/devel/perf/Makefile                        |  2 +-
 ...f-build-Do-not-fail-on-missing-Build-file.patch | 67 ++++++++++++++++++++++
 2 files changed, 68 insertions(+), 1 deletion(-)
 create mode 100644 target/linux/generic/patches-4.1/222-perf-build-Do-not-fail-on-missing-Build-file.patch

Comments

John Crispin Oct. 21, 2015, 6:03 p.m. UTC | #1
On 15/10/2015 15:01, Alexandru Ardelean wrote:
> This fix contains 2 parts:
>  - kernel 4.1: backport upstream patch "perf build: Do not fail on missing Build file"
>  - add +liblzma dependency
> 

did you find out why there is suddenly a dependency on lzma ?

	John

> Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
John Crispin Oct. 26, 2015, 10:13 a.m. UTC | #2
On 21/10/2015 20:03, John Crispin wrote:
> 
> 
> On 15/10/2015 15:01, Alexandru Ardelean wrote:
>> This fix contains 2 parts:
>>  - kernel 4.1: backport upstream patch "perf build: Do not fail on missing Build file"
>>  - add +liblzma dependency
>>
> 
> did you find out why there is suddenly a dependency on lzma ?
> 
> 	John


ping ...
Alexandru Ardelean Oct. 26, 2015, 10:52 a.m. UTC | #3
Ah, sorry about this.
I forgot about it ; completely swamped.

Will add it in my desktop notes that I keep and come back with an answer
asap (hopefully today/tomorrow).


On Mon, Oct 26, 2015 at 12:13 PM, John Crispin <blogic@openwrt.org> wrote:

>
>
> On 21/10/2015 20:03, John Crispin wrote:
> >
> >
> > On 15/10/2015 15:01, Alexandru Ardelean wrote:
> >> This fix contains 2 parts:
> >>  - kernel 4.1: backport upstream patch "perf build: Do not fail on
> missing Build file"
> >>  - add +liblzma dependency
> >>
> >
> > did you find out why there is suddenly a dependency on lzma ?
> >
> >       John
>
>
> ping ...
>
John Crispin Oct. 26, 2015, 10:58 a.m. UTC | #4
thanks ! the patch looks good but i am failing to understand why the
lzma needs to be added :)

On 26/10/2015 11:52, Alexandru Ardelean wrote:
> Ah, sorry about this.
> I forgot about it ; completely swamped.
> 
> Will add it in my desktop notes that I keep and come back with an answer
> asap (hopefully today/tomorrow).
> 
> 
> On Mon, Oct 26, 2015 at 12:13 PM, John Crispin <blogic@openwrt.org
> <mailto:blogic@openwrt.org>> wrote:
> 
> 
> 
>     On 21/10/2015 20:03, John Crispin wrote:
>     >
>     >
>     > On 15/10/2015 15:01, Alexandru Ardelean wrote:
>     >> This fix contains 2 parts:
>     >>  - kernel 4.1: backport upstream patch "perf build: Do not fail on missing Build file"
>     >>  - add +liblzma dependency
>     >>
>     >
>     > did you find out why there is suddenly a dependency on lzma ?
>     >
>     >       John
> 
> 
>     ping ...
> 
>
Alexandru Ardelean Oct. 26, 2015, 11:48 a.m. UTC | #5
Looks like it did not take much to actually come back with an answer.
So,

In file:
https://github.com/torvalds/linux/blob/v4.1/tools/perf/Makefile.perf
Line 75:   # Define NO_LZMA if you do not want to support compressed (xz)
kernel modules

Then file:
https://github.com/torvalds/linux/blob/v4.1/tools/perf/config/Makefile
Lines 544-553:

ifndef NO_LZMA
  ifeq ($(feature-lzma), 1)
    CFLAGS += -DHAVE_LZMA_SUPPORT
    EXTLIBS += -llzma
    $(call detected,CONFIG_LZMA)
  else
    msg := $(warning No liblzma found, disables xz kernel module
decompression, please install xz-devel/liblzma-dev);
    NO_LZMA := 1
  endif
endif

In my case it seems to enable by default.

Looking at the same files in 3.18:
https://github.com/torvalds/linux/blob/v3.18/tools/perf/config/Makefile
https://github.com/torvalds/linux/blob/v3.18/tools/perf/Makefile.perf

No mention of these.

Going a bit deeper, I found this commit:
https://github.com/torvalds/linux/commit/80a32e5b498a7547073e5e4b2b804edc7219979d
where LZMA compression gets added to perf.

Looks like it was enabled default in upstream.

So, I guess, we could build perf with NO_LZMA:=1 defined and we could
disable it.
No strong preferences from me.

Your call :)

On Mon, Oct 26, 2015 at 12:58 PM, John Crispin <blogic@openwrt.org> wrote:

> thanks ! the patch looks good but i am failing to understand why the
> lzma needs to be added :)
>
> On 26/10/2015 11:52, Alexandru Ardelean wrote:
> > Ah, sorry about this.
> > I forgot about it ; completely swamped.
> >
> > Will add it in my desktop notes that I keep and come back with an answer
> > asap (hopefully today/tomorrow).
> >
> >
> > On Mon, Oct 26, 2015 at 12:13 PM, John Crispin <blogic@openwrt.org
> > <mailto:blogic@openwrt.org>> wrote:
> >
> >
> >
> >     On 21/10/2015 20:03, John Crispin wrote:
> >     >
> >     >
> >     > On 15/10/2015 15:01, Alexandru Ardelean wrote:
> >     >> This fix contains 2 parts:
> >     >>  - kernel 4.1: backport upstream patch "perf build: Do not fail
> on missing Build file"
> >     >>  - add +liblzma dependency
> >     >>
> >     >
> >     > did you find out why there is suddenly a dependency on lzma ?
> >     >
> >     >       John
> >
> >
> >     ping ...
> >
> >
>
John Crispin Oct. 26, 2015, 11:52 a.m. UTC | #6
On 26/10/2015 12:48, Alexandru Ardelean wrote:
> Looks like it did not take much to actually come back with an answer.
> So,
> 
> In file:
> https://github.com/torvalds/linux/blob/v4.1/tools/perf/Makefile.perf
> Line 75:   # Define NO_LZMA if you do not want to support compressed
> (xz) kernel modules
> 
> Then file:
> https://github.com/torvalds/linux/blob/v4.1/tools/perf/config/Makefile
> Lines 544-553:
> 
> ifndef NO_LZMA
>   ifeq ($(feature-lzma), 1)
>     CFLAGS += -DHAVE_LZMA_SUPPORT
>     EXTLIBS += -llzma
>     $(call detected,CONFIG_LZMA)
>   else
>     msg := $(warning No liblzma found, disables xz kernel module decompression, please install xz-devel/liblzma-dev);
>     NO_LZMA := 1
>   endif
> endif
> 
> In my case it seems to enable by default.
> 
> Looking at the same files in 3.18:
> https://github.com/torvalds/linux/blob/v3.18/tools/perf/config/Makefile
> https://github.com/torvalds/linux/blob/v3.18/tools/perf/Makefile.perf
> 
> No mention of these.
> 
> Going a bit deeper, I found this commit:
> https://github.com/torvalds/linux/commit/80a32e5b498a7547073e5e4b2b804edc7219979d
> where LZMA compression gets added to perf.
> 
> Looks like it was enabled default in upstream.
> 
> So, I guess, we could build perf with NO_LZMA:=1 defined and we could
> disable it.
> No strong preferences from me.
> 
> Your call :)

oh thanks, detailed analysis :) as our FS already doe LZMA and our kmods
are not compressed i think it is best to set NO_LZMA. could you
create/test a patch and i will mark the current version as "Changes
Requested"

	John
diff mbox

Patch

diff --git a/package/devel/perf/Makefile b/package/devel/perf/Makefile
index b77e29a..5eba8f1 100644
--- a/package/devel/perf/Makefile
+++ b/package/devel/perf/Makefile
@@ -19,7 +19,7 @@  include $(INCLUDE_DIR)/package.mk
 define Package/perf
   SECTION:=devel
   CATEGORY:=Development
-  DEPENDS:= @USE_GLIBC +libelf1 +libdw +libpthread +librt +binutils
+  DEPENDS:= @USE_GLIBC +libelf1 +libdw +libpthread +librt +binutils +liblzma
   TITLE:=Linux performance monitoring tool
   VERSION:=$(LINUX_VERSION)-$(PKG_RELEASE)
   URL:=http://www.kernel.org
diff --git a/target/linux/generic/patches-4.1/222-perf-build-Do-not-fail-on-missing-Build-file.patch b/target/linux/generic/patches-4.1/222-perf-build-Do-not-fail-on-missing-Build-file.patch
new file mode 100644
index 0000000..3fb2df6
--- /dev/null
+++ b/target/linux/generic/patches-4.1/222-perf-build-Do-not-fail-on-missing-Build-file.patch
@@ -0,0 +1,67 @@ 
+From d7a3d85e08477a979933a2bb3b525a8de99543c2 Mon Sep 17 00:00:00 2001
+From: Jiri Olsa <jolsa@kernel.org>
+Date: Fri, 29 May 2015 17:42:58 +0200
+Subject: [PATCH] perf build: Do not fail on missing Build file
+
+Allow nesting into directories without Build file. Currently we force
+include of the Build file, which fails the build when the Build file is
+missing.
+
+We already support empty *-in.o' objects if there's nothing in the
+directory to be compiled, so we can just use it for missing Build file
+cases.
+
+Also adding this case under tests.
+
+Reported-by: Rabin Vincent <rabin.vincent@axis.com>
+Signed-off-by: Jiri Olsa <jolsa@kernel.org>
+Cc: David Ahern <dsahern@gmail.com>
+Cc: Namhyung Kim <namhyung@kernel.org>
+Cc: Paul Mackerras <paulus@samba.org>
+Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
+Cc: Rabin Vincent <rabin.vincent@axis.com>
+Link: http://lkml.kernel.org/r/1432914178-24086-1-git-send-email-jolsa@kernel.org
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/build/Makefile.build         | 2 +-
+ tools/build/tests/ex/Build         | 1 +
+ tools/build/tests/ex/empty2/README | 2 ++
+ 3 files changed, 4 insertions(+), 1 deletion(-)
+ create mode 100644 tools/build/tests/ex/empty2/README
+
+diff --git a/tools/build/Makefile.build b/tools/build/Makefile.build
+index 10df572..69c35cf 100644
+--- a/tools/build/Makefile.build
++++ b/tools/build/Makefile.build
+@@ -37,7 +37,7 @@ subdir-obj-y :=
+ 
+ # Build definitions
+ build-file := $(dir)/Build
+-include $(build-file)
++-include $(build-file)
+ 
+ quiet_cmd_flex  = FLEX     $@
+ quiet_cmd_bison = BISON    $@
+diff --git a/tools/build/tests/ex/Build b/tools/build/tests/ex/Build
+index 0e6c3e6..70d8762 100644
+--- a/tools/build/tests/ex/Build
++++ b/tools/build/tests/ex/Build
+@@ -2,6 +2,7 @@ ex-y += ex.o
+ ex-y += a.o
+ ex-y += b.o
+ ex-y += empty/
++ex-y += empty2/
+ 
+ libex-y += c.o
+ libex-y += d.o
+diff --git a/tools/build/tests/ex/empty2/README b/tools/build/tests/ex/empty2/README
+new file mode 100644
+index 0000000..2107cc5
+--- /dev/null
++++ b/tools/build/tests/ex/empty2/README
+@@ -0,0 +1,2 @@
++This directory is left intentionally without Build file
++to test proper nesting into Build-less directories.
+-- 
+2.1.4
+