Skip to contentSkip to conversation

perf tools: Use $KBUILD_BUILD_TIMESTAMP as man page date

PATCH In review Ben Hutchings 3 participants 5 messages May 17, 2016 – May 13, 2023 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf tools: Use $KBUILD_BUILD_TIMESTAMP as man page date

This allows man pages to be built reproducibly.

---

tools/perf/Documentation/Makefile +3 -0
@@ -120,6 +120,9 @@ endif
 ifdef DOCBOOK_SUPPRESS_SP
 XMLTO_EXTRA += -m manpage-suppress-sp.xsl
 endif
+ifdef KBUILD_BUILD_TIMESTAMP
+ASCIIDOC_EXTRA += -a revdate=$(shell date -u -d '$(KBUILD_BUILD_TIMESTAMP)' +%Y-%m-%d)
+endif
 
 SHELL_PATH ?= $(SHELL)
 # Shell quote;
tools/perf/Documentation/asciidoc.conf +3 -0
@@ -71,6 +71,9 @@ ifdef::backend-docbook[]
 [header]
 template::[header-declarations]
 <refentry>
+<refentryinfo>
+template::[docinfo]
+</refentryinfo>
 <refmeta>
 <refentrytitle>{mantitle}</refentrytitle>
 <manvolnum>{manvolnum}</manvolnum>
#1 lore raw

Hi Peter, Ingo, Arnaldo,

Quoted 19 lines · Ben Hutchings

This allows man pages to be built reproducibly.

---

tools/perf/Documentation/Makefile +3 -0
@@ -120,6 +120,9 @@ endif
 ifdef DOCBOOK_SUPPRESS_SP
 XMLTO_EXTRA += -m manpage-suppress-sp.xsl
 endif
+ifdef KBUILD_BUILD_TIMESTAMP
+ASCIIDOC_EXTRA += -a revdate=$(shell date -u -d '$(KBUILD_BUILD_TIMESTAMP)' +%Y-%m-%d)
+endif
 
 SHELL_PATH ?= $(SHELL)
 # Shell quote;

tools/perf/Documentation/asciidoc.conf ifdef::backend-docbook[] · line 79

Quoted 9 lines
tools/perf/Documentation/asciidoc.conf +3 -0
@@ -71,6 +71,9 @@ ifdef::backend-docbook[]
 [header]
 template::[header-declarations]
 <refentry>
+<refentryinfo>
+template::[docinfo]
+</refentryinfo>
 <refmeta>
 <refentrytitle>{mantitle}</refentrytitle>
 <manvolnum>{manvolnum}</manvolnum>

As we do apply the change in Downstream in Debian, I was wondering if it just felt trough the cracks and could still be applied. Is there anything missing?

Regards,
Salvatore

#2 lore raw

Em Tue, May 09, 2023 at 09:03:28PM +0200, Salvatore Bonaccorso escreveu:

Quoted 27 lines

Hi Peter, Ingo, Arnaldo,

Quoted 24 lines · Ben Hutchings

This allows man pages to be built reproducibly.

---

tools/perf/Documentation/Makefile +3 -0
@@ -120,6 +120,9 @@ endif
 ifdef DOCBOOK_SUPPRESS_SP
 XMLTO_EXTRA += -m manpage-suppress-sp.xsl
 endif
+ifdef KBUILD_BUILD_TIMESTAMP
+ASCIIDOC_EXTRA += -a revdate=$(shell date -u -d '$(KBUILD_BUILD_TIMESTAMP)' +%Y-%m-%d)
+endif
 
 SHELL_PATH ?= $(SHELL)
 # Shell quote;
tools/perf/Documentation/asciidoc.conf +2 -0
@@ -71,6 +71,9 @@ ifdef::backend-docbook[]
 [header]
 template::[header-declarations]
 <refentry>
+<refentryinfo>
+template::[docinfo]
Quoted 8 lines

tools/perf/Documentation/asciidoc.conf ifdef::backend-docbook[] · line 79

Quoted 4 lines
tools/perf/Documentation/asciidoc.conf +1 -0
+</refentryinfo>
 <refmeta>
 <refentrytitle>{mantitle}</refentrytitle>
 <manvolnum>{manvolnum}</manvolnum>

As we do apply the change in Downstream in Debian, I was wondering if it just felt trough the cracks and could still be applied. Is there anything missing?

Isn't this fixed in:

commit d586ac10ce56b2381b8e1d8ed74660c1b2b8ab0d

Author: Ian Rogers <[email protected]>
Date:   Fri Sep 20 21:13:27 2019 -0700

perf docs: Allow man page date to be specified

With this change if a perf_date parameter is provided to asciidoc then it will override the default date written to the man page metadata.

Without this change, or if the perf_date isn't specified, then the current date is written to the metadata.

Having this parameter allows the metadata to be constant if builds happen on different dates.

The name of the parameter is intended to be consistent with the existing perf_version parameter.

#3 lore raw
Quoted 39 lines · Arnaldo Carvalho de Melo

Em Tue, May 09, 2023 at 09:03:28PM +0200, Salvatore Bonaccorso escreveu:

