Skip to content
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

Closed
wants to merge 11 commits into from
Closed

Conversation

D-D-H
Copy link
Contributor

@D-D-H D-D-H commented Jun 22, 2021

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

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

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

@D-D-H
Copy link
Contributor Author

D-D-H commented Jun 22, 2021

/label add hotspot-jfr

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 22, 2021

👋 Welcome back ddong! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added rfr Pull request is ready for review hotspot-jfr hotspot-jfr-dev@openjdk.org labels Jun 22, 2021
@openjdk
Copy link

openjdk bot commented Jun 22, 2021

@D-D-H
The hotspot-jfr label was successfully added.

@mlbridge
Copy link

mlbridge bot commented Jun 22, 2021

@egahlin
Copy link
Member

egahlin commented Jun 22, 2021

/csr

@openjdk openjdk bot added the csr Pull request needs approved CSR before integration label Jun 22, 2021
@openjdk
Copy link

openjdk bot commented Jun 22, 2021

@egahlin has indicated that a compatibility and specification (CSR) request is needed for this pull request.
@D-D-H please create a CSR request for issue JDK-8261441. This pull request cannot be integrated until the CSR request is approved.

@egahlin
Copy link
Member

egahlin commented Jun 23, 2021

Why is not %t useful?

If you start multiple processes, the same PID can be reused and cause a collision.

@D-D-H
Copy link
Contributor Author

D-D-H commented Jun 23, 2021

Why is not %t useful?

If you start multiple processes, the same PID can be reused and cause a collision.

Makes sense.
%t support is added.

Thanks

i++;
} else if (nc == 't') {
if (time == null) {
time = new SimpleDateFormat("yyyy-MM-dd_HH-mm-ss").format(new Date());
Copy link
Contributor Author

@D-D-H D-D-H Jun 23, 2021

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.

Copy link
Member

@egahlin egahlin Jun 23, 2021

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good suggestion.
Fixed.

@bridgekeeper
Copy link

bridgekeeper bot commented Jul 21, 2021

@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!

@openjdk openjdk bot removed the csr Pull request needs approved CSR before integration label Jul 25, 2021
@openjdk
Copy link

openjdk bot commented Jul 25, 2021

@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:

8261441: JFR: Filename expansion

Reviewed-by: jbachorik, egahlin

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 master branch:

  • 3ab95d1: 8271905: mark hotspot runtime/Metaspace tests which ignore external VM flags
  • e2c5bfe: 8271308: (fc) FileChannel.transferTo() transfers no more than Integer.MAX_VALUE bytes in one call
  • 7234a43: 8271953: fix mis-merge in JDK-8271878
  • d7fc9e4: 8267840: Improve URLStreamHandler.parseURL()
  • 55bd52a: 8271840: Add simple Integer.toString microbenchmarks
  • 18dd4d4: 8271121: ZGC: stack overflow (segv) when -Xlog:gc+start=debug
  • 685fc3c: 8270903: sun.net.httpserver.HttpConnection: Improve toString
  • 4abe531: 8271722: [TESTBUG] gc/g1/TestMixedGCLiveThreshold.java can fail if G1 Full GC uses >1 workers
  • ea9a595: 8270058: Use Objects.check{Index,FromIndexSize} for java.desktop
  • 64d18d4: 4819544: SwingSet2 JTable Demo throws NullPointerException
  • ... and 583 more: https://git.openjdk.java.net/jdk/compare/0458113c6b1cf500ffdf049c1e3a698b16ce12ce...master

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 /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jul 25, 2021
@D-D-H
Copy link
Contributor Author

D-D-H commented Jul 26, 2021

@egahlin
Thank you very much for helping to refine the content of CSR.
I have updated the corresponding man page.

@D-D-H
Copy link
Contributor Author

D-D-H commented Aug 4, 2021

@egahlin
Hi Erik,
Could you help review this pr?

@@ -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);
Copy link
Member

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)

Copy link
Contributor Author

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.

@D-D-H
Copy link
Contributor Author

D-D-H commented Aug 5, 2021

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Aug 5, 2021
@openjdk
Copy link

openjdk bot commented Aug 5, 2021

@D-D-H
Your change (at version fbde563) is now ready to be sponsored by a Committer.

@y1yang0
Copy link
Member

y1yang0 commented Aug 6, 2021

/sponsor

@openjdk
Copy link

openjdk bot commented Aug 6, 2021

Going to push as commit adb0ae5.
Since your change was applied there have been 600 commits pushed to the master branch:

  • e38e365: 8271208: Typo in ModuleDescriptor.read javadoc
  • 14692d5: Merge
  • dfacda4: 8270872: Final nroff manpage update for JDK 17
  • 90f85ff: 8271588: JFR Recorder Thread crashed with SIGSEGV in write_klass
  • f312f28: 8271863: ProblemList serviceability/sa/TestJmapCore.java on linux-x64 with ZGC
  • 62e72ad: 8271293: Monitor class should use ThreadBlockInVMPreprocess
  • cb36880: 8270116: Expand ButtonGroupLayoutTraversalTest.java to run in all LaFs, including Aqua on macOS
  • 3ab95d1: 8271905: mark hotspot runtime/Metaspace tests which ignore external VM flags
  • e2c5bfe: 8271308: (fc) FileChannel.transferTo() transfers no more than Integer.MAX_VALUE bytes in one call
  • 7234a43: 8271953: fix mis-merge in JDK-8271878
  • ... and 590 more: https://git.openjdk.java.net/jdk/compare/0458113c6b1cf500ffdf049c1e3a698b16ce12ce...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Aug 6, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels Aug 6, 2021
@openjdk
Copy link

openjdk bot commented Aug 6, 2021

@kelthuzadx @D-D-H Pushed as commit adb0ae5.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-jfr hotspot-jfr-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

4 participants