All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tools: perf: Fix liblk not built when using perf_install target
@ 2013-08-30 15:18 Sedat Dilek
  2013-08-30 16:49 ` Robert Richter
  0 siblings, 1 reply; 6+ messages in thread
From: Sedat Dilek @ 2013-08-30 15:18 UTC (permalink / raw)
  To: LKML
  Cc: Sedat Dilek, Ingo Molnar, Peter Zijlstra,
	Arnaldo Carvalho de Melo, Linus Torvalds

After a successful Linux-kernel build I wanted to build only perf
as a linux-tools to do some benchmarking of the spinlock-lockref
changes together with a test-case from Linus.

I followed the advices in "tools/Makefile".

[ tools/Makefile ]
...
        @echo 'You can do:'
        @echo ' $$ make -C tools/ <tool>_install' <--- NOTE THIS ONE!
        @echo ''
        @echo '  from the kernel command line to build and install one of'
        @echo '  the tools above'
...

So, I tried to build perf the "official" way:

   $ make -C tools/ perf_install

Unfortunately, my build breaks like this:
...
make[2]: Entering directory
`~/src/linux-kernel/linux/tools/lib/traceevent'
make[2]: Leaving directory
`~/src/linux-kernel/linux/tools/lib/traceevent'
    LINK perf
gcc: error: ~/src/linux-kernel/linux/tools/lib/lk/liblk.a: No such file or directory
make[1]: *** [perf] Error 1
make[1]: Leaving directory `~/src/linux-kernel/linux/tools/perf'
make: *** [perf_install] Error 2

After some discussion on IRC with peterz and acme and a closer look at
the targets in "tools/Makefile", I have noticed that the perf_install
target misses liblk to be built beforehand.
On the contrary the perf_clean target invokes to clean liblk when perf
is cleaned.

[ tools/Makefile ]
...
perf_clean: liblk_clean
	$(call descend,$(@:_clean=),clean)
...

Fix this by adding liblk target to perf_install target.

For more details see this thread in [1]:
"[3.11-rc7] Building perf-only the "official" way seems to be BROKEN?"

[1] http://marc.info/?t=137786599400001&r=1&w=2

Cc: Ingo Molnar <mingo@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sedat Dilek <sedat.dilek@gmail.com>
---
 tools/Makefile | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tools/Makefile b/tools/Makefile
index 41067f3..c15f0e7 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -53,7 +53,10 @@ turbostat x86_energy_perf_policy: FORCE
 cpupower_install:
 	$(call descend,power/$(@:_install=),install)
 
-cgroup_install firewire_install lguest_install perf_install usb_install virtio_install vm_install net_install:
+cgroup_install firewire_install lguest_install usb_install virtio_install vm_install net_install:
+	$(call descend,$(@:_install=),install)
+
+perf_install: liblk
 	$(call descend,$(@:_install=),install)
 
 selftests_install:
-- 
1.8.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] tools: perf: Fix liblk not built when using perf_install target
  2013-08-30 15:18 [PATCH] tools: perf: Fix liblk not built when using perf_install target Sedat Dilek
@ 2013-08-30 16:49 ` Robert Richter
  2013-09-03  8:48   ` Namhyung Kim
  0 siblings, 1 reply; 6+ messages in thread
From: Robert Richter @ 2013-08-30 16:49 UTC (permalink / raw)
  To: Sedat Dilek
  Cc: LKML, Ingo Molnar, Peter Zijlstra, Arnaldo Carvalho de Melo,
	Linus Torvalds

On 30.08.13 17:18:36, Sedat Dilek wrote:
> So, I tried to build perf the "official" way:
> 
>    $ make -C tools/ perf_install
> 
> Unfortunately, my build breaks like this:
> ...
> make[2]: Entering directory
> `~/src/linux-kernel/linux/tools/lib/traceevent'
> make[2]: Leaving directory
> `~/src/linux-kernel/linux/tools/lib/traceevent'
>     LINK perf
> gcc: error: ~/src/linux-kernel/linux/tools/lib/lk/liblk.a: No such file or directory
> make[1]: *** [perf] Error 1
> make[1]: Leaving directory `~/src/linux-kernel/linux/tools/perf'
> make: *** [perf_install] Error 2
> 
> After some discussion on IRC with peterz and acme and a closer look at
> the targets in "tools/Makefile", I have noticed that the perf_install
> target misses liblk to be built beforehand.

There are no build prerequisites on purpose for install targets.
Install targets are intended to be run with root permissions. We don't
want to create/overwrite files in the build directory as root while
running install rules. Thus, you always need to run:

 $ make -C tools/ perf

or similar first.

> On the contrary the perf_clean target invokes to clean liblk when perf
> is cleaned.
> 
> [ tools/Makefile ]
> ...
> perf_clean: liblk_clean
> 	$(call descend,$(@:_clean=),clean)
> ...
> 
> Fix this by adding liblk target to perf_install target.

So no, this is not the proper fix.

Before installing you *need* to build. You might want to fix the
documenation...

-Robert

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] tools: perf: Fix liblk not built when using perf_install target
  2013-08-30 16:49 ` Robert Richter
