-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8364316: JFR: Incorrect validation of mirror fields #26539
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
Conversation
👋 Welcome back egahlin! A progress list of the required criteria for merging this PR into |
@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:
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 38 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. ➡️ To integrate this PR with the above commit message to the |
Webrevs
|
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.
Looks reasonable.
There might be another quirk in this code: fields of the same name can be hidden, so verification would miss that? See:
jshell> class C1 { int x;}
| created class C1
jshell> class C2 extends C1 { int x;}
| created class C2
jshell> Class cMirror = C2.class;
...> while (cMirror != Object.class) {
...> System.out.println(cMirror.getDeclaredField("x").getName());
...> cMirror = cMirror.getSuperclass();
...> }
cMirror ==> class C2
x
x
I don't think mirror events can be made to work with a class hierarchy (due to shadowing), and there is no need to, since their only purpose is to provide metadata for events defined in java.base (which cannot depend on the jdk.jfr module). It's fine to have all the metadata directly in the mirror event class. So, I simplified the traversal code and, at the same time, realized we should not duplicate the logic used to discover which event fields should be included. Now there is only one method, Utils.getEventFields(...), handling this. The reason I could remove the synthetic check in verifyMirror is that its only purpose was to exclude the startTime and duration fields in the jdk.internal.Event class. The traversal stops before that class is reached, so it's not an issue. I understand this may be more to review than you are willing to do. |
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 looks reasonable as well, as long as it verifies what you want to verify :)
/integrate |
Going to push as commit 68a4396.
Your commit was automatically rebased without conflicts. |
Could I please have a review of a PR that fixes a bug in the mirror field validation?
Testing: jdk/jdk/jfr
Thanks
Erik
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/26539/head:pull/26539
$ git checkout pull/26539
Update a local copy of the PR:
$ git checkout pull/26539
$ git pull https://git.openjdk.org/jdk.git pull/26539/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 26539
View PR using the GUI difftool:
$ git pr show -t 26539
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/26539.diff
Using Webrev
Link to Webrev Comment