Skip to contentSkip to conversation

perf tools: Fix tags target rebuilding

PATCH Superseded Jiri Olsa 4 participants 10 messages Nov 26, 2013 – Nov 30, 2013 perf events

lore
Share & tools
lore

Jiri Olsa

author
#0 lore raw

PATCH 1/1 perf tools: Fix tags target rebuilding

Once the tags file is generated it's never rebuilt until it's removed by hand.

The reason is that the Makefile does not treat tags as a target but as a file to be rebuilt.

Adding tags as PHONY target into the Makefile.

Cc Ingo Molnar <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Stephane Eranian <[email protected]>
Cc David Ahern <[email protected]>
Cc Adrian Hunter <[email protected]>
Cc Arnaldo Carvalho de Melo <[email protected]>
---
 tools/perf/Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
tools/perf/Makefile +3 -1
index 4835618..95f5792 100644
@@ -61,7 +61,7 @@ endef
 #
 # Needed if no target specified:
 #
-all:
+all tags:
 	$(print_msg)
 	$(make)
 
@@ -77,3 +77,5 @@ clean:
 %:
 	$(print_msg)
 	$(make)
+
+.PHONY: tags
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 27 lines · Jiri Olsa

Once the tags file is generated it's never rebuilt until it's removed by hand.

The reason is that the Makefile does not treat tags as a target but as a file to be rebuilt.

Adding tags as PHONY target into the Makefile.

Cc Ingo Molnar <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Stephane Eranian <[email protected]>
Cc David Ahern <[email protected]>
Cc Adrian Hunter <[email protected]>
Cc Arnaldo Carvalho de Melo <[email protected]>
---
 tools/perf/Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
tools/perf/Makefile +0 -0
index 4835618..95f5792 100644

tools/perf/Makefile endef · line 64

Quoted 5 lines
tools/perf/Makefile +1 -1
@@ -61,7 +61,7 @@ endef
 #
 # Needed if no target specified:
 #
-all:
+all tags:

Obviously the change invalidates the comment above.

tools/perf/Makefile clean: · line 81

Quoted 9 lines
tools/perf/Makefile +2 -0
 	$(print_msg)
 	$(make)
 
@@ -77,3 +77,5 @@ clean:
 %:
 	$(print_msg)
 	$(make)
+
+.PHONY: tags

Note that there's also a TAGS file that uses etags - which probably needs similar treatment.

Also note that we have duplicate code for this in Makefile.perf already. Would it be possible to pass through this there and keep the main Makefile is just a thin, minimal wrapper that adds default parallelism, etc?

Thanks,

Ingo

author
#2 lore raw
Quoted 25 lines · Ingo Molnar
Quoted 22 lines · Jiri Olsa

Once the tags file is generated it's never rebuilt until it's removed by hand.

The reason is that the Makefile does not treat tags as a target but as a file to be rebuilt.

Adding tags as PHONY target into the Makefile.

Cc Ingo Molnar <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Stephane Eranian <[email protected]>
Cc David Ahern <[email protected]>
Cc Adrian Hunter <[email protected]>
Cc Arnaldo Carvalho de Melo <[email protected]>
---
 tools/perf/Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Quoted 12 lines

tools/perf/Makefile endef · line 64

Quoted 10 lines
tools/perf/Makefile +1 -1
index 4835618..95f5792 100644
@@ -61,7 +61,7 @@ endef
 #
 # Needed if no target specified:
 #
-all:
+all tags:

Obviously the change invalidates the comment above.

ugh, haven't noticed that comment ;-)

Quoted 4 lines
Quoted 4 lines
tools/perf/Makefile +0 -0
 	$(print_msg)
 	$(make)
 
Quoted 9 lines

tools/perf/Makefile clean: · line 81

Quoted 6 lines
tools/perf/Makefile +2 -0
@@ -77,3 +77,5 @@ clean:
 %:
 	$(print_msg)
 	$(make)
+
+.PHONY: tags

Note that there's also a TAGS file that uses etags - which probably needs similar treatment.

yes

Quoted 5 lines

Also note that we have duplicate code for this in Makefile.perf already. Would it be possible to pass through this there and keep the main Makefile is just a thin, minimal wrapper that adds default parallelism, etc?

well, thats what I actually tried to do.. pass the processing to the Makefile.perf otherwise it stops in Makefile

I guess you want some generic way of doing that

jirka

#3 lore raw
Quoted 63 lines · Jiri Olsa
Quoted 25 lines · Ingo Molnar
Quoted 22 lines · Jiri Olsa

Once the tags file is generated it's never rebuilt until it's removed by hand.

The reason is that the Makefile does not treat tags as a target but as a file to be rebuilt.

Adding tags as PHONY target into the Makefile.

Cc Ingo Molnar <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Stephane Eranian <[email protected]>
Cc David Ahern <[email protected]>
Cc Adrian Hunter <[email protected]>
Cc Arnaldo Carvalho de Melo <[email protected]>
---
 tools/perf/Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Quoted 12 lines

tools/perf/Makefile endef · line 64

