Skip to content

Commit 82009ec

Browse files
committed
[GR-65348] Improve systemic compilation failure warning
PullRequest: graal/20912
2 parents bad63e5 + 888575b commit 82009ec

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/core/CompilationWrapper.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
import java.io.IOException;
3939
import java.io.OutputStream;
4040
import java.io.PrintStream;
41+
import java.io.PrintWriter;
42+
import java.io.StringWriter;
4143
import java.util.Formatter;
4244
import java.util.Map;
4345
import java.util.concurrent.TimeUnit;
@@ -493,8 +495,11 @@ private static boolean detectCompilationFailureRateTooHigh(OptionValues options,
493495
failed, total, rate, TimeUnit.NANOSECONDS.toMillis(periodNS), option, maxRateValue);
494496
msg.format("To mitigate systemic compilation failure detection, set %s to a higher value. ", option);
495497
msg.format("To disable systemic compilation failure detection, set %s to 0. ", option);
496-
msg.format("To get more information on compilation failures, set %s to Print or Diagnose. ", GraalCompilerOptions.CompilationFailureAction.getName());
498+
StringWriter sw = new StringWriter();
499+
cause.printStackTrace(new PrintWriter(sw));
500+
msg.format("Current failure: %s", sw);
497501
TTY.println(msg.toString());
502+
498503
if (maxRateValue < 0) {
499504
// A negative value means the VM should be exited
500505
return true;

compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/core/GraalCompilerOptions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ Emit a heap dump after each phase matching the given phase filter(s).
7878
"CompilationFailureAction before changing to a less verbose action. " +
7979
"This does not apply to the ExitVM action..", type = OptionType.User)
8080
public static final OptionKey<Integer> MaxCompilationProblemsPerAction = new OptionKey<>(2);
81-
@Option(help = "Specifies the compilation failure rate that indicates a systemic compilation problem (and a resulting warning). " +
81+
@Option(help = "Specifies the compilation failure rate that indicates a systemic compilation problem. " +
8282
"The value is made absolute and clamped to produce P, a value between 0 and 100. " +
8383
"Systemic failure is detected if the percentage of failing compilations in a sliding time window >= P. " +
8484
"A negative value will cause the VM to exit after issuing the warning. Set to 0 to disable systemic compilation problem detection.", type = OptionType.User)

0 commit comments

Comments
 (0)