Skip to content

Commit 4e666cd

Browse files
John Garryacmel
authored andcommitted
perf tools: Fix dependency for version file creation
The version generated by perf may not be correct by just changing the head commit, like this: $ git log --pretty=format:"%H" -n 1 b5d9d4708a24ac1889a30e9aedf8af8d73102139 $ perf -v perf version 5.16.gb5d9d4708a24 $ git reset --hard HEAD^ HEAD is now at 629f520 $ make ... $ ./perf -v perf version 5.16.gb5d9d4708a24 The dependency to building PERF-VERSION-FILE should also include ORIG_HEAD, as this changes when changing the head commit (while HEAD does not). Signed-off-by: John Garry <john.garry@huawei.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Ian Rogers <irogers@google.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Robert Richter <rric@kernel.org> Link: https://lore.kernel.org/r/1645449409-158238-2-git-send-email-john.garry@huawei.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent cd6382d commit 4e666cd

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tools/perf/Makefile.perf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@ $(OUTPUT)common-cmds.h: $(wildcard Documentation/perf-*.txt)
691691
$(SCRIPTS) : % : %.sh
692692
$(QUIET_GEN)$(INSTALL) '$@.sh' '$(OUTPUT)$@'
693693

694-
$(OUTPUT)PERF-VERSION-FILE: ../../.git/HEAD
694+
$(OUTPUT)PERF-VERSION-FILE: ../../.git/HEAD ../../.git/ORIG_HEAD
695695
$(Q)$(SHELL_PATH) util/PERF-VERSION-GEN $(OUTPUT)
696696
$(Q)touch $(OUTPUT)PERF-VERSION-FILE
697697

@@ -1144,7 +1144,7 @@ endif
11441144
# then force version regeneration:
11451145
#
11461146
ifeq ($(wildcard ../../.git/HEAD),)
1147-
GIT-HEAD-PHONY = ../../.git/HEAD
1147+
GIT-HEAD-PHONY = ../../.git/HEAD ../../.git/ORIG_HEAD
11481148
else
11491149
GIT-HEAD-PHONY =
11501150
endif

0 commit comments

Comments
 (0)