-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8357828: Add a timestamp to jcmd diagnostic commands #27368
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
base: master
Are you sure you want to change the base?
Conversation
👋 Welcome back Domest0s! A progress list of the required criteria for merging this PR into |
❗ This change is not yet ready to be integrated. |
@Domest0s 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. |
@@ -1063,6 +1090,7 @@ ThreadDumpToFileDCmd::ThreadDumpToFileDCmd(outputStream* output, bool heap) : | |||
} | |||
|
|||
void ThreadDumpToFileDCmd::execute(DCmdSource source, TRAPS) { | |||
print_local_time(output()); |
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 assume you didn't mean to print a time stamp here as the output already has a timestamp. Also for -format=json and sending the output to stdout, then it will be unparsable if a timestamp appears before the JSON object.
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.
Hi Alan. That's right.
My mistake. I declared the intention to not have timestamps for commands with a throwaway stdout
. This also includes "Thread.dump_to_file" command but then mistakenly added print_local_time()
in here.
Internal testing tier 1-5 did not show any issues. |
jcmd
provides great diagnostics but many commands lack a timestamp in their output.Adding a timestamp to the output of some would add value for those debugging JVM data.
Some diagnostic commands already provide timestamps. For example
Thread.print
already prints timestamp in a "yyyy-MM-dd HH:mm:ss" format.Adding timestamps to all diagnostic
jcmd
commands with a non-throw-away STDOUT.The exceptions are:
VM.uptime
- command run with-date
argument will also print a timestamp;VM.system_properties
- already lists timestampThread.dump_to_file
- the content dumped to file already has a timestamp;VM.version
Progress
Issue
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/27368/head:pull/27368
$ git checkout pull/27368
Update a local copy of the PR:
$ git checkout pull/27368
$ git pull https://git.openjdk.org/jdk.git pull/27368/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 27368
View PR using the GUI difftool:
$ git pr show -t 27368
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/27368.diff
Using Webrev
Link to Webrev Comment