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

8277397: ZGC: Add JFR event for temporary latency measurements #6454

Closed
wants to merge 3 commits into from

Conversation

stefank
Copy link
Member

@stefank stefank commented Nov 18, 2021

I often measure latencies and stalls using JFR events. I'd like to add an event that can be used for these ad-hoc measurements during development and debugging.


Progress

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

Issue

  • JDK-8277397: ZGC: Add JFR event for temporary latency measurements

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/6454/head:pull/6454
$ git checkout pull/6454

Update a local copy of the PR:
$ git checkout pull/6454
$ git pull https://git.openjdk.java.net/jdk pull/6454/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 6454

View PR using the GUI difftool:
$ git pr show -t 6454

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/6454.diff

@stefank
Copy link
Member Author

@stefank stefank commented Nov 18, 2021

/label hotspot-gc jfr

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Nov 18, 2021

👋 Welcome back stefank! 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 the rfr label Nov 18, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Nov 18, 2021

@stefank The label jfr is not a valid label. These labels are valid:

  • serviceability
  • hotspot
  • hotspot-compiler
  • ide-support
  • kulla
  • i18n
  • shenandoah
  • jdk
  • javadoc
  • security
  • hotspot-runtime
  • jmx
  • build
  • nio
  • client
  • core-libs
  • compiler
  • net
  • hotspot-gc
  • hotspot-jfr

@openjdk
Copy link

@openjdk openjdk bot commented Nov 18, 2021

@stefank The following label will be automatically applied to this pull request:

  • hotspot

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the hotspot label Nov 18, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Nov 18, 2021

Webrevs

@stefank
Copy link
Member Author

@stefank stefank commented Nov 18, 2021

/label hotspot-gc hotspot-jfr

@openjdk openjdk bot added hotspot-gc hotspot-jfr labels Nov 18, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Nov 18, 2021

@stefank
The hotspot-gc label was successfully added.

The hotspot-jfr label was successfully added.

@stefank
Copy link
Member Author

@stefank stefank commented Nov 18, 2021

/label remove hotspot

@openjdk openjdk bot removed the hotspot label Nov 18, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Nov 18, 2021

@stefank
The hotspot label was successfully removed.

@stefank
Copy link
Member Author

@stefank stefank commented Nov 18, 2021

Retrying with correct labels.

fisk
fisk approved these changes Nov 18, 2021
Copy link
Contributor

@fisk fisk left a comment

Looks good.

@openjdk
Copy link

@openjdk openjdk bot commented Nov 18, 2021

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

8277397: ZGC: Add JFR event for temporary latency measurements

Reviewed-by: eosterlund, jbachorik, pliden, mgronlun

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 79 new commits pushed to the master branch:

  • 32839ba: 8266593: vmTestbase/nsk/jvmti/PopFrame/popframe011 fails with "assert(java_thread == _state->get_thread()) failed: Must be"
  • 8051041: 8277534: Remove unused ReferenceProcessor::has_discovered_references
  • 3f847fe: 8277385: Zero: Enable CompactStrings support
  • ca31ed5: 8275448: [REDO] AArch64: Implement string_compare intrinsic in SVE
  • 4ff4301: 8224922: Access JavaFileObject from Element(s)
  • 0a9e76c: 8277485: Zero: Fix fast{i,f}access_0 bytecodes handling
  • 1c215f3: 8272773: Configurable card table card size
  • 1d7cef3: 8276662: Scalability bottleneck in SymbolTable::lookup_common()
  • c79a485: 8277494: [BACKOUT] JDK-8276150 Quarantined jpackage apps are labeled as "damaged"
  • 2ab43ec: 8273544: Increase test coverage for snippets
  • ... and 69 more: https://git.openjdk.java.net/jdk/compare/9a9a157a7d45cbfb016d4427931e1d5345210f7a...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.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready label Nov 18, 2021
@@ -1034,6 +1034,11 @@
<Field type="string" name="name" label="Name" />
</Event>

<Event name="ZThreadEvent" category="Java Virtual Machine, GC, Detailed" label="ZGC Thread Event" thread="true" experimental="true">