Quoted 10 lines
tools/perf/Makefile +1 -1
index 4835618..95f5792 100644
@@ -61,7 +61,7 @@ endef
 #
 # Needed if no target specified:
 #
-all:
+all tags:

Obviously the change invalidates the comment above.

ugh, haven't noticed that comment ;-)

Quoted 4 lines
Quoted 4 lines
tools/perf/Makefile +0 -0
 	$(print_msg)
 	$(make)
 
Quoted 9 lines

tools/perf/Makefile clean: · line 81

Quoted 6 lines
tools/perf/Makefile +2 -0
@@ -77,3 +77,5 @@ clean:
 %:
 	$(print_msg)
 	$(make)
+
+.PHONY: tags

Note that there's also a TAGS file that uses etags - which probably needs similar treatment.

yes

Quoted 5 lines

Also note that we have duplicate code for this in Makefile.perf already. Would it be possible to pass through this there and keep the main Makefile is just a thin, minimal wrapper that adds default parallelism, etc?

Quoted 5 lines

well, thats what I actually tried to do.. pass the processing to the Makefile.perf otherwise it stops in Makefile

I guess you want some generic way of doing that

If it's just these two phony targets that need to be in the main makefile then I guess your approach is the simplest one and we should do it like that instead of complicating the interface. If it gets messier in the future we can reconsider?

Thanks,

Ingo

author
#4 lore raw

PATCH v2 1/1 perf tools: Fix tags/TAGS targets rebuilding

Quoted 4 lines · Ingo Molnar
Quoted 1 line · Jiri Olsa

On Tue, Nov 26, 2013 at 12:31:08PM +0100, Ingo Molnar wrote:

SNIP

Quoted 10 lines
Quoted 10 lines
Quoted 5 lines

Also note that we have duplicate code for this in Makefile.perf already. Would it be possible to pass through this there and keep the main Makefile is just a thin, minimal wrapper that adds default parallelism, etc?

well, thats what I actually tried to do.. pass the processing to the Makefile.perf otherwise it stops in Makefile

Quoted 7 lines
Quoted 1 line

I guess you want some generic way of doing that

If it's just these two phony targets that need to be in the main makefile then I guess your approach is the simplest one and we should do it like that instead of complicating the interface. If it gets messier in the future we can reconsider?

sounds good, pelase check v2

thanks,
jirka

---
Once the tags/TAGS file is generated it's never rebuilt until it's removed by hand.

The reason is that the Makefile does not treat tags/TAGS as targets but as files and thus won't rebuilt them once they are in place.

Adding PHONY tags/TAGS targets into Makefile.

Cc Ingo Molnar <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Stephane Eranian <[email protected]>
Cc David Ahern <[email protected]>
Cc Adrian Hunter <[email protected]>
Cc Arnaldo Carvalho de Melo <[email protected]>
---
 tools/perf/Makefile | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
tools/perf/Makefile +4 -1
index 4835618..eefb9fb 100644
@@ -60,8 +60,11 @@ endef
 
 #
 # Needed if no target specified:
+# (Except for tags and TAGS targets. The reason is that the
+# Makefile does not treat tags/TAGS as targets but as files
+# and thus won't rebuilt them once they are in place.)
 #
-all:
+all tags TAGS:
	$(print_msg)
	$(make)

@@ -77,3 +80,5 @@ clean:
%:

	$(print_msg)
	$(make)

+
+.PHONY: tags TAGS

Signature · 1 line
1.8.3.1
#5 lore raw

Re: [PATCHv2] perf tools: Fix tags/TAGS targets rebuilding

Quoted 61 lines · Jiri Olsa
Quoted 4 lines · Ingo Molnar
Quoted 1 line · Jiri Olsa

On Tue, Nov 26, 2013 at 12:31:08PM +0100, Ingo Molnar wrote:

SNIP

Quoted 10 lines
Quoted 10 lines
Quoted 5 lines

Also note that we have duplicate code for this in Makefile.perf already. Would it be possible to pass through this there and keep the main Makefile is just a thin, minimal wrapper that adds default parallelism, etc?

well, thats what I actually tried to do.. pass the processing to the Makefile.perf otherwise it stops in Makefile

Quoted 7 lines
Quoted 1 line

I guess you want some generic way of doing that

If it's just these two phony targets that need to be in the main makefile then I guess your approach is the simplest one and we should do it like that instead of complicating the interface. If it gets messier in the future we can reconsider?

sounds good, pelase check v2

thanks,
jirka

---
Once the tags/TAGS file is generated it's never rebuilt until it's removed by hand.

The reason is that the Makefile does not treat tags/TAGS as targets but as files and thus won't rebuilt them once they are in place.

Adding PHONY tags/TAGS targets into Makefile.

Cc Ingo Molnar <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Stephane Eranian <[email protected]>
Cc David Ahern <[email protected]>
Cc Adrian Hunter <[email protected]>
Cc Arnaldo Carvalho de Melo <[email protected]>
---
 tools/perf/Makefile | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
tools/perf/Makefile +0 -0
index 4835618..eefb9fb 100644

