Bug#1081975: llvm-exegesis-16.1: Some remarks and editorial changes for this man page
Bjarni Ingi Gislason
bjarniig at simnet.is
Tue Sep 17 03:06:27 BST 2024
Package: llvm-16
Version: 1:16.0.6-27+b1
Severity: minor
Tags: patch
* What led up to the situation?
Checking for defects with
[test-]groff -mandoc -t -K utf8 -rF0 -rHY=0 -ww -b -z < "man page"
[test-groff is a script in the repository for "groff"] (local copy and
"troff" slightly changed by me).
* What was the outcome of this action?
troff: backtrace: '/home/bg/git/groff/build/s-tmac/an.tmac':561: macro 'B'
troff: backtrace: file '<stdin>':251
troff:<stdin>:251: warning: [page 3, 4.3i (diversion 'an*paragraph-tag', 0.0i)]: cannot break line
* What outcome did you expect instead?
No output (no warnings).
-.-
General remarks and further material, if a diff-file exist, are in the
attachments.
-- System Information:
Debian Release: trixie/sid
APT prefers testing
APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Kernel: Linux 6.10.9-amd64 (SMP w/2 CPU threads; PREEMPT)
Locale: LANG=is_IS.iso88591, LC_CTYPE=is_IS.iso88591 (charmap=ISO-8859-1), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: sysvinit (via /sbin/init)
Versions of packages llvm-16 depends on:
ii libc6 2.40-2
ii libcurl4t64 8.9.1-2
ii libgcc-s1 14.2.0-3
ii libllvm16t64 1:16.0.6-27+b1
ii libpfm4 4.13.0+git32-g0d4ed0e-1
ii libstdc++6 14.2.0-3
ii libtinfo6 6.5-2
ii libzstd1 1.5.6+dfsg-1
ii llvm-16-linker-tools 1:16.0.6-27+b1
ii llvm-16-runtime 1:16.0.6-27+b1
ii zlib1g 1:1.3.dfsg+really1.3.1-1
Versions of packages llvm-16 recommends:
pn llvm-16-dev <none>
Versions of packages llvm-16 suggests:
pn llvm-16-doc <none>
-- no debconf information
-------------- next part --------------
Any program (person), that produces man pages, should check its content for
defects by using
groff -mandoc -t -ww -b -z [ -K utf8 | k ] <man page>
The same goes for man pages that are used as an input.
For a style guide use
mandoc -T lint
-.-
So any 'generator' should check its products with the above mentioned
'groff', 'mandoc', and additionally with 'nroff ...'.
This is just a simple quality control measure.
The 'generator' may have to be corrected to get a better man page,
the source file may, and any additional file may.
Common defects:
Input text line longer than 80 bytes.
Not removing trailing spaces (in in- and output).
The reason for these trailing spaces should be found and eliminated.
Not beginning each input sentence on a new line.
Lines should thus be shorter.
See man-pages(7), item 'semantic newline'.
-.-
The difference between the formatted outputs can be seen with:
nroff -mandoc <file1> > <out1>
nroff -mandoc <file2> > <out2>
diff -u <out1> <out2>
and for groff, using
"printf '%s\n%s\n' '.kern 0' '.ss 12 0' | groff -mandoc -Z - "
instead of \'nroff -mandoc\'
Add the option \'-t\', if the file contains a table.
Read the output of \'diff -u\' with \'less -R\' or similar.
-.-.
If \'man\' (man-db) is used to check the manual for warnings,
the following must be set:
The option "-warnings=w"
The environmental variable:
export MAN_KEEP_STDERR=yes (or any non-empty value)
or
(produce only warnings):
export MANROFFOPT="-ww -b -z"
export MAN_KEEP_STDERR=yes (or any non-empty value)
-.-.
Output from "mandoc -T lint llvm-exegesis-16.1": (possibly shortened list)
mandoc: llvm-exegesis-16.1:34:2: WARNING: skipping paragraph macro: sp after SH
mandoc: llvm-exegesis-16.1:37:2: WARNING: skipping paragraph macro: sp after SH
mandoc: llvm-exegesis-16.1:44:88: STYLE: input text line longer than 80 bytes: possible so that we ...
mandoc: llvm-exegesis-16.1:51:86: STYLE: input text line longer than 80 bytes: The main goal of thi...
mandoc: llvm-exegesis-16.1:57:2: WARNING: skipping paragraph macro: sp after SH
mandoc: llvm-exegesis-16.1:69:88: STYLE: input text line longer than 80 bytes: Measuring the uop de...
mandoc: llvm-exegesis-16.1:116:2: WARNING: skipping paragraph macro: sp after SH
mandoc: llvm-exegesis-16.1:130:89: STYLE: input text line longer than 80 bytes: use has a correspond...
mandoc: llvm-exegesis-16.1:136:86: STYLE: input text line longer than 80 bytes: directive \fILLVM\-E...
mandoc: llvm-exegesis-16.1:137:86: STYLE: input text line longer than 80 bytes: is a bit pattern use...
mandoc: llvm-exegesis-16.1:140:83: STYLE: input text line longer than 80 bytes: Mark the register as...
mandoc: llvm-exegesis-16.1:160:2: WARNING: skipping paragraph macro: sp after SH
mandoc: llvm-exegesis-16.1:177:83: STYLE: input text line longer than 80 bytes: characteristics. The...
mandoc: llvm-exegesis-16.1:204:83: STYLE: input text line longer than 80 bytes: example, \fI/tmp/inc...
mandoc: llvm-exegesis-16.1:221:83: STYLE: input text line longer than 80 bytes: Either \fIopcode\-in...
mandoc: llvm-exegesis-16.1:228:83: STYLE: input text line longer than 80 bytes: Either \fIopcode\-in...
mandoc: llvm-exegesis-16.1:234:83: STYLE: input text line longer than 80 bytes: Either \fIopcode\-in...
mandoc: llvm-exegesis-16.1:239:84: STYLE: input text line longer than 80 bytes: Specify the run mode...
mandoc: llvm-exegesis-16.1:252:83: STYLE: input text line longer than 80 bytes: By default, when \fI...
mandoc: llvm-exegesis-16.1:257:129: STYLE: input text line longer than 80 bytes: * \fBprepare\-and\-a...
mandoc: llvm-exegesis-16.1:258:188: STYLE: input text line longer than 80 bytes: * \fBassemble\-measu...
mandoc: llvm-exegesis-16.1:259:87: STYLE: input text line longer than 80 bytes: * \fBmeasure\fP: Sam...
mandoc: llvm-exegesis-16.1:265:86: STYLE: input text line longer than 80 bytes: When a positive valu...
mandoc: llvm-exegesis-16.1:267:97: STYLE: input text line longer than 80 bytes: On choosing the \[u2...
mandoc: llvm-exegesis-16.1:287:82: STYLE: input text line longer than 80 bytes: snippet until the lo...
mandoc: llvm-exegesis-16.1:301:84: STYLE: input text line longer than 80 bytes: repetition count of ...
mandoc: llvm-exegesis-16.1:328:94: STYLE: input text line longer than 80 bytes: File to read (\fIana...
mandoc: llvm-exegesis-16.1:334:90: STYLE: input text line longer than 80 bytes: If provided, write t...
mandoc: llvm-exegesis-16.1:340:81: STYLE: input text line longer than 80 bytes: If non\-empty, write...
mandoc: llvm-exegesis-16.1:417:2: WARNING: skipping paragraph macro: sp after SH
-.-.
Change '-' (\-) to '\(en' (en-dash) for a numeric range.
GNU gnulib has recently (2023-06-18) updated its
"build_aux/update-copyright" to recognize "\(en" in man pages.
llvm-exegesis-16.1:423:2003-2024, LLVM Project
-.-.
Add a comma (or \&) after "e.g." and "i.e.", or use English words
(man-pages(7)).
Abbreviation points should be protected against being interpreted as
an end of sentence, if they are not, and that independent of the
current place on the line.
129:\fBllvm\-exegesis\fP checks the liveliness of registers (i.e. any register
-.-.
Wrong distance between sentences in the input file.
Separate the sentences and subordinate clauses; each begins on a new
line. See man-pages(7) ("Conventions for source file layout") and
"info groff" ("Input Conventions").
The best procedure is to always start a new sentence on a new line,
at least, if you are typing on a computer.
Remember coding: Only one command ("sentence") on each (logical) line.
E-mail: Easier to quote exactly the relevant lines.
Generally: Easier to edit the sentence.
Patches: Less unaffected text.
Search for two adjacent words is easier, when they belong to the same line,
and the same phrase.
The amount of space between sentences in the output can then be
controlled with the ".ss" request.
N.B.
The number of lines affected can be too large to be in the patch.
43:generates a code snippet that makes execution as serial (resp. as parallel) as
44:possible so that we can measure the latency (resp. inverse throughput/uop decomposition)
47:host subtarget. The time taken (resp. resource usage) is measured using
48:hardware performance counters. The result is printed out as YAML
52:scheduling models. To that end, we also provide analysis of the results.
58:Assume you have an X86\-64 machine. To measure the latency of a single
129:\fBllvm\-exegesis\fP checks the liveliness of registers (i.e. any register
130:use has a corresponding def or is a ???live in???). If your code depends on the
134:Mark the register as requiring a definition. \fBllvm\-exegesis\fP will
135:automatically assign a value to the register. This can be done using the
137:is a bit pattern used to fill \fI<reg_name>\fP\&. If \fI<hex_value>\fP is smaller than
140:Mark the register as a ???live in???. \fBllvm\-exegesis\fP will benchmark
141:using whatever value was in this registers on entry. This can be done using
177:characteristics. The clusters will be written out to \fI/tmp/clusters.csv\fP in the
203:inconsistencies in the scheduling information. The output is an html file. For
209:be shown. This does not invalidate any of the analysis results though.
219:Specify the opcode to measure, by index. Specifying \fI\-1\fP will result
220:in measuring every existing opcode. See example 1 for details.
226:Specify the opcode to measure, by name. Several opcodes can be specified as
227:a comma\-separated list. See example 1 for details.
233:Specify the custom code snippet to measure. See example 2 for details.
239:Specify the run mode. Note that some modes have additional requirements and options.
255:However, it is possible to stop at some stage before measuring. Choices are:
258:* \fBassemble\-measured\-code\fP: Same as \fBprepare\-and\-assemble\-snippet\fP\&. but also creates the full sequence that can be dumped to a file using \fB\-\-dump\-object\-to\-disk\fP\&.
268:could occur if the sampling is too frequent. A prime number should be used to
277:particularly on older hardware. Comparing baseline results with this mode
284:Specify the repetition mode. \fIduplicate\fP will create a large, straight line
286:\fInum\-repetitions\fP/\fIsnippet size\fP times). \fIloop\fP will, optionally, duplicate the
290:\fInum\-repetitions\fP/\fIsnippet size\fP times). The \fIloop\fP mode, especially with loop
293:iterations. If performing an analysis over many opcodes, it may be best to
300:Specify the target number of executed instructions. Note that the actual
309:loop body contains at least this many instructions. This potentially results
318:enough to characterize an opcode. This might not be true of all instructions:
320:depends on the value of assigned registers and immediates. Setting a value of
329:modes) benchmark results. ???\-??? uses stdin/stdout.
334:If provided, write the analysis clusters as CSV to this file. ???\-??? prints to
335:stdout. By default, this analysis is not run.
340:If non\-empty, write inconsistencies found during analysis to this file. \fI\-\fP
341:prints to stdout. By default, this analysis is not run.
347:to only look at those that to not involve memory, or vice versa. This option
355:Specify the clustering algorithm to use. By default DBSCAN will be used.
383:characteristics are different. by default all such opcodes are filtered out.
394:Target triple. See \fI\-version\fP for available targets.
399:If set, measure the cpu characteristics using the counters for this CPU. This
414:enable code inspection. Disabled by default.
418:\fBllvm\-exegesis\fP returns 0 on success. Otherwise, an error message is
-.-.
Split lines longer than 80 characters into two or more lines.
Appropriate break points are the end of a sentence and a subordinate
clause; after punctuation marks.
N.B.
The number of lines affected can be too large to be in the patch.
Line 44, length 88
possible so that we can measure the latency (resp. inverse throughput/uop decomposition)
Line 51, length 81
The main goal of this tool is to automatically (in)validate the LLVM???s TableDef
Line 69, length 88
Measuring the uop decomposition or inverse throughput of an instruction works similarly:
Line 136, length 86
directive \fILLVM\-EXEGESIS\-DEFREG <reg name> <hex_value>\fP, where \fI<hex_value>\fP
Line 137, length 86
is a bit pattern used to fill \fI<reg_name>\fP\&. If \fI<hex_value>\fP is smaller than
Line 177, length 83
characteristics. The clusters will be written out to \fI/tmp/clusters.csv\fP in the
Line 193, length 97
2,VPADDQYrr,,VPADDBYrr_VPADDDYrr_VPADDQYrr_VPADDWYrr_VPSUBBYrr_VPSUBDYrr_VPSUBQYrr_VPSUBWYrr,1.02
Line 194, length 97
2,VPSUBQYrr,,VPADDBYrr_VPADDDYrr_VPADDQYrr_VPADDWYrr_VPSUBBYrr_VPSUBDYrr_VPSUBQYrr_VPSUBWYrr,1.01
Line 204, length 83
example, \fI/tmp/inconsistencies.html\fP will contain messages like the following :
Line 221, length 83
Either \fIopcode\-index\fP, \fIopcode\-name\fP or \fIsnippets\-file\fP must be set.
Line 228, length 83
Either \fIopcode\-index\fP, \fIopcode\-name\fP or \fIsnippets\-file\fP must be set.
Line 234, length 83
Either \fIopcode\-index\fP, \fIopcode\-name\fP or \fIsnippets\-file\fP must be set.
Line 239, length 84
Specify the run mode. Note that some modes have additional requirements and options.
Line 247, length 97
\fI\-analysis\-clusters\-output\-file=\fP and \fI\-analysis\-inconsistencies\-output\-file=\fP\&.
Line 251, length 107
.B \-\-benchmark\-phase=[prepare\-snippet|prepare\-and\-assemble\-snippet|assemble\-measured\-code|measure]
Line 252, length 83
By default, when \fI\-mode=\fP is specified, the generated snippet will be executed
Line 257, length 129
* \fBprepare\-and\-assemble\-snippet\fP: Same as \fBprepare\-snippet\fP, but also dumps an excerpt of the sequence (hex encoded).
Line 258, length 188
* \fBassemble\-measured\-code\fP: Same as \fBprepare\-and\-assemble\-snippet\fP\&. but also creates the full sequence that can be dumped to a file using \fB\-\-dump\-object\-to\-disk\fP\&.
Line 259, length 87
* \fBmeasure\fP: Same as \fBassemble\-measured\-code\fP, but also runs the measurement.
Line 265, length 86
When a positive value is specified for this option and when the mode is \fIlatency\fP,
Line 267, length 87
On choosing the ???right??? sampling period, a small value is preferred, but throttling
Line 286, length 92
\fInum\-repetitions\fP/\fIsnippet size\fP times). \fIloop\fP will, optionally, duplicate the
Line 287, length 82
snippet until the loop body contains at least \fIloop\-body\-size\fP instructions,
Line 290, length 91
\fInum\-repetitions\fP/\fIsnippet size\fP times). The \fIloop\fP mode, especially with loop
Line 301, length 84
repetition count of the snippet will be \fInum\-repetitions\fP/\fIsnippet size\fP\&.
Line 321, length 92
\fI\-max\-configs\-per\-opcode\fP larger than \fI1\fP allows \fIllvm\-exegesis\fP to explore
Line 328, length 94
File to read (\fIanalysis\fP mode) or write (\fIlatency\fP/\fIuops\fP/\fIinverse_throughput\fP
Line 340, length 81
If non\-empty, write inconsistencies found during analysis to this file. \fI\-\fP
Line 357, length 83
\fI\-analysis\-inconsistencies\-output\-file=\fP output, it will create one cluster
-.-.
Output from "test-groff -b -mandoc -rF0 -rHY=0 -K utf8 -t -ww -z ":
troff: backtrace: '/home/bg/git/groff/build/s-tmac/an.tmac':561: macro 'B'
troff: backtrace: file '<stdin>':251
troff:<stdin>:251: warning: [page 3, 4.3i (diversion 'an*paragraph-tag', 0.0i)]: cannot break line
-------------- next part --------------
--- llvm-exegesis-16.1 2024-09-17 01:33:27.284828178 +0000
+++ llvm-exegesis-16.1.new 2024-09-17 01:52:27.318619706 +0000
@@ -40,11 +40,12 @@ in LLVM to measure host machine instruct
throughput, or port decomposition.
.sp
Given an LLVM opcode name and a benchmarking mode, \fBllvm\-exegesis\fP
-generates a code snippet that makes execution as serial (resp. as parallel) as
-possible so that we can measure the latency (resp. inverse throughput/uop decomposition)
+generates a code snippet that makes execution as serial (resp.\& as parallel) as
+possible so that we can measure the latency
+(resp.\& inverse throughput/uop decomposition)
of the instruction.
The code snippet is jitted and, unless requested not to, executed on the
-host subtarget. The time taken (resp. resource usage) is measured using
+host subtarget. The time taken (resp.\& resource usage) is measured using
hardware performance counters. The result is printed out as YAML
to the standard output.
.sp
@@ -126,7 +127,7 @@ $ echo \(dqvzeroupper\(dq | llvm\-exeges
.UNINDENT
.sp
Real\-life code snippets typically depend on registers or memory.
-\fBllvm\-exegesis\fP checks the liveliness of registers (i.e. any register
+\fBllvm\-exegesis\fP checks the liveliness of registers (i.e., any register
use has a corresponding def or is a ???live in???). If your code depends on the
value of some registers, you have two options:
.INDENT 0.0
@@ -420,6 +421,6 @@ printed to standard error, and the tool
.SH AUTHOR
Maintained by the LLVM Team (https://llvm.org/).
.SH COPYRIGHT
-2003-2024, LLVM Project
+2003\(en2024, LLVM Project
.\" Generated by docutils manpage writer.
.
More information about the Pkg-llvm-team
mailing list