Quoted 27 lines

Hi Peter, Ingo, Arnaldo,

Quoted 24 lines · Ben Hutchings

This allows man pages to be built reproducibly.

---

tools/perf/Documentation/Makefile +3 -0
@@ -120,6 +120,9 @@ endif
 ifdef DOCBOOK_SUPPRESS_SP
 XMLTO_EXTRA += -m manpage-suppress-sp.xsl
 endif
+ifdef KBUILD_BUILD_TIMESTAMP
+ASCIIDOC_EXTRA += -a revdate=$(shell date -u -d '$(KBUILD_BUILD_TIMESTAMP)' +%Y-%m-%d)
+endif
 
 SHELL_PATH ?= $(SHELL)
 # Shell quote;
tools/perf/Documentation/asciidoc.conf +2 -0
@@ -71,6 +71,9 @@ ifdef::backend-docbook[]
 [header]
 template::[header-declarations]
 <refentry>
+<refentryinfo>
+template::[docinfo]
Quoted 8 lines

tools/perf/Documentation/asciidoc.conf ifdef::backend-docbook[] · line 79

Quoted 4 lines
tools/perf/Documentation/asciidoc.conf +1 -0
+</refentryinfo>
 <refmeta>
 <refentrytitle>{mantitle}</refentrytitle>
 <manvolnum>{manvolnum}</manvolnum>

As we do apply the change in Downstream in Debian, I was wondering if it just felt trough the cracks and could still be applied. Is there anything missing?

Isn't this fixed in:

Quoted 8 lines

commit d586ac10ce56b2381b8e1d8ed74660c1b2b8ab0d

Author: Ian Rogers <[email protected]>
Date:   Fri Sep 20 21:13:27 2019 -0700

perf docs: Allow man page date to be specified

With this change if a perf_date parameter is provided to asciidoc then it will override the default date written to the man page metadata.

[...]

Not entirely, because the value for perf_date is currently generated with "git log", and Debian package builds are not done from a Git checkout. I'll revise my patch to allow perf_date to be set from KBUILD_BUILD_TIMESTAMP, which is already used in the kernel build.

Ben.

Signature · 2 lines
Ben Hutchings
Life would be so much easier if we could look at the source code.
#4 lore raw
Quoted 46 lines · Ben Hutchings
Quoted 45 lines · Arnaldo Carvalho de Melo

Em Tue, May 09, 2023 at 09:03:28PM +0200, Salvatore Bonaccorso escreveu:

Quoted 27 lines

Hi Peter, Ingo, Arnaldo,

Quoted 24 lines · Ben Hutchings

This allows man pages to be built reproducibly.

---

tools/perf/Documentation/Makefile +3 -0
@@ -120,6 +120,9 @@ endif
 ifdef DOCBOOK_SUPPRESS_SP
 XMLTO_EXTRA += -m manpage-suppress-sp.xsl
 endif
+ifdef KBUILD_BUILD_TIMESTAMP
+ASCIIDOC_EXTRA += -a revdate=$(shell date -u -d '$(KBUILD_BUILD_TIMESTAMP)' +%Y-%m-%d)
+endif
 
 SHELL_PATH ?= $(SHELL)
 # Shell quote;
tools/perf/Documentation/asciidoc.conf +2 -0
@@ -71,6 +71,9 @@ ifdef::backend-docbook[]
 [header]
 template::[header-declarations]
 <refentry>
+<refentryinfo>
+template::[docinfo]
Quoted 8 lines

tools/perf/Documentation/asciidoc.conf ifdef::backend-docbook[] · line 79

Quoted 4 lines
tools/perf/Documentation/asciidoc.conf +1 -0
+</refentryinfo>
 <refmeta>
 <refentrytitle>{mantitle}</refentrytitle>
 <manvolnum>{manvolnum}</manvolnum>

As we do apply the change in Downstream in Debian, I was wondering if it just felt trough the cracks and could still be applied. Is there anything missing?

Isn't this fixed in:

commit d586ac10ce56b2381b8e1d8ed74660c1b2b8ab0d

Author: Ian Rogers <[email protected]>
Date:   Fri Sep 20 21:13:27 2019 -0700

perf docs: Allow man page date to be specified

Quoted 7 lines
Quoted 2 lines

With this change if a perf_date parameter is provided to asciidoc then it will override the default date written to the man page metadata.

[...]

Not entirely, because the value for perf_date is currently generated with "git log", and Debian package builds are not done from a Git checkout.

Also, that only affects doc builds using the original asciidoc, not asciidoctor.

By the way, the perf_version variable mentioned in that commit is now always empty because PERF_VERSION is no longer defined in Makefiles. But at least when using asciidoctor, the value of perf_version doesn't seem to affect the output anyway.

Ben.

Quoted 5 lines

I'll revise my patch to allow perf_date to be set from
KBUILD_BUILD_TIMESTAMP, which is already used in the kernel build.

Ben.

Signature · 2 lines
Ben Hutchings
Life would be so much easier if we could look at the source code.