All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail.com>
To: Ingo Molnar <mingo@kernel.org>,
	Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Namhyung Kim <namhyung@kernel.org>, Jiri Olsa <jolsa@redhat.com>
Subject: Re: perf version not set when building out of tree
Date: Tue, 05 Nov 2013 16:58:45 -0700	[thread overview]
Message-ID: <52798635.70209@gmail.com> (raw)
In-Reply-To: <20131101070219.GA21471@gmail.com>

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

      parent reply	other threads:[~2013-11-05 23:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-31 23:31 perf version not set when building out of tree David Ahern
2013-11-01  7:02 ` Ingo Molnar
2013-11-01 13:30   ` David Ahern
2013-11-01 15:41     ` Ingo Molnar
2013-11-05 23:58   ` David Ahern [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52798635.70209@gmail.com \
    --to=dsahern@gmail.com \
    --cc=acme@ghostprotocols.net \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.