Skip to content

Conversation

@egahlin
Copy link
Member

@egahlin egahlin commented Oct 29, 2023

This enhancement introduces an annotation that controls the presence of implicit fields for an event.

For native events, the metadata.xml file controls the existence of the fields "eventThread" "duration” and "stackTrace”. For Java events, there is nothing similar. This outage has been known since the inception of the jdk.jfr API. At that time, we decided to ignore it and write 0 for “eventThread”, “stackTrace”, and ”duration”. The gain was a simplified programming model with one annotation, i.e. StackTrace, instead of two, i.e. StackTrace and HasStackTrace, to determine if a value should be recorded.

With the removal of event handlers (JDK-8282420 ) and use of the new Class-File API (JDK-8318124) this capability can be added to Java events at a lower implementation cost. Also, we are considering adding other fields, such as allocation, cpuTime, or socketRead/Write, that can occur between a call to Event::begin() and Event::end().

There is still uncertainty about the design of the annotation, so it is currently only accessible to JDK events. Instead of a separate annotation per field, i.e. HasStackTrace, HasEventThread, and HasDuration, there is one annotation, RemoveFields, that provides a list of fields that should be dropped. This allows for a corresponding annotation, AddFields, to be included in the future, for example, to add the field cpuTime.

The benefits of the change are:

  • a more compact recording file
  • less overhead
  • no mismatch between contents of .jfc files and what the API provides
  • consistency with native events
  • less noise when events are visualized

Testing: test/jdk/jdk/jfr/ tier1 + tier2


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/16411/head:pull/16411
$ git checkout pull/16411

Update a local copy of the PR:
$ git checkout pull/16411
$ git pull https://git.openjdk.org/jdk.git pull/16411/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 16411

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/16411.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Oct 29, 2023

👋 Welcome back egahlin! 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
Copy link

openjdk bot commented Oct 29, 2023

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

  • hotspot-jfr

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.

@egahlin egahlin marked this pull request as ready for review October 29, 2023 17:53
@openjdk openjdk bot added the rfr Pull request is ready for review label Oct 29, 2023
@mlbridge
Copy link

mlbridge bot commented Oct 29, 2023

Webrevs

Copy link

@mgronlun mgronlun left a comment

Choose a reason for hiding this comment

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

Nice!

@openjdk
Copy link

openjdk bot commented Oct 31, 2023

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

8239508: JFR: @RemoveFields

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

  • 7452d50: 8318940: [JVMCI] do not set HotSpotNmethod oop for a default HotSpotNmethod
  • 3e39d7b: 8319136: Skip pkcs11 tests on linux-aarch64
  • ee6f25b: 8319120: Unbound ScopedValue.get() throws the wrong exception
  • e05cafd: 8318467: [jmh] tests concurrent.Queues and concurrent.ProducerConsumer hang with 101+ threads
  • d3c3f0e: 8317951: Refactor loading of zip library to help resolve JDK-8315220
  • 576c9bc: 8318492: Http2ClientImpl should attempt to close and remove connection in stop()
  • 5411ad2: 8319106: Remove unimplemented TaskTerminator::do_delay_step
  • 75ce02f: 8318951: Additional negative value check in JPEG decoding
  • 328b381: 8009550: PlatformPCSC should load versioned so
  • d051f22: 8318410: jdk/java/lang/instrument/BootClassPath/BootClassPathTest.sh fails on Japanese Windows
  • ... and 13 more: https://git.openjdk.org/jdk/compare/ce0ca476416cb6f96d4b6b4852144382d6abf717...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 Pull request is ready to be integrated label Oct 31, 2023
@egahlin
Copy link
Member Author

egahlin commented Oct 31, 2023

/integrate

@openjdk
Copy link

openjdk bot commented Oct 31, 2023

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

  • 0064cf9: 8311596: Add separate system properties for TLS server and client for maximum chain length
  • 3a7525d: 8309118: HttpClient: Add more tests for 100 ExpectContinue with HTTP/2
  • f4c5db9: 8318908: Parallel: Remove ExtendedCardValue
  • 7452d50: 8318940: [JVMCI] do not set HotSpotNmethod oop for a default HotSpotNmethod
  • 3e39d7b: 8319136: Skip pkcs11 tests on linux-aarch64
  • ee6f25b: 8319120: Unbound ScopedValue.get() throws the wrong exception
  • e05cafd: 8318467: [jmh] tests concurrent.Queues and concurrent.ProducerConsumer hang with 101+ threads
  • d3c3f0e: 8317951: Refactor loading of zip library to help resolve JDK-8315220
  • 576c9bc: 8318492: Http2ClientImpl should attempt to close and remove connection in stop()
  • 5411ad2: 8319106: Remove unimplemented TaskTerminator::do_delay_step
  • ... and 16 more: https://git.openjdk.org/jdk/compare/ce0ca476416cb6f96d4b6b4852144382d6abf717...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Oct 31, 2023
@openjdk openjdk bot closed this Oct 31, 2023
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Oct 31, 2023
@openjdk
Copy link

openjdk bot commented Oct 31, 2023

@egahlin Pushed as commit 2d5829a.

💡 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 [email protected] integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

2 participants