RFR: 8336041: Doccheck: the jfr command doesn't show the correct command-line options

Nizar Benalla nbenalla at openjdk.org
Tue Nov 19 18:10:38 UTC 2024


After [JDK-8344056](https://bugs.openjdk.org/browse/JDK-8344056), we can now easily fix these typos that caused errors when rendering the HTML.

While I didn't find anything in the markdown spec mentioning escaping angle brackets, this [stackoverflow answer](https://meta.stackoverflow.com/questions/288707/how-do-you-show-words-surrounded-by-angle-brackets) says that we should use HTML entities for angle brackets. Otherwise the content inside `<>` is not shown. Doing so seems to fix the bug in the generated HTML.

The output of the man pages is also broken (you can verify on your local machines as this bug exists exists in older JDKs)


   jfr metadata subcommand
       Use jfr metadata to display information about events, such as event names, categories and field layout within a flight recording file.

       The syntax is:

       jfr metadata [--categories ] [--events ] []


Before:

<img width="750" alt="Screenshot 2024-11-19 at 17 13 58" src="https://github.com/user-attachments/assets/a94053a1-49f1-43c6-8116-fbc711c51920">

<img width="722" alt="Screenshot 2024-11-19 at 17 13 46" src="https://github.com/user-attachments/assets/2d6105d1-b55d-473f-8ba7-48c37d147659">

<img width="319" alt="Screenshot 2024-11-19 at 17 14 18" src="https://github.com/user-attachments/assets/c4ccc5e7-1f2f-4ce1-a1fc-e04368449209">

After:

<img width="850" alt="Screenshot 2024-11-19 at 17 25 22" src="https://github.com/user-attachments/assets/a4b3f6ac-ffc4-4b73-9ffa-562195081042">
<img width="781" alt="Screenshot 2024-11-19 at 17 25 48" src="https://github.com/user-attachments/assets/76edc5cb-1be2-4c5b-bdc7-32c3ac6c8412">
<img width="496" alt="Screenshot 2024-11-19 at 18 33 29" src="https://github.com/user-attachments/assets/647a68cc-5804-4e61-b4e2-de788e790a0b">

Here is the diff in the HTML after the change 


--- build/macosx-aarch64/images/docs/specs/man/jfr.html 2024-11-19 17:08:08
+++ build/macosx-aarch64/images/test/docs/specs/man/jfr.html    2024-11-19 17:04:30
@@ -225,8 +225,7 @@
 <p>Use <code>jfr configure</code> to configure a .jfc settings file.</p>
 <p>The syntax is:</p>
 <p><code>jfr configure</code> [--interactive] [--verbose] [--input
-<files>] [--output <file>] [option=value]*
-[event-setting=value]*</p>
+<files>] [--output <file>] [option=value]* [event-setting=value]*</p>
 <dl>
 <dt><a id="configure-option-interactive"><code>--interactive</code></a></dt>
 <dd>
@@ -272,8 +271,8 @@
 such as event names, categories and field layout within a flight
 recording file.</p>
 <p>The syntax is:</p>
-<p><code>jfr metadata</code> [--categories <filter>] [--events
-<filter>] [<file>]</p>
+<p><code>jfr metadata</code> [--categories <filter>] [--events <filter>]
+[<file>]</p>
 <dl>
 <dt><a id="metadata-option-categories"><code>--categories</code>
 <<em>filter</em>></a></dt>
@@ -292,8 +291,8 @@
 Location of the recording file (.jfr)
 </dd>
 </dl>
-<p>If the <file> parameter is omitted, metadata from the JDK where
-the 'jfr' tool is located will be used.</p>
+<p>If the <file> parameter is omitted, metadata from the JDK where the
+'jfr' tool is located will be used.</p>
 <h4 id="jfr-summary-subcommand"><code>jfr summary</code> subcommand</h4>
 <p>Use <code>jfr summary</code> to print statistics for a recording. For
 example, a summary can illustrate the number of recorded events and how



Here is the diff between the two troff files


213,214c213,214
< \f[V]jfr configure\f[R] [--interactive] [--verbose] [--input ] [--output
< ] [option=value]* [event-setting=value]*
---
> \f[V]jfr configure\f[R] [--interactive] [--verbose] [--input <files>]
> [--output <file>] [option=value]* [event-setting=value]*
255c255,256
< \f[V]jfr metadata\f[R] [--categories ] [--events ] []
---
> \f[V]jfr metadata\f[R] [--categories <filter>] [--events <filter>]
> [<file>]
270c271
< If the parameter is omitted, metadata from the JDK where the
---
> If the <file> parameter is omitted, metadata from the JDK where the

-------------

Commit messages:
 - use < html entity

Changes: https://git.openjdk.org/jdk/pull/22247/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22247&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8336041
  Stats: 5 lines in 1 file changed: 0 ins; 0 del; 5 mod
  Patch: https://git.openjdk.org/jdk/pull/22247.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/22247/head:pull/22247

PR: https://git.openjdk.org/jdk/pull/22247


More information about the hotspot-jfr-dev mailing list