@ 2013-09-03  8:48   ` Namhyung Kim
  2013-09-03  8:56     ` Sedat Dilek
  0 siblings, 1 reply; 6+ messages in thread
From: Namhyung Kim @ 2013-09-03  8:48 UTC (permalink / raw)
  To: Robert Richter
  Cc: Sedat Dilek, LKML, Ingo Molnar, Peter Zijlstra,
	Arnaldo Carvalho de Melo, Linus Torvalds

Hi,

On Fri, 30 Aug 2013 18:49:05 +0200, Robert Richter wrote:
> On 30.08.13 17:18:36, Sedat Dilek wrote:
>> So, I tried to build perf the "official" way:
>> 
>>    $ make -C tools/ perf_install
>> 
>> Unfortunately, my build breaks like this:
>> ...
>> make[2]: Entering directory
>> `~/src/linux-kernel/linux/tools/lib/traceevent'
>> make[2]: Leaving directory
>> `~/src/linux-kernel/linux/tools/lib/traceevent'
>>     LINK perf
>> gcc: error: ~/src/linux-kernel/linux/tools/lib/lk/liblk.a: No such file or directory
>> make[1]: *** [perf] Error 1
>> make[1]: Leaving directory `~/src/linux-kernel/linux/tools/perf'
>> make: *** [perf_install] Error 2
>> 
>> After some discussion on IRC with peterz and acme and a closer look at
>> the targets in "tools/Makefile", I have noticed that the perf_install
>> target misses liblk to be built beforehand.
>
> There are no build prerequisites on purpose for install targets.
> Install targets are intended to be run with root permissions. We don't
> want to create/overwrite files in the build directory as root while
> running install rules. Thus, you always need to run:
>
>  $ make -C tools/ perf
>
> or similar first.

But AFAIK install target usually depends on build targets on many
projects.  And perf too already does the same:

  [ tools/perf/Makefile ]
  install-bin: all
	...

  install: install-bin


So if you really concern the permission problem, install target should
not build perf itself, right?  But in this case, it tried to build perf
but failed to do it on liblk.

>
>> On the contrary the perf_clean target invokes to clean liblk when perf
>> is cleaned.
>> 
>> [ tools/Makefile ]
>> ...
>> perf_clean: liblk_clean
>> 	$(call descend,$(@:_clean=),clean)
>> ...
>> 
>> Fix this by adding liblk target to perf_install target.
>
> So no, this is not the proper fix.
>
> Before installing you *need* to build. You might want to fix the
> documenation...

Hmm.. I don't know.  What I'm curious about is why it didn't build liblk
during building perf.

Thanks,
Namhyung

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] tools: perf: Fix liblk not built when using perf_install target
  2013-09-03  8:48   ` Namhyung Kim
@ 2013-09-03  8:56     ` Sedat Dilek
  2013-09-03  9:13       ` Sedat Dilek
  0 siblings, 1 reply; 6+ messages in thread
From: Sedat Dilek @ 2013-09-03  8:56 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: Robert Richter, LKML, Ingo Molnar, Peter Zijlstra,
	Arnaldo Carvalho de Melo, Linus Torvalds