Choose a reason for hiding this comment

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

Can you add a description to the event?
For anyone coming from outside it would really help to understand what this event is supposed to represent.

Copy link
Member Author

@stefank stefank Nov 19, 2021

Choose a reason for hiding this comment

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

Great idea.

@@ -775,6 +775,11 @@
<setting name="threshold">0 ms</setting>
</event>

<event name="jdk.ZThreadEvent">

Choose a reason for hiding this comment

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

This is just a question - do we want/need to have this event enabled for the 'low overhead profiling' setup?

Copy link
Member Author

@stefank stefank Nov 19, 2021

Choose a reason for hiding this comment

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

Yes. I always use default.jfc. The profile.jfc is creating too many allocation related events to make it usable when running with ZGC. I know that there has been some plans to fix that, but I don't know if that made it into JDK 17 or not.

@stefank
Copy link
Member Author

@stefank stefank commented Nov 19, 2021

I discussed the naming of this event with @pliden, and we decided to rename it to make it more clear that this was only intended for debugging/development of ZGC.

pliden
pliden approved these changes Nov 19, 2021
Copy link
Contributor

@pliden pliden left a comment

Looks good.

fisk
fisk approved these changes Nov 19, 2021
@mgronlun
Copy link

@mgronlun mgronlun commented Nov 22, 2021

What's the overhead of this event being enabled in default.jfc with threshold=0? Do all users really need to have this experimental event enabled by default when running ZGC?

@stefank
Copy link
Member Author

@stefank stefank commented Nov 22, 2021

The overhead should be virtually zero, since no event is sent. Having this turned off by default makes this feature more annoying to use. Is this causing problems for the users?

@mgronlun
Copy link

@mgronlun mgronlun commented Nov 22, 2021

Ah. So "debug" means only used in "development builds" of the VM? In that case, there is no problem.

@stefank
Copy link
Member Author

@stefank stefank commented Nov 22, 2021

No, this is more likely to be used in release builds to identify and measure performance issues in ZGC. It is intended for us during debugging and development of various features in ZGC.

@stefank
Copy link
Member Author

@stefank stefank commented Nov 22, 2021

Think of this similar to the UseNewCode flag.

@stefank
Copy link
Member Author

@stefank stefank commented Nov 24, 2021

Thanks for reviewing!
/integrate

@openjdk
Copy link

@openjdk openjdk bot commented Nov 24, 2021

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

  • 7b2d823: 8277503: compiler/onSpinWait/TestOnSpinWaitAArch64DefaultFlags.java failed with "OnSpinWaitInst with the expected value 'isb' not found."
  • 7cb56a2: 8265796: vmTestbase/nsk/jdi/ObjectReference/referringObjects/referringObjects002/referringObjects002.java fails when running with JEP 416
  • 24e586a: 8276764: Enable deterministic file content ordering for Jar and Jmod
  • ea85e01: 8271623: Omit enclosing instance fields from inner classes that don't use it
  • 0320672: 8277451: java.lang.reflect.Field::set on static field with invalid argument type should throw IAE
  • e8acac2: 8277350: runtime/jni/checked/TestPrimitiveArrayCriticalWithBadParam.java times out
  • 8a44e09: 8268725: jshell does not support the --enable-native-access option
  • 7b67a49: 8261847: performance of java.lang.Record::toString should be improved
  • 38802ad: 8254108: ciReplay: Support incremental inlining
  • 64bdc84: 8277649: [BACKOUT] JDK-8277507 Add jlink.debug system property while launching jpackage tests to help diagonize recent intermittent failures
  • ... and 101 more: https://git.openjdk.java.net/jdk/compare/9a9a157a7d45cbfb016d4427931e1d5345210f7a...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Nov 24, 2021
@openjdk openjdk bot added integrated and removed ready rfr labels Nov 24, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Nov 24, 2021

@stefank Pushed as commit 712b875.

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

@stefank stefank deleted the 8277397_ZThreadEvent branch Jan 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-gc hotspot-jfr integrated
5 participants