-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
8261441: JFR: Filename expansion #4550
Conversation
/label add hotspot-jfr |
👋 Welcome back ddong! A progress list of the required criteria for merging this PR into |
@D-D-H |
Webrevs
|
/csr |
@egahlin has indicated that a compatibility and specification (CSR) request is needed for this pull request. |
Why is not If you start multiple processes, the same PID can be reused and cause a collision. |
Makes sense. Thanks |
i++; | ||
} else if (nc == 't') { | ||
if (time == null) { | ||
time = new SimpleDateFormat("yyyy-MM-dd_HH-mm-ss").format(new Date()); |
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 use the current time here so that different filenames could be generated for multiple dumps of one process.
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.
There is a method, jdk.internal.Utils::formatDateTime, which is used to generate a filename if a directory is specified (instead of file). It would be good if the same format and method could be used with '%t'. That method would avoid loading the SimpleDateFormat class and other time/formatting related classes.
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 suggestion.
Fixed.
@D-D-H This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
@D-D-H 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 593 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. As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@jbachorik, @egahlin) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
@egahlin |
@egahlin |
@@ -191,7 +192,7 @@ protected final void print(String s) { | |||
} | |||
|
|||
protected final void print(String s, Object... args) { | |||
currentLine.append(String.format(s, args)); | |||
currentLine.append(args != null && args.length > 0 ? String.format(s, args) : s); |
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.
Why is args != null check needed?
(Fail fast may be preferable if something unexpected happens)
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.
This check is not necessary(args is not null even if no any arg passes in), removed.
/integrate |
/sponsor |
Going to push as commit adb0ae5.
Your commit was automatically rebased without conflicts. |
Hi,
Could I have a review of this change that let the users could use
%p
in the filename to represent the PID when JFR.start/stop/dump.I haven't implemented%t
described in the issue, because I don't think it's very useful.Best,
Denghui Dong
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/4550/head:pull/4550
$ git checkout pull/4550
Update a local copy of the PR:
$ git checkout pull/4550
$ git pull https://git.openjdk.java.net/jdk pull/4550/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 4550
View PR using the GUI difftool:
$ git pr show -t 4550
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/4550.diff