linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf: Fix version when building out of tree - v2
@ 2013-11-06 15:55 David Ahern
  2013-11-07  8:14 ` Ingo Molnar
  2013-11-07 15:30 ` [tip:perf/core] perf tools: Fix version when building out of tree tip-bot for David Ahern
  0 siblings, 2 replies; 3+ messages in thread
From: David Ahern @ 2013-11-06 15:55 UTC (permalink / raw)
  To: acme, linux-kernel; +Cc: David Ahern, Ingo Molnar, Namhyung Kim, Jiri Olsa

When building perf out of tree
    make perf-tar-src-pkg
    tar -xf perf-<ver>.tar -C /tmp
    cd /tmp/perf<ver>
    make -C tools/perf

you get the warning message:
    make[1]: *** No rule to make target `kernelversion'.  Stop.

Fix by saving the perf version in the tar file and using that for the
out of tree builds.

v2: removed short form request and fixed up version string from usual output

Suggested-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
---
 scripts/package/Makefile         | 4 +++-
 tools/perf/util/PERF-VERSION-GEN | 3 +++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/scripts/package/Makefile b/scripts/package/Makefile
index a4f31c900fa6..c5d473393816 100644
--- a/scripts/package/Makefile
+++ b/scripts/package/Makefile
@@ -115,7 +115,9 @@ git --git-dir=$(srctree)/.git archive --prefix=$(perf-tar)/         \
 	-o $(perf-tar).tar;                                         \
 mkdir -p $(perf-tar);                                               \
 git --git-dir=$(srctree)/.git rev-parse HEAD > $(perf-tar)/HEAD;    \
-tar rf $(perf-tar).tar $(perf-tar)/HEAD;                            \
+(cd $(srctree)/tools/perf;                                          \
+util/PERF-VERSION-GEN ../../$(perf-tar)/ 2>/dev/null);              \
+tar rf $(perf-tar).tar $(perf-tar)/HEAD $(perf-tar)/PERF-VERSION-FILE; \
 rm -r $(perf-tar);                                                  \
 $(if $(findstring tar-src,$@),,                                     \
 $(if $(findstring bz2,$@),bzip2,                                    \
diff --git a/tools/perf/util/PERF-VERSION-GEN b/tools/perf/util/PERF-VERSION-GEN
index 15a77b7c0e36..00d88be4e50c 100755
--- a/tools/perf/util/PERF-VERSION-GEN
+++ b/tools/perf/util/PERF-VERSION-GEN
@@ -19,6 +19,9 @@ if test -d ../../.git -o -f ../../.git
 then
 	TAG=$(git describe --abbrev=0 --match "v[0-9].[0-9]*" 2>/dev/null )
 	CID=$(git log -1 --abbrev=4 --pretty=format:"%h" 2>/dev/null) && CID="-g$CID"
+elif test -f ../../PERF-VERSION-FILE
+then
+	TAG=$(cut -d' ' -f3 ../../PERF-VERSION-FILE | sed -e 's/\"//g')
 fi
 if test -z "$TAG"
 then
-- 
1.8.3.4 (Apple Git-47)


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

* Re: [PATCH] perf: Fix version when building out of tree - v2
  2013-11-06 15:55 [PATCH] perf: Fix version when building out of tree - v2 David Ahern
@ 2013-11-07  8:14 ` Ingo Molnar
  2013-11-07 15:30 ` [tip:perf/core] perf tools: Fix version when building out of tree tip-bot for David Ahern
  1 sibling, 0 replies; 3+ messages in thread
From: Ingo Molnar @ 2013-11-07  8:14 UTC (permalink / raw)
  To: David Ahern; +Cc: acme, linux-kernel, Namhyung Kim, Jiri Olsa


* David Ahern <dsahern@gmail.com> wrote:

> When building perf out of tree
>     make perf-tar-src-pkg
>     tar -xf perf-<ver>.tar -C /tmp
>     cd /tmp/perf<ver>
>     make -C tools/perf
> 
> you get the warning message:
>     make[1]: *** No rule to make target `kernelversion'.  Stop.
> 
> Fix by saving the perf version in the tar file and using that for the
> out of tree builds.
> 
> v2: removed short form request and fixed up version string from usual output
> 
> Suggested-by: Ingo Molnar <mingo@kernel.org>
> Signed-off-by: David Ahern <dsahern@gmail.com>
> Cc: Ingo Molnar <mingo@kernel.org>
> Cc: Namhyung Kim <namhyung@kernel.org>
> Cc: Jiri Olsa <jolsa@redhat.com>
> ---
>  scripts/package/Makefile         | 4 +++-
>  tools/perf/util/PERF-VERSION-GEN | 3 +++
>  2 files changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/scripts/package/Makefile b/scripts/package/Makefile
> index a4f31c900fa6..c5d473393816 100644
> --- a/scripts/package/Makefile
> +++ b/scripts/package/Makefile
> @@ -115,7 +115,9 @@ git --git-dir=$(srctree)/.git archive --prefix=$(perf-tar)/         \
>  	-o $(perf-tar).tar;                                         \
>  mkdir -p $(perf-tar);                                               \
>  git --git-dir=$(srctree)/.git rev-parse HEAD > $(perf-tar)/HEAD;    \
> -tar rf $(perf-tar).tar $(perf-tar)/HEAD;                            \
> +(cd $(srctree)/tools/perf;                                          \
> +util/PERF-VERSION-GEN ../../$(perf-tar)/ 2>/dev/null);              \
> +tar rf $(perf-tar).tar $(perf-tar)/HEAD $(perf-tar)/PERF-VERSION-FILE; \
>  rm -r $(perf-tar);                                                  \
>  $(if $(findstring tar-src,$@),,                                     \
>  $(if $(findstring bz2,$@),bzip2,                                    \
> diff --git a/tools/perf/util/PERF-VERSION-GEN b/tools/perf/util/PERF-VERSION-GEN
> index 15a77b7c0e36..00d88be4e50c 100755
> --- a/tools/perf/util/PERF-VERSION-GEN
> +++ b/tools/perf/util/PERF-VERSION-GEN
> @@ -19,6 +19,9 @@ if test -d ../../.git -o -f ../../.git
>  then
>  	TAG=$(git describe --abbrev=0 --match "v[0-9].[0-9]*" 2>/dev/null )
>  	CID=$(git log -1 --abbrev=4 --pretty=format:"%h" 2>/dev/null) && CID="-g$CID"
> +elif test -f ../../PERF-VERSION-FILE
> +then
> +	TAG=$(cut -d' ' -f3 ../../PERF-VERSION-FILE | sed -e 's/\"//g')
>  fi
>  if test -z "$TAG"
>  then

Nice!

Reviewed-by: Ingo Molnar <mingo@kernel.org>

Thanks,

	Ingo

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

* [tip:perf/core] perf tools: Fix version when building out of tree
  2013-11-06 15:55 [PATCH] perf: Fix version when building out of tree - v2 David Ahern
  2013-11-07  8:14 ` Ingo Molnar
@ 2013-11-07 15:30 ` tip-bot for David Ahern
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for David Ahern @ 2013-11-07 15:30 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: acme, linux-kernel, hpa, mingo, namhyung, jolsa, dsahern, tglx

Commit-ID:  a614d01bdd0cc8200d917da25f5a3d539b944193
Gitweb:     http://git.kernel.org/tip/a614d01bdd0cc8200d917da25f5a3d539b944193
Author:     David Ahern <dsahern@gmail.com>
AuthorDate: Wed, 6 Nov 2013 08:55:35 -0700
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Thu, 7 Nov 2013 10:40:47 -0300

perf tools: Fix version when building out of tree

When building perf out of tree:

  $ make perf-tar-src-pkg
  $ tar -xf perf-<ver>.tar -C /tmp
  $ cd /tmp/perf<ver>
  $ make -C tools/perf

you get this warning message:
    make[1]: *** No rule to make target `kernelversion'.  Stop.

Fix it by saving the perf version in the tar file and using that for the
out of tree builds.

v2: removed short form request and fixed up version string from usual output.

Signed-off-by: David Ahern <dsahern@gmail.com>
Suggested-by: Ingo Molnar <mingo@kernel.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/1383753335-25782-1-git-send-email-dsahern@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 scripts/package/Makefile         | 4 +++-
 tools/perf/util/PERF-VERSION-GEN | 3 +++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/scripts/package/Makefile b/scripts/package/Makefile
index a4f31c9..c5d4733 100644
--- a/scripts/package/Makefile
+++ b/scripts/package/Makefile
@@ -115,7 +115,9 @@ git --git-dir=$(srctree)/.git archive --prefix=$(perf-tar)/         \
 	-o $(perf-tar).tar;                                         \
 mkdir -p $(perf-tar);                                               \
 git --git-dir=$(srctree)/.git rev-parse HEAD > $(perf-tar)/HEAD;    \
-tar rf $(perf-tar).tar $(perf-tar)/HEAD;                            \
+(cd $(srctree)/tools/perf;                                          \
+util/PERF-VERSION-GEN ../../$(perf-tar)/ 2>/dev/null);              \
+tar rf $(perf-tar).tar $(perf-tar)/HEAD $(perf-tar)/PERF-VERSION-FILE; \
 rm -r $(perf-tar);                                                  \
 $(if $(findstring tar-src,$@),,                                     \
 $(if $(findstring bz2,$@),bzip2,                                    \
diff --git a/tools/perf/util/PERF-VERSION-GEN b/tools/perf/util/PERF-VERSION-GEN
index ce7a804..39f1750 100755
--- a/tools/perf/util/PERF-VERSION-GEN
+++ b/tools/perf/util/PERF-VERSION-GEN
@@ -19,6 +19,9 @@ if test -d ../../.git -o -f ../../.git
 then
 	TAG=$(git describe --abbrev=0 --match "v[0-9].[0-9]*" 2>/dev/null )
 	CID=$(git log -1 --abbrev=4 --pretty=format:"%h" 2>/dev/null) && CID="-g$CID"
+elif test -f ../../PERF-VERSION-FILE
+then
+	TAG=$(cut -d' ' -f3 ../../PERF-VERSION-FILE | sed -e 's/\"//g')
 fi
 if test -z "$TAG"
 then

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

end of thread, other threads:[~2013-11-07 15:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-06 15:55 [PATCH] perf: Fix version when building out of tree - v2 David Ahern
2013-11-07  8:14 ` Ingo Molnar
2013-11-07 15:30 ` [tip:perf/core] perf tools: Fix version when building out of tree tip-bot for David Ahern

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).