-
Couldn't load subscription status.
- Fork 6.1k
8365400: enhance JFR to emit file and module metadata for class loading #27738
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 larry-cable! A progress list of the required criteria for merging this PR into |
| ❗ This change is not yet ready to be integrated. |
| @larry-cable The following label will be automatically applied to this pull request:
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. |
Webrevs
|
| The evolution of JFR events isn't clear to me so I don't know if adding a field is compatible or not for programs that are processing recordings. (I'm just trying to understand why a new not-enabled-by-default event is added instead of adding a field to the existing ClassDefine event. The existing event is emitted in SystemDictionary::define_instance_class, the new event emits it from JVM_DefineClassXXX. Is this because it was awkward to get at cfs->source from the SD code? I assume that a test will be added as it would be easy to refactor code and not record the event if enabled. Using "jvm" as the URI scheme when there is no source is a bit strange. There will be custom class loaders that don't provide a code source, do you really want these to use this source in the event? |
| Why is this change not getting a hotspot-jfr label? |
| /label add hotspot-jfr |
| @mgronlun |
| Introducing a separate jdk.ClassFileDefine event seems gratuitous. Why is it not enabled by default? What problem is being addressed again? |
Adding a field to an existing event is non-detrimental, equivalent to extending a table with a new column in a database. |
| in previous discussions regarding adding fields to existing JFR (jdk) events I concluded (based on feedback from the JFR team) that this was undesirable hence the new event. I will investigate the feasibility of adding this metadata to the existing event(s) knowing where a class originated from, in addition to the knowledge that it has been loaded etc is of particular value in pre-existing auditing and debugging scenarios. |
| Can you please give an example URL for a class definition? I am concerned about whether this is high cardinality strings (for path/name.class) or a lot of reuse (for paths). We should only represent a URL once, which makes me think that the field type should be symbol instead of string. For that, we would need a concurrent symbol table, which I have already planned in other changes. |
Run with |
Thanks. Looks like the source is a low cardinality property. |
| looking at the current implementation for both jdk.ClassDefine and jdk.ClassLoad events, the "source" metadata recorded by the new event is not available in the (current) calling context for either of the pre-existing events. In my opinion adding a new event to capture this information is less intrusive than adding fields(s) to the existing event(s) and contriving to provide the necessary state to those at their current call sites (or by relocating those to a calling context where the "source" is available) |
| @larry-cable Are you sure adding a new event is the right thing to do? Is it just the implementation challenge? If jdk.ClassDefine were being added today then it seems useful to add the module and the code source (no need for the package as the definedClass gives the fully qualified class name). |
| Package and Module information is implicitly included in the JFR model for a class (its transitive dependencies), so you do not need to include them explicitly. I prefer if the design address how the source information is to be included for the existing events (ClassLoad and ClassDefine). I am working on a symbol table implementation to help you out. |
the existing
jdk.classDefineandjdk.ClassLoadevents do not include metadata regarding the location/source of the ClassFile.The location of the class file for a class defined can be of utility in both debugging and auditing.
this addition introduces a new
jdk.ClassFileDefineevent which records the class defined and the location (path/url) of the class file that contained the implementation thereofProgress
Warning
8365400: enhance JFR to emit file and module metadata for class loadingIssue
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/27738/head:pull/27738$ git checkout pull/27738Update a local copy of the PR:
$ git checkout pull/27738$ git pull https://git.openjdk.org/jdk.git pull/27738/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 27738View PR using the GUI difftool:
$ git pr show -t 27738Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/27738.diff
Using Webrev
Link to Webrev Comment