tools/perf/Makefile endef · line 65

Quoted 6 lines
tools/perf/Makefile +3 -0
@@ -60,8 +60,11 @@ endef
 
 #
 # Needed if no target specified:
+# (Except for tags and TAGS targets. The reason is that the
+# Makefile does not treat tags/TAGS as targets but as files
+# and thus won't rebuilt them once they are in place.)

s/rebuilt/rebuild

Btw., could we perhaps change the targets to 'ctags' and 'etags' instead? (That will make it natural to add 'gtags' in the future, should anyone want that.)

Thanks,

Ingo

author
#6 lore raw

Re: [PATCHv2] perf tools: Fix tags/TAGS targets rebuilding

On Tue, Nov 26, 2013 at 05:13:16PM +0100, Ingo Molnar wrote:

SNIP

Quoted 9 lines

tools/perf/Makefile endef · line 65

Quoted 6 lines

#
# Needed if no target specified:

tools/perf/Makefile +3 -0
+# (Except for tags and TAGS targets. The reason is that the
+# Makefile does not treat tags/TAGS as targets but as files
+# and thus won't rebuilt them once they are in place.)

s/rebuilt/rebuild

Quoted 3 lines

Btw., could we perhaps change the targets to 'ctags' and 'etags' instead? (That will make it natural to add 'gtags' in the future, should anyone want that.)

my fingers vote against removing 'make tags' (and cscope) dont care much about the rest though.. ;-)

jirka

Acked-by
#7 lore raw

Re: [PATCHv2] perf tools: Fix tags/TAGS targets rebuilding

Quoted 13 lines · Jiri Olsa

On Tue, Nov 26, 2013 at 05:13:16PM +0100, Ingo Molnar wrote:

SNIP

Quoted 9 lines

tools/perf/Makefile endef · line 65

Quoted 6 lines

#
# Needed if no target specified:

tools/perf/Makefile +3 -0
+# (Except for tags and TAGS targets. The reason is that the
+# Makefile does not treat tags/TAGS as targets but as files
+# and thus won't rebuilt them once they are in place.)

s/rebuilt/rebuild

Quoted 6 lines
Quoted 3 lines

Btw., could we perhaps change the targets to 'ctags' and 'etags' instead? (That will make it natural to add 'gtags' in the future, should anyone want that.)

my fingers vote against removing 'make tags' (and cscope) dont care much about the rest though.. ;-)

Okay, fair enough, and 'tags/TAGS' targets is also what the main kernel build system uses - so I concur. For your updated v2 patch:

Thanks,

Ingo

#8 lore raw

Re: [PATCHv2] perf tools: Fix tags/TAGS targets rebuilding

In reply to Jiri Olsa

Em Wed, Nov 27, 2013 at 12:16:50AM +0100, Jiri Olsa escreveu:

Quoted 13 lines · Ingo Molnar

SNIP

Quoted 9 lines

tools/perf/Makefile endef · line 65

Quoted 6 lines

#
# Needed if no target specified:

tools/perf/Makefile +3 -0
+# (Except for tags and TAGS targets. The reason is that the
+# Makefile does not treat tags/TAGS as targets but as files
+# and thus won't rebuilt them once they are in place.)

s/rebuilt/rebuild

Quoted 6 lines
Quoted 3 lines

Btw., could we perhaps change the targets to 'ctags' and 'etags' instead? (That will make it natural to add 'gtags' in the future, should anyone want that.)

my fingers vote against removing 'make tags' (and cscope) dont care much about the rest though.. ;-)

Ditto, please leave 'make tags', just like that kernel.

- Arnaldo

#9 lore raw

[tip:perf/core] perf tools: Fix tags/TAGS targets rebuilding

In reply to Jiri Olsa
perf tools: Fix tags/TAGS targets rebuilding
Commit-ID:  26286141a43251bed548349efbf60b61f1c433e8
Gitweb:     http://git.kernel.org/tip/26286141a43251bed548349efbf60b61f1c433e8
Author:     Jiri Olsa <[email protected]>
AuthorDate: Tue, 26 Nov 2013 13:54:12 +0100
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Wed, 27 Nov 2013 16:47:14 -0300

perf tools: Fix tags/TAGS targets rebuilding

Once the tags/TAGS file is generated it's never rebuilt until it's removed by hand.

The reason is that the Makefile does not treat tags/TAGS as targets but as files and thus won't rebuilt them once they are in place.

Adding PHONY tags/TAGS targets into Makefile.

---
 tools/perf/Makefile | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
tools/perf/Makefile +6 -1
index 4835618..eefb9fb 100644
@@ -60,8 +60,11 @@ endef
 
 #
 # Needed if no target specified:
+# (Except for tags and TAGS targets. The reason is that the
+# Makefile does not treat tags/TAGS as targets but as files
+# and thus won't rebuilt them once they are in place.)
 #
-all:
+all tags TAGS:
 	$(print_msg)
 	$(make)
 
@@ -77,3 +80,5 @@ clean:
 %:
 	$(print_msg)
 	$(make)
+
+.PHONY: tags TAGS