-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8370071: Clarify jcmd Thread.print help message #27861
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
👋 Welcome back coffeys! A progress list of the required criteria for merging this PR into |
@coffeys This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 20 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
@coffeys The following labels will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
Any issues if I add this sentence to the help output ? “Use Thread.dump_to_file command for extended threads detail including virtual thread information." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, this could be clearer.
If you want to expand this:
Elsewhere for ThreadDumpToFileDCmd we say:
"Dump threads, with stack traces, to a file in plain text or JSON format."
We could add on: "Includes virtual threads." or add in that fact somehow.
There's also a man page ./src/jdk.jcmd/share/man/jcmd.md where we have the same text for both commands. 8-)
static const char* name() { return "Thread.print"; } | ||
static const char* description() { | ||
return "Print all threads with stacktraces."; | ||
return "Print all platform threads with stacktraces."; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Thread.print section of the jcmd man page can be updated to align with the update description.
If there is space, then we could include "and all mounted virtual threads".
(Note that there was a previous attempt to change this description when the Thread.print was updated to include mounted virtual threads. At the time, the PR feedback was to separate it to a different PR but there wasn't any follow-up on that so good to see it re-visited here)
Thanks for the man page reminder Kevin. I've added some extra help information also. I think it'll help guide users of these tools. PR updated. |
Saying "extended threads detail", or even "extended thread details" is a bit vague. It's not clear what Thread.print misses out, or if this will always be true. Could it be just: "Use Thread.dump_to_file for virtual thread information." |
} | ||
static const char *description() { | ||
return "Dump threads, with stack traces, to a file in plain text or JSON format."; | ||
return "Dump threads (including virtual), with stack traces, " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you change it to "Dump all threads" then it would be simpler.
return "Print all platform threads with stacktraces."; | ||
return "Print all platform threads with stacktraces. " | ||
"Use Thread.dump_to_file command for extended threads " | ||
"detail including virtual thread information."; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you try "Print all platform threads, and mounted virtual threads, with stack traces"?
Not sure about the second line. I assume you are proposing to add this in order to created awareness but saying "extended threads detail" is confusing. If a second line is added then it could be very simple, e.g. "The Thread.dump_to_file command will print all threads to a file".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes - nice to have the "mounted virtual threads" clarity.
"The Thread.dump_to_file command will print all threads to a file". --> Will run with that. thanks.
I think it's useful to hint at these commands when end users are reading such help messages.
(e.g. "I want to print thread information but this command is telling me I only get platform + mounted threads.. what do I use for all threads etc.")
Yes - that's a fair point. The dump_to_file option also prints j.u.c Lock information for virtual theads. (hence extended) but yes, "Use Thread.dump_to_file for virtual thread information." sounds better. Maybe even ""Use Thread.dump_to_file for all thread information." based on Alan's comment. |
By: "Use Thread.dump_to_file for all thread information." |
Thanks for the reviews /integrate |
Going to push as commit ee35320.
Your commit was automatically rebased without conflicts. |
return "Print all threads with stacktraces."; | ||
return "Print all platform threads, and mounted virtual threads, " | ||
"with stack traces. The Thread.dump_to_file command will " | ||
"print all threads to a file."; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still in two minds about having it mention Thread.dump_to_file. If it is mentioned then it would be better to put in a line break and use "may be used to" that rather than "will".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes - happy to tweak this in follow on issue if necessary. I think it reads fine as is but let me know the final format and I'll file a new PR.
Simple tweak to jcmd Thread.print help message
jdk_svc test group ran and green
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/27861/head:pull/27861
$ git checkout pull/27861
Update a local copy of the PR:
$ git checkout pull/27861
$ git pull https://git.openjdk.org/jdk.git pull/27861/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 27861
View PR using the GUI difftool:
$ git pr show -t 27861
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/27861.diff
Using Webrev
Link to Webrev Comment