[-- Attachment #1: Type: text/plain, Size: 2608 bytes --]

On Tue, Sep 3, 2013 at 10:48 AM, Namhyung Kim <namhyung@kernel.org> wrote:
> Hi,
>
> On Fri, 30 Aug 2013 18:49:05 +0200, Robert Richter wrote:
>> On 30.08.13 17:18:36, Sedat Dilek wrote:
>>> So, I tried to build perf the "official" way:
>>>
>>>    $ make -C tools/ perf_install
>>>
>>> Unfortunately, my build breaks like this:
>>> ...
>>> make[2]: Entering directory
>>> `~/src/linux-kernel/linux/tools/lib/traceevent'
>>> make[2]: Leaving directory
>>> `~/src/linux-kernel/linux/tools/lib/traceevent'
>>>     LINK perf
>>> gcc: error: ~/src/linux-kernel/linux/tools/lib/lk/liblk.a: No such file or directory
>>> make[1]: *** [perf] Error 1
>>> make[1]: Leaving directory `~/src/linux-kernel/linux/tools/perf'
>>> make: *** [perf_install] Error 2
>>>
>>> After some discussion on IRC with peterz and acme and a closer look at
>>> the targets in "tools/Makefile", I have noticed that the perf_install
>>> target misses liblk to be built beforehand.
>>
>> There are no build prerequisites on purpose for install targets.
>> Install targets are intended to be run with root permissions. We don't
>> want to create/overwrite files in the build directory as root while
>> running install rules. Thus, you always need to run:
>>
>>  $ make -C tools/ perf
>>
>> or similar first.
>
> But AFAIK install target usually depends on build targets on many
> projects.  And perf too already does the same:
>
>   [ tools/perf/Makefile ]
>   install-bin: all
>         ...
>
>   install: install-bin
>
>
> So if you really concern the permission problem, install target should
> not build perf itself, right?  But in this case, it tried to build perf
> but failed to do it on liblk.
>
>>
>>> On the contrary the perf_clean target invokes to clean liblk when perf
>>> is cleaned.
>>>
>>> [ tools/Makefile ]
>>> ...
>>> perf_clean: liblk_clean
>>>      $(call descend,$(@:_clean=),clean)
>>> ...
>>>
>>> Fix this by adding liblk target to perf_install target.
>>
>> So no, this is not the proper fix.
>>
>> Before installing you *need* to build. You might want to fix the
>> documenation...
>
> Hmm.. I don't know.  What I'm curious about is why it didn't build liblk
> during building perf.
>

The day I fell over that perf stuff, I created a pile of patches
fixing that unbeloved tools stuff.
Some tools listed in tools/Makefile are not buildable via...

     $ make -C tools/ <tool>
     $ make -C tools/ <tool>_install

...because some <tool> have no "install" target.

I attach the patchset here. It has no "proper" changelogs.
The series is "incomplete"... needs some more love... eat it carefully.

Regards,
- Sedat -

[-- Attachment #2: 0001-tools-Improve-and-correct-help-text.patch --]
[-- Type: application/octet-stream, Size: 1091 bytes --]

From ad214ceb3876ec8f7f55cd16a8395f04cf684248 Mon Sep 17 00:00:00 2001
From: Sedat Dilek <sedat.dilek@gmail.com>
Date: Sat, 31 Aug 2013 01:16:37 +0200
Subject: [PATCH 1/8] tools: Improve and correct help text

Signed-off-by: Sedat Dilek <sedat.dilek@gmail.com>
---
 tools/Makefile | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/tools/Makefile b/tools/Makefile
index 41067f3..6764e24 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -17,14 +17,15 @@ help:
 	@echo '  x86_energy_perf_policy - Intel energy policy tool'
 	@echo ''
 	@echo 'You can do:'
-	@echo ' $$ make -C tools/ <tool>_install'
+	@echo ' $$ make -C tools/ <tool>'
+	@echo ' $$ sudo make -C tools/ <tool>_install'
 	@echo ''
 	@echo '  from the kernel command line to build and install one of'
-	@echo '  the tools above'
+	@echo '  the above listed tools.'
 	@echo ''
-	@echo '  $$ make tools/install'
+	@echo '  $$ sudo make -C tools/ install'
 	@echo ''
-	@echo '  installs all tools.'
+	@echo '  builds and installs all tools.'
 	@echo ''
 	@echo 'Cleaning targets:'
 	@echo ''
-- 
1.8.4


[-- Attachment #3: 0002-tools-lguest-Fix-typo-in-Makefile-target.patch --]
[-- Type: application/octet-stream, Size: 674 bytes --]

From 33bf6b6d16d2afd5e324bdbf5a46fe30346a1a5a Mon Sep 17 00:00:00 2001
From: Sedat Dilek <sedat.dilek@gmail.com>
Date: Sat, 31 Aug 2013 01:19:21 +0200
Subject: [PATCH 2/8] tools: lguest: Fix typo in Makefile target

Signed-off-by: Sedat Dilek <sedat.dilek@gmail.com>
---
 tools/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/Makefile b/tools/Makefile
index 6764e24..ae986c1 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -36,7 +36,7 @@ help:
 cpupower: FORCE
 	$(call descend,power/$@)
 
-cgroup firewire guest usb virtio vm net: FORCE
+cgroup firewire lguest usb virtio vm net: FORCE
 	$(call descend,$@)
 
 liblk: FORCE
-- 
1.8.4


[-- Attachment #4: 0003-tools-vm-Consider-liblk-as-a-prerequisite.patch --]
[-- Type: application/octet-stream, Size: 1582 bytes --]

From 521faf6fc953ab14a18ac3c23c2bfc650038ffa0 Mon Sep 17 00:00:00 2001
From: Sedat Dilek <sedat.dilek@gmail.com>
Date: Sat, 31 Aug 2013 01:24:16 +0200
Subject: [PATCH 3/8] tools: vm: Consider liblk as a prerequisite

Signed-off-by: Sedat Dilek <sedat.dilek@gmail.com>
---
 tools/Makefile    | 8 ++++----
 tools/vm/Makefile | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/Makefile b/tools/Makefile
index ae986c1..ecf17c0 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -36,13 +36,13 @@ help:
 cpupower: FORCE
 	$(call descend,power/$@)
 
-cgroup firewire lguest usb virtio vm net: FORCE
+cgroup firewire lguest usb virtio net: FORCE
 	$(call descend,$@)
 
 liblk: FORCE
 	$(call descend,lib/lk)
 
-perf: liblk FORCE
+perf vm: liblk FORCE
 	$(call descend,$@)
 
 selftests: FORCE
@@ -70,13 +70,13 @@ install: cgroup_install cpupower_install firewire_install lguest_install \
 cpupower_clean:
 	$(call descend,power/cpupower,clean)
 
-cgroup_clean firewire_clean lguest_clean usb_clean virtio_clean vm_clean net_clean:
+cgroup_clean firewire_clean lguest_clean usb_clean virtio_clean net_clean:
 	$(call descend,$(@:_clean=),clean)
 
 liblk_clean:
 	$(call descend,lib/lk,clean)
 
-perf_clean: liblk_clean
+perf_clean vm_clean: liblk_clean
 	$(call descend,$(@:_clean=),clean)
 
 selftests_clean:
diff --git a/tools/vm/Makefile b/tools/vm/Makefile
index 24e9ddd..63e7848 100644
--- a/tools/vm/Makefile
+++ b/tools/vm/Makefile
@@ -19,4 +19,4 @@ liblk:
 
 clean:
 	$(RM) page-types slabinfo
-	make -C ../lib/lk clean
+	make -C $(LK_DIR) clean
-- 
1.8.4


[-- Attachment #5: 0004-tools-usb-Use-pthread-instead-of-lpthread.patch --]
[-- Type: application/octet-stream, Size: 696 bytes --]

From 49699660ac5f10e461821af624cb0470f95bc22f Mon Sep 17 00:00:00 2001
From: Sedat Dilek <sedat.dilek@gmail.com>
Date: Sat, 31 Aug 2013 01:37:21 +0200
Subject: [PATCH 4/8] tools: usb: Use -pthread instead of -lpthread

Signed-off-by: Sedat Dilek <sedat.dilek@gmail.com>
---
 tools/usb/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/usb/Makefile b/tools/usb/Makefile
index 396d6c4..c14f514 100644
--- a/tools/usb/Makefile
+++ b/tools/usb/Makefile
@@ -1,7 +1,7 @@
 # Makefile for USB tools
 
 CC = $(CROSS_COMPILE)gcc
-PTHREAD_LIBS = -lpthread
+PTHREAD_LIBS = -pthread
 WARNINGS = -Wall -Wextra
 CFLAGS = $(WARNINGS) -g $(PTHREAD_LIBS) -I../include
 
-- 
1.8.4


[-- Attachment #6: 0005-tools-vm-Add-dummy-install-target-to-fix-make-C-tool.patch --]
[-- Type: application/octet-stream, Size: 647 bytes --]

From 6de3625e9ff84aea09f16602f960e14d78bb52c6 Mon Sep 17 00:00:00 2001
From: Sedat Dilek <sedat.dilek@gmail.com>
Date: Sat, 31 Aug 2013 02:09:44 +0200
Subject: [PATCH 5/8] tools: vm: Add dummy install target to fix 'make -C
 tools/ vm_install'

Signed-off-by: Sedat Dilek <sedat.dilek@gmail.com>
---
 tools/vm/Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/vm/Makefile b/tools/vm/Makefile
index 63e7848..cbf346b 100644
--- a/tools/vm/Makefile
+++ b/tools/vm/Makefile
@@ -17,6 +17,8 @@ liblk:
 %: %.c
 	$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
 
+install:
+
 clean:
 	$(RM) page-types slabinfo
 	make -C $(LK_DIR) clean
-- 
1.8.4


[-- Attachment #7: 0006-tools-selftests-Fix-selftests_install-target.patch --]
[-- Type: application/octet-stream, Size: 1244 bytes --]

From dd4c76f34c72bfbaf8425c6cddf911841f86b389 Mon Sep 17 00:00:00 2001
From: Sedat Dilek <sedat.dilek@gmail.com>
Date: Sat, 31 Aug 2013 03:16:17 +0200
Subject: [PATCH 6/8] tools: selftests: Fix selftests_install target

Signed-off-by: Sedat Dilek <sedat.dilek@gmail.com>
---
 tools/Makefile                   | 2 +-
 tools/testing/selftests/Makefile | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/Makefile b/tools/Makefile
index ecf17c0..a5502e0 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -58,7 +58,7 @@ cgroup_install firewire_install lguest_install perf_install usb_install virtio_i
 	$(call descend,$(@:_install=),install)
 
 selftests_install:
-	$(call descend,testing/$(@:_clean=),install)
+	$(call descend,testing/$(@:_install=),install)
 
 turbostat_install x86_energy_perf_policy_install:
 	$(call descend,power/x86/$(@:_install=),install)
diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile
index 4cb14ca..5e0b94e 100644
--- a/tools/testing/selftests/Makefile
+++ b/tools/testing/selftests/Makefile
@@ -19,6 +19,8 @@ run_tests: all
 		make -C $$TARGET run_tests; \
 	done;
 
+install:
+
 clean:
 	for TARGET in $(TARGETS); do \
 		make -C $$TARGET clean; \
-- 
1.8.4


[-- Attachment #8: 0007-tools-Introduce-an-all-target-to-build-all-tools.patch --]
[-- Type: application/octet-stream, Size: 1018 bytes --]

From 527aa0c1ba9055a429247fe0932d36c965d27b87 Mon Sep 17 00:00:00 2001
From: Sedat Dilek <sedat.dilek@gmail.com>
Date: Sat, 31 Aug 2013 02:28:06 +0200
Subject: [PATCH 7/8] tools: Introduce an all target to build all tools

Signed-off-by: Sedat Dilek <sedat.dilek@gmail.com>
---
 tools/Makefile | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/Makefile b/tools/Makefile
index a5502e0..8238e5f 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -23,6 +23,7 @@ help:
 	@echo '  from the kernel command line to build and install one of'
 	@echo '  the above listed tools.'
 	@echo ''
+	@echo '  $$ make -C tools/ all'
 	@echo '  $$ sudo make -C tools/ install'
 	@echo ''
 	@echo '  builds and installs all tools.'
@@ -51,6 +52,8 @@ selftests: FORCE
 turbostat x86_energy_perf_policy: FORCE
 	$(call descend,power/x86/$@)
 
+all: cpupower cgroup firewire lguest net usb virtio perf vm selftests turbostat x86_energy_perf_policy
+
 cpupower_install:
 	$(call descend,power/$(@:_install=),install)
 
-- 
1.8.4


[-- Attachment #9: 0008-tools-Reorder-tool-_install-install-and-clean-target.patch --]
[-- Type: application/octet-stream, Size: 2645 bytes --]

From 762abac0e1614c0a59dee19c189dd37d401998c1 Mon Sep 17 00:00:00 2001
From: Sedat Dilek <sedat.dilek@gmail.com>
Date: Sat, 31 Aug 2013 02:21:05 +0200
Subject: [PATCH 8/8] tools: Reorder <tool>_install, install and clean targets

Signed-off-by: Sedat Dilek <sedat.dilek@gmail.com>
---
 tools/Makefile | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/tools/Makefile b/tools/Makefile
index 8238e5f..3afa831 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -37,7 +37,7 @@ help:
 cpupower: FORCE
 	$(call descend,power/$@)
 
-cgroup firewire lguest usb virtio net: FORCE
+cgroup firewire lguest net usb virtio: FORCE
 	$(call descend,$@)
 
 liblk: FORCE
@@ -57,7 +57,7 @@ all: cpupower cgroup firewire lguest net usb virtio perf vm selftests turbostat
 cpupower_install:
 	$(call descend,power/$(@:_install=),install)
 
-cgroup_install firewire_install lguest_install perf_install usb_install virtio_install vm_install net_install:
+cgroup_install firewire_install lguest_install net_install usb_install virtio_install perf_install vm_install:
 	$(call descend,$(@:_install=),install)
 
 selftests_install:
@@ -66,14 +66,16 @@ selftests_install:
 turbostat_install x86_energy_perf_policy_install:
 	$(call descend,power/x86/$(@:_install=),install)
 
-install: cgroup_install cpupower_install firewire_install lguest_install \
-		perf_install selftests_install turbostat_install usb_install \
-		virtio_install vm_install net_install x86_energy_perf_policy_install
+install: cpupower_install \
+               cgroup_install firewire_install lguest_install net_install usb_install virtio_install \
+               perf_install vm_install \
+               selftests_install \
+               turbostat_install x86_energy_perf_policy_install
 
 cpupower_clean:
 	$(call descend,power/cpupower,clean)
 
-cgroup_clean firewire_clean lguest_clean usb_clean virtio_clean net_clean:
+cgroup_clean firewire_clean lguest_clean net_clean usb_clean virtio_clean:
 	$(call descend,$(@:_clean=),clean)
 
 liblk_clean:
@@ -88,8 +90,10 @@ selftests_clean:
 turbostat_clean x86_energy_perf_policy_clean:
 	$(call descend,power/x86/$(@:_clean=),clean)
 
-clean: cgroup_clean cpupower_clean firewire_clean lguest_clean perf_clean \
-		selftests_clean turbostat_clean usb_clean virtio_clean \
-		vm_clean net_clean x86_energy_perf_policy_clean
+clean: cpupower_clean \
+               cgroup_clean firewire_clean lguest_clean net_clean usb_clean virtio_clean \
+               perf_clean vm_clean \
+               selftests_clean \
+               turbostat_clean x86_energy_perf_policy_clean
 
 .PHONY: FORCE
-- 
1.8.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] tools: perf: Fix liblk not built when using perf_install target
  2013-09-03  8:56     ` Sedat Dilek
@ 2013-09-03  9:13       ` Sedat Dilek
  2013-09-03  9:20         ` Sedat Dilek
  0 siblings, 1 reply; 6+ messages in thread
From: Sedat Dilek @ 2013-09-03  9:13 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: Robert Richter, LKML, Ingo Molnar, Peter Zijlstra,
	Arnaldo Carvalho de Melo, Linus Torvalds

[-- Attachment #1: Type: text/plain, Size: 2880 bytes --]

On Tue, Sep 3, 2013 at 10:56 AM, Sedat Dilek <sedat.dilek@gmail.com> wrote:
> On Tue, Sep 3, 2013 at 10:48 AM, Namhyung Kim <namhyung@kernel.org> wrote:
>> Hi,
>>
>> On Fri, 30 Aug 2013 18:49:05 +0200, Robert Richter wrote:
>>> On 30.08.13 17:18:36, Sedat Dilek wrote:
>>>> So, I tried to build perf the "official" way:
>>>>
>>>>    $ make -C tools/ perf_install
>>>>
>>>> Unfortunately, my build breaks like this:
>>>> ...
>>>> make[2]: Entering directory
>>>> `~/src/linux-kernel/linux/tools/lib/traceevent'
>>>> make[2]: Leaving directory
>>>> `~/src/linux-kernel/linux/tools/lib/traceevent'
>>>>     LINK perf
>>>> gcc: error: ~/src/linux-kernel/linux/tools/lib/lk/liblk.a: No such file or directory
>>>> make[1]: *** [perf] Error 1
>>>> make[1]: Leaving directory `~/src/linux-kernel/linux/tools/perf'
>>>> make: *** [perf_install] Error 2
>>>>
>>>> After some discussion on IRC with peterz and acme and a closer look at
>>>> the targets in "tools/Makefile", I have noticed that the perf_install
>>>> target misses liblk to be built beforehand.
>>>
>>> There are no build prerequisites on purpose for install targets.
>>> Install targets are intended to be run with root permissions. We don't
>>> want to create/overwrite files in the build directory as root while
>>> running install rules. Thus, you always need to run:
>>>
>>>  $ make -C tools/ perf
>>>
>>> or similar first.
>>
>> But AFAIK install target usually depends on build targets on many
>> projects.  And perf too already does the same:
>>
>>   [ tools/perf/Makefile ]
>>   install-bin: all
>>         ...
>>
>>   install: install-bin
>>
>>
>> So if you really concern the permission problem, install target should
>> not build perf itself, right?  But in this case, it tried to build perf
>> but failed to do it on liblk.
>>
>>>
>>>> On the contrary the perf_clean target invokes to clean liblk when perf
>>>> is cleaned.
>>>>
>>>> [ tools/Makefile ]
>>>> ...
>>>> perf_clean: liblk_clean
>>>>      $(call descend,$(@:_clean=),clean)
>>>> ...
>>>>
>>>> Fix this by adding liblk target to perf_install target.
>>>
>>> So no, this is not the proper fix.
>>>
>>> Before installing you *need* to build. You might want to fix the
>>> documenation...
>>
>> Hmm.. I don't know.  What I'm curious about is why it didn't build liblk
>> during building perf.
>>
>
> The day I fell over that perf stuff, I created a pile of patches
> fixing that unbeloved tools stuff.
> Some tools listed in tools/Makefile are not buildable via...
>
>      $ make -C tools/ <tool>
>      $ make -C tools/ <tool>_install
>
> ...because some <tool> have no "install" target.
>
> I attach the patchset here. It has no "proper" changelogs.
> The series is "incomplete"... needs some more love... eat it carefully.
>

Attached 0008 v2.

* move cpupower to tools where sources are below power-dir.
* selftests is always last target

- Sedat -

[-- Attachment #2: 0008-tools-Reorder-tool-_install-install-and-clean-target.patch --]
[-- Type: application/octet-stream, Size: 3604 bytes --]

From dfef2887f084d2ccf7e37f6b319254c3b73cbe65 Mon Sep 17 00:00:00 2001
From: Sedat Dilek <sedat.dilek@gmail.com>
Date: Tue, 3 Sep 2013 11:09:43 +0200
Subject: [PATCH 8/8] tools: Reorder <tool>_install, install and clean targets
 (v2)

Signed-off-by: Sedat Dilek <sedat.dilek@gmail.com>
---
 tools/Makefile | 48 +++++++++++++++++++++++++-----------------------
 1 file changed, 25 insertions(+), 23 deletions(-)

diff --git a/tools/Makefile b/tools/Makefile
index 8238e5f..5566829 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -34,10 +34,7 @@ help:
 	@echo '    the respective build directory.'
 	@echo '  clean: a summary clean target to clean _all_ folders'
 
-cpupower: FORCE
-	$(call descend,power/$@)
-
-cgroup firewire lguest usb virtio net: FORCE
+cgroup firewire lguest net usb virtio: FORCE
 	$(call descend,$@)
 
 liblk: FORCE
@@ -46,34 +43,35 @@ liblk: FORCE
 perf vm: liblk FORCE
 	$(call descend,$@)
 
-selftests: FORCE
-	$(call descend,testing/$@)
+cpupower: FORCE
+        $(call descend,power/$@)
 
 turbostat x86_energy_perf_policy: FORCE
 	$(call descend,power/x86/$@)
 
-all: cpupower cgroup firewire lguest net usb virtio perf vm selftests turbostat x86_energy_perf_policy
+selftests: FORCE
+        $(call descend,testing/$@)
 
-cpupower_install:
-	$(call descend,power/$(@:_install=),install)
+all: cgroup firewire lguest net usb virtio perf vm cpupower turbostat x86_energy_perf_policy selftests
 
-cgroup_install firewire_install lguest_install perf_install usb_install virtio_install vm_install net_install:
+cgroup_install firewire_install lguest_install net_install usb_install virtio_install perf_install vm_install:
 	$(call descend,$(@:_install=),install)
 
-selftests_install:
-	$(call descend,testing/$(@:_install=),install)
+cpupower_install:
+        $(call descend,power/$(@:_install=),install)
 
 turbostat_install x86_energy_perf_policy_install:
 	$(call descend,power/x86/$(@:_install=),install)
 
-install: cgroup_install cpupower_install firewire_install lguest_install \
-		perf_install selftests_install turbostat_install usb_install \
-		virtio_install vm_install net_install x86_energy_perf_policy_install
+selftests_install:
+        $(call descend,testing/$(@:_install=),install)
 
-cpupower_clean:
-	$(call descend,power/cpupower,clean)
+install: cgroup_install firewire_install lguest_install net_install usb_install virtio_install \
+               perf_install vm_install \
+               cpupower_install turbostat_install x86_energy_perf_policy_install \
+               selftests_install
 
-cgroup_clean firewire_clean lguest_clean usb_clean virtio_clean net_clean:
+cgroup_clean firewire_clean lguest_clean net_clean usb_clean virtio_clean:
 	$(call descend,$(@:_clean=),clean)
 
 liblk_clean:
@@ -82,14 +80,18 @@ liblk_clean:
 perf_clean vm_clean: liblk_clean
 	$(call descend,$(@:_clean=),clean)
 
-selftests_clean:
-	$(call descend,testing/$(@:_clean=),clean)
+cpupower_clean:
+        $(call descend,power/cpupower,clean)
 
 turbostat_clean x86_energy_perf_policy_clean:
 	$(call descend,power/x86/$(@:_clean=),clean)
 
-clean: cgroup_clean cpupower_clean firewire_clean lguest_clean perf_clean \
-		selftests_clean turbostat_clean usb_clean virtio_clean \
-		vm_clean net_clean x86_energy_perf_policy_clean
+selftests_clean:
+        $(call descend,testing/$(@:_clean=),clean)
+
+clean: cgroup_clean firewire_clean lguest_clean net_clean usb_clean virtio_clean \
+               perf_clean vm_clean \
+               cpupower_clean turbostat_clean x86_energy_perf_policy_clean \
+               selftests_clean
 
 .PHONY: FORCE
-- 
1.8.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] tools: perf: Fix liblk not built when using perf_install target
  2013-09-03  9:13       ` Sedat Dilek
@ 2013-09-03  9:20         ` Sedat Dilek
  0 siblings, 0 replies; 6+ messages in thread
From: Sedat Dilek @ 2013-09-03  9:20 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: Robert Richter, LKML, Ingo Molnar, Peter Zijlstra,
	Arnaldo Carvalho de Melo, Linus Torvalds

[-- Attachment #1: Type: text/plain, Size: 3091 bytes --]

On Tue, Sep 3, 2013 at 11:13 AM, Sedat Dilek <sedat.dilek@gmail.com> wrote:
> On Tue, Sep 3, 2013 at 10:56 AM, Sedat Dilek <sedat.dilek@gmail.com> wrote:
>> On Tue, Sep 3, 2013 at 10:48 AM, Namhyung Kim <namhyung@kernel.org> wrote:
>>> Hi,
>>>
>>> On Fri, 30 Aug 2013 18:49:05 +0200, Robert Richter wrote:
>>>> On 30.08.13 17:18:36, Sedat Dilek wrote:
>>>>> So, I tried to build perf the "official" way:
>>>>>
>>>>>    $ make -C tools/ perf_install
>>>>>
>>>>> Unfortunately, my build breaks like this:
>>>>> ...
>>>>> make[2]: Entering directory
>>>>> `~/src/linux-kernel/linux/tools/lib/traceevent'
>>>>> make[2]: Leaving directory
>>>>> `~/src/linux-kernel/linux/tools/lib/traceevent'
>>>>>     LINK perf
>>>>> gcc: error: ~/src/linux-kernel/linux/tools/lib/lk/liblk.a: No such file or directory
>>>>> make[1]: *** [perf] Error 1
>>>>> make[1]: Leaving directory `~/src/linux-kernel/linux/tools/perf'
>>>>> make: *** [perf_install] Error 2
>>>>>
>>>>> After some discussion on IRC with peterz and acme and a closer look at
>>>>> the targets in "tools/Makefile", I have noticed that the perf_install
>>>>> target misses liblk to be built beforehand.
>>>>
>>>> There are no build prerequisites on purpose for install targets.
>>>> Install targets are intended to be run with root permissions. We don't
>>>> want to create/overwrite files in the build directory as root while
>>>> running install rules. Thus, you always need to run:
>>>>
>>>>  $ make -C tools/ perf
>>>>
>>>> or similar first.
>>>
>>> But AFAIK install target usually depends on build targets on many
>>> projects.  And perf too already does the same:
>>>
>>>   [ tools/perf/Makefile ]
>>>   install-bin: all
>>>         ...
>>>
>>>   install: install-bin
>>>
>>>
>>> So if you really concern the permission problem, install target should
>>> not build perf itself, right?  But in this case, it tried to build perf
>>> but failed to do it on liblk.
>>>
>>>>
>>>>> On the contrary the perf_clean target invokes to clean liblk when perf
>>>>> is cleaned.
>>>>>
>>>>> [ tools/Makefile ]
>>>>> ...
>>>>> perf_clean: liblk_clean
>>>>>      $(call descend,$(@:_clean=),clean)
>>>>> ...
>>>>>
>>>>> Fix this by adding liblk target to perf_install target.
>>>>
>>>> So no, this is not the proper fix.
>>>>
>>>> Before installing you *need* to build. You might want to fix the
>>>> documenation...
>>>
>>> Hmm.. I don't know.  What I'm curious about is why it didn't build liblk
>>> during building perf.
>>>
>>
>> The day I fell over that perf stuff, I created a pile of patches
>> fixing that unbeloved tools stuff.
>> Some tools listed in tools/Makefile are not buildable via...
>>
>>      $ make -C tools/ <tool>
>>      $ make -C tools/ <tool>_install
>>
>> ...because some <tool> have no "install" target.
>>
>> I attach the patchset here. It has no "proper" changelogs.
>> The series is "incomplete"... needs some more love... eat it carefully.
>>
>
> Attached 0008 v2.
>
> * move cpupower to tools where sources are below power-dir.
> * selftests is always last target
>

Grrr, space/tabs :-(.

0008 v3 attached.

- Sedat -

[-- Attachment #2: 0008-tools-Reorder-tool-_install-install-and-clean-target.patch --]
[-- Type: application/octet-stream, Size: 3576 bytes --]

From b0595b3d8be513c03a8c46384c6594c6886d9add Mon Sep 17 00:00:00 2001
From: Sedat Dilek <sedat.dilek@gmail.com>
Date: Tue, 3 Sep 2013 11:18:54 +0200
Subject: [PATCH 8/8] tools: Reorder <tool>_install, install and clean targets
 (v3)

Signed-off-by: Sedat Dilek <sedat.dilek@gmail.com>
---
 tools/Makefile | 48 +++++++++++++++++++++++++-----------------------
 1 file changed, 25 insertions(+), 23 deletions(-)

diff --git a/tools/Makefile b/tools/Makefile
index 8238e5f..ee00400 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -34,10 +34,7 @@ help:
 	@echo '    the respective build directory.'
 	@echo '  clean: a summary clean target to clean _all_ folders'
 
-cpupower: FORCE
-	$(call descend,power/$@)
-
-cgroup firewire lguest usb virtio net: FORCE
+cgroup firewire lguest net usb virtio: FORCE
 	$(call descend,$@)
 
 liblk: FORCE
@@ -46,34 +43,35 @@ liblk: FORCE
 perf vm: liblk FORCE
 	$(call descend,$@)
 
-selftests: FORCE
-	$(call descend,testing/$@)
+cpupower: FORCE
+        $(call descend,power/$@)
 
 turbostat x86_energy_perf_policy: FORCE
 	$(call descend,power/x86/$@)
 
-all: cpupower cgroup firewire lguest net usb virtio perf vm selftests turbostat x86_energy_perf_policy
+selftests: FORCE
+        $(call descend,testing/$@)
 
-cpupower_install:
-	$(call descend,power/$(@:_install=),install)
+all: cgroup firewire lguest net usb virtio perf vm cpupower turbostat x86_energy_perf_policy selftests
 
-cgroup_install firewire_install lguest_install perf_install usb_install virtio_install vm_install net_install:
+cgroup_install firewire_install lguest_install net_install usb_install virtio_install perf_install vm_install:
 	$(call descend,$(@:_install=),install)
 
-selftests_install:
-	$(call descend,testing/$(@:_install=),install)
+cpupower_install:
+	$(call descend,power/$(@:_install=),install)
 
 turbostat_install x86_energy_perf_policy_install:
 	$(call descend,power/x86/$(@:_install=),install)
 
-install: cgroup_install cpupower_install firewire_install lguest_install \
-		perf_install selftests_install turbostat_install usb_install \
-		virtio_install vm_install net_install x86_energy_perf_policy_install
+selftests_install:
+	$(call descend,testing/$(@:_install=),install)
 
-cpupower_clean:
-	$(call descend,power/cpupower,clean)
+install: cgroup_install firewire_install lguest_install net_install usb_install virtio_install \
+               perf_install vm_install \
+               cpupower_install turbostat_install x86_energy_perf_policy_install \
+               selftests_install
 
-cgroup_clean firewire_clean lguest_clean usb_clean virtio_clean net_clean:
+cgroup_clean firewire_clean lguest_clean net_clean usb_clean virtio_clean:
 	$(call descend,$(@:_clean=),clean)
 
 liblk_clean:
@@ -82,14 +80,18 @@ liblk_clean:
 perf_clean vm_clean: liblk_clean
 	$(call descend,$(@:_clean=),clean)
 
-selftests_clean:
-	$(call descend,testing/$(@:_clean=),clean)
+cpupower_clean:
+	$(call descend,power/cpupower,clean)
 
 turbostat_clean x86_energy_perf_policy_clean:
 	$(call descend,power/x86/$(@:_clean=),clean)
 
-clean: cgroup_clean cpupower_clean firewire_clean lguest_clean perf_clean \
-		selftests_clean turbostat_clean usb_clean virtio_clean \
-		vm_clean net_clean x86_energy_perf_policy_clean
+selftests_clean:
+	$(call descend,testing/$(@:_clean=),clean)
+
+clean: cgroup_clean firewire_clean lguest_clean net_clean usb_clean virtio_clean \
+               perf_clean vm_clean \
+               cpupower_clean turbostat_clean x86_energy_perf_policy_clean \
+               selftests_clean
 
 .PHONY: FORCE
-- 
1.8.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-09-03  9:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-30 15:18 [PATCH] tools: perf: Fix liblk not built when using perf_install target Sedat Dilek
2013-08-30 16:49 ` Robert Richter
2013-09-03  8:48   ` Namhyung Kim
2013-09-03  8:56     ` Sedat Dilek
2013-09-03  9:13       ` Sedat Dilek
2013-09-03  9:20         ` Sedat Dilek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.