Re: perf version not set when building out of tree

From: David Ahern
Date: Tue Nov 05 2013 - 18:58:57 EST


On 11/1/13, 1:02 AM, Ingo Molnar wrote:
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:

diff --git a/perf/tools/perf/util/PERF-VERSION-GEN b/perf/tools/perf/util/PERF-VERSION-GEN
index 15a77b7c0e36..2155882e7c1d 100755
--- a/perf/tools/perf/util/PERF-VERSION-GEN
+++ b/perf/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 ../../HEAD
+then
+ TAG=$(cat ../../HEAD)
fi
if test -z "$TAG"
then

David
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/