Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dependencyManagement/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ dependencies {
api("org.testcontainers:kafka:1.21.0")
api("com.lmax:disruptor:3.4.4")
api("org.jctools:jctools-core:4.0.5")
api("tools.profiler:async-profiler:3.0")
api("tools.profiler:async-profiler:4.0")
api("com.blogspot.mydailyjava:weak-lock-free:0.18")
api("org.agrona:agrona:1.22.0")
}
Expand Down
4 changes: 4 additions & 0 deletions inferred-spans/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,8 @@ tasks {
}
}
}

withType<Test>().configureEach {
jvmArgs("-Djava.util.logging.config.file=${project.projectDir.resolve("src/test/resources/logging.properties")}")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ private void profile(Duration profilingDuration) throws Exception {

String createStartCommand() {
StringBuilder startCommand =
new StringBuilder("start,jfr,clock=m,event=wall,cstack=n,interval=")
new StringBuilder("start,jfr,clock=m,event=wall,nobatch,cstack=n,interval=")
Copy link
Contributor

@steverao steverao May 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In 4.0, I found there is an attractive feature in stack walking async-profiler/async-profiler#1073, it can avoid using AsyncGetCallTrace in JDK that it may causes all kind of crash problems. For detail, can refer to async-profiler/async-profiler#795 Is there any plan to switch to that stack walking mode?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is best to by default stick with the default stack walking of async-profiler: Like the maintainer stated, async-profiler will eventually switch to the custom stack walking implementation by default, and then we'll switch our default to.

However, I don't see a reason why we shouldn't allow the stack walker to be configured on the inferred-spans extension. Feel free to open a PR adding such a config option if you think it would be useful.

.append(config.getSamplingInterval().toMillis())
.append("ms,filter,file=")
.append(jfrFile)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,13 @@ void testStartCommand() {
setupProfiler(false);
assertThat(setup.profiler.createStartCommand())
.isEqualTo(
"start,jfr,clock=m,event=wall,cstack=n,interval=5ms,filter,file=null,safemode=0");
"start,jfr,clock=m,event=wall,nobatch,cstack=n,interval=5ms,filter,file=null,safemode=0");

setup.close();
setupProfiler(config -> config.startScheduledProfiling(false).profilerLoggingEnabled(false));
assertThat(setup.profiler.createStartCommand())
.isEqualTo(
"start,jfr,clock=m,event=wall,cstack=n,interval=5ms,filter,file=null,safemode=0,loglevel=none");
"start,jfr,clock=m,event=wall,nobatch,cstack=n,interval=5ms,filter,file=null,safemode=0,loglevel=none");

setup.close();
setupProfiler(
Expand All @@ -162,7 +162,7 @@ void testStartCommand() {
.asyncProfilerSafeMode(14));
assertThat(setup.profiler.createStartCommand())
.isEqualTo(
"start,jfr,clock=m,event=wall,cstack=n,interval=10ms,filter,file=null,safemode=14,loglevel=none");
"start,jfr,clock=m,event=wall,nobatch,cstack=n,interval=10ms,filter,file=null,safemode=14,loglevel=none");
}

@Test
Expand Down
4 changes: 4 additions & 0 deletions inferred-spans/src/test/resources/logging.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
handlers=java.util.logging.ConsoleHandler
.level=ALL
java.util.logging.ConsoleHandler.level=ALL
java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter
Loading