From: Runzhen Wang <runzhen@linux.vnet.ibm.com>
To: acme@redhat.com
Cc: mingo@kernel.org, linux-kernel@vger.kernel.org,
Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Subject: Re: [PATCH] perf tool: fix the perf --version bug
Date: Wed, 24 Apr 2013 16:19:31 +0800 [thread overview]
Message-ID: <51779593.3060703@linux.vnet.ibm.com> (raw)
In-Reply-To: <516CDAF5.3020909@linux.vnet.ibm.com>
ping~ :)
On 04/16/2013 01:00 PM, Runzhen Wang wrote:
>
> The perf --version can't print the right version
> information when reset it to an earlier commit.
>
> For example, at present the version is:
> # ./perf --version
> perf version 3.9.rc6.gf8378f
>
> then, I reset it to an earlier version tag, say v3.8-rc7
> # git reset --hard v3.8-rc7
> # make
>
> However, the ./perf --version prints a wrong result:
> # ./perf --version
> perf version 3.9.rc6.g836dc9
>
> Using 'git describe' instead of 'git tag' can fix this problem.
>
> Signed-off-by: Runzhen Wang <runzhen@linux.vnet.ibm.com>
> ---
> tools/perf/util/PERF-VERSION-GEN | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/tools/perf/util/PERF-VERSION-GEN
> b/tools/perf/util/PERF-VERSION-GEN
> index 055fef3..ec3dd86 100755
> --- a/tools/perf/util/PERF-VERSION-GEN
> +++ b/tools/perf/util/PERF-VERSION-GEN
> @@ -14,9 +14,8 @@ LF='
> # otherwise try to get the version from the kernel Makefile
> #
> if test -d ../../.git -o -f ../../.git &&
> - VN=$(git tag 2>/dev/null | tail -1 | grep -E "v[0-9].[0-9]*")
> + VN=$(git describe --match 'v[0-9].[0-9]*' --abbrev=4 HEAD 2>/dev/null)
> then
> - VN=$(echo $VN"-g"$(git log -1 --abbrev=4 --pretty=format:"%h" HEAD))
> VN=$(echo "$VN" | sed -e 's/-/./g');
> else
> VN=$(MAKEFLAGS= make -sC ../.. kernelversion)
next prev parent reply other threads:[~2013-04-24 8:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-16 5:00 [PATCH] perf tool: fix the perf --version bug Runzhen Wang
2013-04-24 8:19 ` Runzhen Wang [this message]
-- strict thread matches above, loose matches on Subject: below --
2013-04-16 5:00 Runzhen Wang
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=51779593.3060703@linux.vnet.ibm.com \
--to=runzhen@linux.vnet.ibm.com \
--cc=acme@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=sukadev@linux.vnet.ibm.com \
/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.