- 
                Notifications
    You must be signed in to change notification settings 
- Fork 36
support JFR event types #204
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
base: main
Are you sure you want to change the base?
Conversation
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 good overall. Just couple questions of whether we can unhardcode some things
| recording.enable("jdk.JavaMonitorEnter").withPeriod(Duration.ofMillis(10)).withStackTrace(); | ||
| switch (config.profilingEvent) { | ||
| case CPU: { | ||
| recording.enable("jdk.ExecutionSample").withPeriod(Duration.ofMillis(1)); | 
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.
can we use Config.profilingInterval?
| break; | ||
| } | ||
| case LOCK: { | ||
| recording.enable("jdk.ThreadPark").withPeriod(Duration.ofMillis(10)).withStackTrace(); | 
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.
Do you think we can use Config.profilingLock  here as a period instead of hardcoding 10ms?
| break; | ||
| } | ||
| case ALLOC: { | ||
| recording.enable("jdk.ObjectAllocationInNewTLAB").withStackTrace(); | 
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.
Any chance we can use Configuration to somehow configure these events? in asprof we have alloc=256k, can we somehow configure it here as well?
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.
nope, unfortunately this settings is not exposed at the moment through recording object :(
| This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation. | 
| } | ||
| case ALLOC: { | ||
| recording.enable("jdk.ObjectAllocationInNewTLAB") | ||
| .withPeriod(config.profilingInterval) | 
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 is more of a question, not a request to change. What does this line do?
| recording.enable("jdk.ObjectAllocationOutsideTLAB").withStackTrace(); | ||
| recording.enable("jdk.JavaMonitorEnter").withPeriod(Duration.ofMillis(10)).withStackTrace(); | ||
| switch (config.profilingEvent) { | ||
| case CPU: { | 
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.
Do you think we can rework this to allow CPU and alloc/lock at the same time?
if config.profilingEvent == CPU { recording.enable("jdk.ExecutionSample")}
if config.profilingEvent == ALLOC || config.alloc != null { recording.enable("jdk.ObjectAllocationInNewTLAB")}
//  etc
| } | ||
|  | ||
| // this based on async-profiler parsing logic so we can things compatible | ||
| private static Duration parseDuration(String str, Duration defaultValue) { | 
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.
I am not 100% sure, but can you check if we can use IntervalParser.parse instead of new parser utility. If not, then let's move this function into IntervalParser or Config with a comment why we cant use the IntervalParser.parse
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.
couple more nits. Thanks for working on this!
No description provided.