8367949: JFR: MethodTrace double-counts methods that catch their own exceptions#182
8367949: JFR: MethodTrace double-counts methods that catch their own exceptions#182rm-gh-8 wants to merge 2 commits intoopenjdk:masterfrom
Conversation
|
👋 Welcome back rm-gh-8! A progress list of the required criteria for merging this PR into |
|
@rm-gh-8 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 5 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. ➡️ To flag this PR as ready for integration with the above commit message, type |
|
This backport pull request has now been updated with issue from the original commit. |
|
|
Webrevs
|
|
/approval request for backport of JDK-8367949: JFR: MethodTrace double-counts methods that catch their own exceptions. This PR fixes a bug in JFR's method tracing instrumentation. This backport has customer demand. Low-medium risk - Fixes the incorrect call counting behavior, but the constructor edge cases suggests an incomplete solution. |
|
@rm-gh-8 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 issue a |
|
/keepalive |
|
@rm-gh-8 The pull request is being re-evaluated and the inactivity timeout has been reset. |
|
HI @rm-gh-8 |
|
HI @rm-gh-8 |
|
@GoeLin Done. |
|
/approval request for backport of JDK-8367949: JFR: MethodTrace double-counts methods that catch their own exceptions. Why It's Important: JFR method tracing produced incorrect invocation counts. Methods that caught their own exceptions were double-counted, while methods where exceptions propagated from callees or were implicit JVM exceptions (NPE, OOME) were never counted at all. This undermines the reliability of jdk.MethodTrace and jdk.MethodTiming events for performance analysis and debugging. |
|
/integrate |
|
Maybe we should wait a bit, until @egahlin gives us the all-clear about this? See Erik's comment in the issue. |
Mikael found an issue in the method timing event last week (now fixed in JDK 27) while doing some manual experiments. Given that JDK 25 was released less than six months ago and that what we had before this patch works in most cases, I don’t think we need to hurry it into a backport. My plan is to update the Swing GUI I wrote for JDK 25 and see that everything looks good after the patch. I will have more time in the next couple weeks. |
|
I’ve now had some time to try the new implementation manually, using tracing and timing on java.lang.Object and a few other tricky classes that are hard to have in unit tests. I found a bug, but it also exists in JDK 25. I also tried the new implementation in the updated GUI, and it works fine. |
|
Awesome, thanks! So to recap, there is nothing blocking from this going into 25u, right, @egahlin?
Cool. Do you have the bug ID for it? |
Correct.
|
Backporting JDK-8367949: JFR: MethodTrace double-counts methods that catch their own exceptions.
This PR fixes a bug in JEP 520's method tracing instrumentation. The current implementation incorrectly instruments throw bytecodes as method exits, causing:
Ran related tests on linux-x64, linux-aarch64, macos-aarch64 and windows-x64:
make test TEST=jdk_jfr
Results attached:
linux-aarch64-specific-test.log
linux-x64-specific-test.log
macos-aarch64-specific-test.log
windows-x64-specific-test.log
Progress
Issue
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk25u-dev.git pull/182/head:pull/182$ git checkout pull/182Update a local copy of the PR:
$ git checkout pull/182$ git pull https://git.openjdk.org/jdk25u-dev.git pull/182/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 182View PR using the GUI difftool:
$ git pr show -t 182Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk25u-dev/pull/182.diff
Using Webrev
Link to Webrev Comment