Skip to content

Commit a614d01

Browse files
dsahernacmel
authored andcommitted
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>
1 parent 744a971 commit a614d01

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

scripts/package/Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,9 @@ git --git-dir=$(srctree)/.git archive --prefix=$(perf-tar)/ \
115115
-o $(perf-tar).tar; \
116116
mkdir -p $(perf-tar); \
117117
git --git-dir=$(srctree)/.git rev-parse HEAD > $(perf-tar)/HEAD; \
118-
tar rf $(perf-tar).tar $(perf-tar)/HEAD; \
118+
(cd $(srctree)/tools/perf; \
119+
util/PERF-VERSION-GEN ../../$(perf-tar)/ 2>/dev/null); \
120+
tar rf $(perf-tar).tar $(perf-tar)/HEAD $(perf-tar)/PERF-VERSION-FILE; \
119121
rm -r $(perf-tar); \
120122
$(if $(findstring tar-src,$@),, \
121123
$(if $(findstring bz2,$@),bzip2, \

tools/perf/util/PERF-VERSION-GEN

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ if test -d ../../.git -o -f ../../.git
1919
then
2020
TAG=$(git describe --abbrev=0 --match "v[0-9].[0-9]*" 2>/dev/null )
2121
CID=$(git log -1 --abbrev=4 --pretty=format:"%h" 2>/dev/null) && CID="-g$CID"
22+
elif test -f ../../PERF-VERSION-FILE
23+
then
24+
TAG=$(cut -d' ' -f3 ../../PERF-VERSION-FILE | sed -e 's/\"//g')
2225
fi
2326
if test -z "$TAG"
2427
then

0 commit comments

Comments
 (0)