Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 64458C433EF for ; Fri, 18 Feb 2022 11:45:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234803AbiBRLqA (ORCPT ); Fri, 18 Feb 2022 06:46:00 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:57024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234980AbiBRLpd (ORCPT ); Fri, 18 Feb 2022 06:45:33 -0500 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A14E22716C for ; Fri, 18 Feb 2022 03:45:13 -0800 (PST) Received: from fraeml709-chm.china.huawei.com (unknown [172.18.147.200]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4K0VBG2HPwz67wGb; Fri, 18 Feb 2022 19:40:38 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml709-chm.china.huawei.com (10.206.15.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Fri, 18 Feb 2022 12:45:11 +0100 Received: from localhost.localdomain (10.69.192.58) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Fri, 18 Feb 2022 11:45:07 +0000 From: John Garry To: , , , , , , CC: , , , John Garry Subject: [PATCH] perf: Fix dependency for version file creation Date: Fri, 18 Feb 2022 19:39:41 +0800 Message-ID: <1645184381-212900-1-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.58] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-perf-users@vger.kernel.org The version commit id generated by perf may not be correct by just changing the head commit, like this: $git log commit b5d9d4708a24ac1889a30e9aedf8af8d73102139 $perf -v perf version 5.16.gb5d9d4708a24 $git reset --hard HEAD^ HEAD is now at 629f520b265f $make ... $./perf -v perf version 5.16.gb5d9d4708a24 The dependency should also check ORIG_HEAD. Signed-off-by: John Garry --- Note that the tag (v5.16) also is wrong - it should be v5.17-rcX. I assume that this is the last torvalds tag pulled into my acme git. When I fetched torvalds git then I started to see proper tags. I think that we just need Arnaldo to fetch and push tags when rebasing or we need to use something else apart from "git describe" in util/PERF-VERSION-GEN - opinion? diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index ac861e42c8f7..cc0728076853 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf @@ -691,7 +691,7 @@ $(OUTPUT)common-cmds.h: $(wildcard Documentation/perf-*.txt) $(SCRIPTS) : % : %.sh $(QUIET_GEN)$(INSTALL) '$@.sh' '$(OUTPUT)$@' -$(OUTPUT)PERF-VERSION-FILE: ../../.git/HEAD +$(OUTPUT)PERF-VERSION-FILE: ../../.git/HEAD ../../.git/ORIG_HEAD $(Q)$(SHELL_PATH) util/PERF-VERSION-GEN $(OUTPUT) $(Q)touch $(OUTPUT)PERF-VERSION-FILE -- 2.26.2