Skip to content

Conversation

@kcrimson
Copy link
Contributor

@kcrimson kcrimson commented Aug 5, 2025

No description provided.

Copy link
Contributor

@korniltsev korniltsev left a 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));
Copy link
Contributor

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();
Copy link
Contributor

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();
Copy link
Contributor

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?

Copy link
Contributor Author

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 :(

@github-advanced-security
Copy link

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)
Copy link
Contributor

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: {
Copy link
Contributor

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) {
Copy link
Contributor

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

Copy link
Contributor

@korniltsev korniltsev left a 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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants