perf version not set when building out of tree
When building 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.
which comes from tools/perf/util/PERF-VERSION-GEN,
if test -z "$TAG"
then
TAG=$(MAKEFLAGS= make -sC ../.. kernelversion)
fi
There is no top level Makefile. perf is actually built, but has no version info:
$ tools/perf/perf --version perf version
I thought someone had proposed a way to fix that.
David
Quoted 3 lines · David Ahern
When building out of tree:
make perf-tar-src-pkg
What's the canonical way to build a perf tarball? I didn't find any makefile target for that.
Quoted 14 lines
tar -xf perf-<ver>.tar -C /tmp
cd /tmp/perf<ver>
make -Ctools/perfyou get the warning message:
make[1]: *** No rule to make target `kernelversion'. Stop.which comes from
tools/perf/util/PERF-VERSION-GEN,if test -z "$TAG"
thenTAG=$(MAKEFLAGS= make -sC ../.. kernelversion)fi
Quoted 7 lines
There is no top level
Makefile. perf is actually built, but has no version info:$ tools/perf/perf --version perf versionI thought someone had proposed a way to fix that.
I think we should pack the PERF-VERSION-FILE with the tarball and use that. This needs roughly 3 changes:
- make PERF-VERSION-FILE part of the tarball
- make sure it's not zapped on 'make clean'
- don't try to regenerate it if there's no git repository to get a version from
Thanks,
Ingo
Quoted 9 lines · Ingo Molnar
Quoted 3 lines · David Ahern
When building out of tree:
make perf-tar-src-pkg
What's the canonical way to build a perf tarball? I didn't find any makefile target for that.
Perhaps I misunderstand your question. From the top-level of a kernel tree:
$ make help | grep perf
perf-tar-src-pkg - Build perf-3.12.0-rc5.tar source tarball
perf-targz-src-pkg - Build perf-3.12.0-rc5.tar.gz source tarball perf-tarbz2-src-pkg - Build perf-3.12.0-rc5.tar.bz2 source tarball perf-tarxz-src-pkg - Build perf-3.12.0-rc5.tar.xz source tarball
David
Quoted 11 lines · David Ahern
Quoted 9 lines · Ingo Molnar
Quoted 3 lines · David Ahern
When building out of tree:
make perf-tar-src-pkg
What's the canonical way to build a perf tarball? I didn't find any makefile target for that.
Quoted 7 lines
Perhaps I misunderstand your question. From the top-level of a kernel tree:
$ make help | grep perfperf-tar-src-pkg - Build perf-3.12.0-rc5.tar source tarball
perf-targz-src-pkg - Build perf-3.12.0-rc5.tar.gz source tarball perf-tarbz2-src-pkg - Build perf-3.12.0-rc5.tar.bz2 source tarball perf-tarxz-src-pkg - Build perf-3.12.0-rc5.tar.xz source tarball
Thx - I was trying to find that within the tools/perf/ Makefiles ;-)
Thanks,
Ingo
Quoted 6 lines · Ingo Molnar
I think we should pack the PERF-VERSION-FILE with the tarball and use that. This needs roughly 3 changes:
- make PERF-VERSION-FILE part of the tarball
- make sure it's not zapped on 'make clean'
- don't try to regenerate it if there's no git repository to get a version from
Solution was actually kind of easy. The head commit is already saved to HEAD file when the tar is generated:
perf/tools/perf/util/PERF-VERSION-GEN +0 -0
@@ -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 ../../HEAD
+then
+ TAG=$(cat ../../HEAD)
fi
if test -z "$TAG"
then
David