Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf doc: Add support for KBUILD_BUILD_TIMESTAMP

When building man pages from a Git checkout, we consistently set the
man page date based on when the input was last changed. Otherwise, it
defaults to the build time, which is not reproducible.

Allow the date to be set through the KBUILD_BUILD_TIMESTAMP variable,
as for timestamps in the kernel itself.

Signed-off-by: Ben Hutchings <benh@debian.org>
Acked-by: Ian Rogers<irogers@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Salvatore Bonaccorso <carnil@debian.org>
Link: https://lore.kernel.org/r/ZF/1F1P+b9qZ/vVH@decadent.org.uk
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Ben Hutchings and committed by
Arnaldo Carvalho de Melo
61b3d210 21a16513

+7 -3
+7 -3
tools/perf/Documentation/Makefile
··· 250 250 $(ASCIIDOC_EXTRA) -aperf_version=$(PERF_VERSION) -o $@+ $< && \ 251 251 mv $@+ $@ 252 252 253 - # Generate date from git log of the doc input file 254 - PERF_DATE = $(shell git log -1 --pretty="format:%cd" \ 255 - --date=short --no-show-signature $<) 253 + # Generate date from either KBUILD_BUILD_TIMESTAMP or git log of 254 + # the doc input file 255 + PERF_DATE = $(strip \ 256 + $(if $(KBUILD_BUILD_TIMESTAMP), \ 257 + $(shell date -u -d '$(KBUILD_BUILD_TIMESTAMP)' +%Y-%m-%d), \ 258 + $(shell git log -1 --pretty="format:%cd" \ 259 + --date=short --no-show-signature $<))) 256 260 257 261 ifdef USE_ASCIIDOCTOR 258 262 $(OUTPUT)%.1 $(OUTPUT)%.5 $(OUTPUT)%.7 : %.txt