Skip to content

Commit bad317d

Browse files
committed
[GR-63588] Add an entry to opt deopt log showing whether the compilation was invalidated.
PullRequest: graal/21824
2 parents 0b8c875 + 4fa99a5 commit bad317d

File tree

5 files changed

+13
-3
lines changed

5 files changed

+13
-3
lines changed

sdk/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ This changelog summarizes major changes between GraalVM SDK versions. The main f
55
## Version 26.0.0
66
* GR-65048: GR-65048: Introduced the `-Dpolyglot.engine.allowUnsupportedPlatform=true` system property to enable Truffle to run on unsupported platforms. If this property is enabled then the failure will be suppressed. Please see follow-up errors and warnings for instructions on how to continue. Note that using an unsupported platform will also force the fallback runtime without runtime optimization.
77
* GR-66515 If neither a log handler nor the `log.file` option is set on the `Engine.Builder` or `Context.Builder`, Truffle and language log messages will be written to the Context’s error output stream by default. The `log.file` option is now also supported on `Context.Builder`.
8+
* GR-63588 A new entry (`Invalidated`) was added to the `opt deopt` truffle compilation logs. It is `true` or `false` depending on whether the compilation was also invalidated.
89

910
## Version 25.0.0
1011
* GR-60636 Truffle now stops compiling when the code cache fills up on HotSpot. A warning is printed when that happens.

truffle/src/com.oracle.truffle.runtime/src/com/oracle/truffle/runtime/debug/JFRListener.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ public void onCompilationDeoptimized(OptimizedCallTarget target, Frame frame) {
122122
DeoptimizationEvent event = factory.createDeoptimizationEvent();
123123
if (event.isEnabled()) {
124124
event.setRootFunction(target);
125+
event.setInvalidated(!target.isValid());
125126
event.publish();
126127
}
127128
}

truffle/src/com.oracle.truffle.runtime/src/com/oracle/truffle/runtime/debug/TraceCompilationListener.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,10 @@ public static void install(OptimizedTruffleRuntime runtime) {
100100
private static final String START_FORMAT = "opt start " + TARGET_FORMAT + "|" + TIER_FORMAT + "|Priority %9d|Rate %.6f|" + QUEUE_FORMAT + "|UTC %s|Src %s|Bonuses %s";
101101
private static final String DONE_FORMAT = "opt done " + TARGET_FORMAT + "|" + TIER_FORMAT + "|Time %18s|AST %4d|Inlined %3dY %3dN|IR %6d/%6d|CodeSize %7d|Addr 0x%012x|CompId %-7s|UTC %s|Src %s";
102102
private static final String FAILED_FORMAT = "opt failed " + TARGET_FORMAT + "|" + TIER_FORMAT + "|Time %18s|Reason: %s|UTC %s|Src %s";
103-
private static final String PADDING = " ";
104-
private static final String INV_FORMAT = "opt inval. " + TARGET_FORMAT + " " + PADDING + "|UTC %s|Src %s|Reason %s";
105-
private static final String DEOPT_FORMAT = "opt deopt " + TARGET_FORMAT + "|" + PADDING + "|UTC %s|Src %s";
103+
private static final String INV_PADDING = " ";
104+
private static final String DEOPT_PADDING = " ";
105+
private static final String INV_FORMAT = "opt inval. " + TARGET_FORMAT + " " + INV_PADDING + "|UTC %s|Src %s|Reason %s";
106+
private static final String DEOPT_FORMAT = "opt deopt " + TARGET_FORMAT + "|Invalidated %5b|" + DEOPT_PADDING + "|UTC %s|Src %s";
106107
// @formatter:on
107108

108109
@Override
@@ -228,6 +229,7 @@ public void onCompilationDeoptimized(OptimizedCallTarget target, Frame frame) {
228229
target.engineId(),
229230
target.id,
230231
safeTargetName(target),
232+
!target.isValid(),
231233
TIME_FORMATTER.format(ZonedDateTime.now()),
232234
formatSourceSection(safeSourceSection(target))));
233235
}

truffle/src/com.oracle.truffle.runtime/src/com/oracle/truffle/runtime/jfr/DeoptimizationEvent.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,5 @@
4141
package com.oracle.truffle.runtime.jfr;
4242

4343
public interface DeoptimizationEvent extends RootFunctionEvent {
44+
void setInvalidated(boolean invalidated);
4445
}

truffle/src/com.oracle.truffle.runtime/src/com/oracle/truffle/runtime/jfr/impl/DeoptimizationEventImpl.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,9 @@
5555
@StackTrace(false)
5656
class DeoptimizationEventImpl extends RootFunctionEventImpl implements DeoptimizationEvent {
5757

58+
@Label("Invalidated") @Description("Invalidated") public boolean invalidated;
59+
60+
public void setInvalidated(boolean invalidated) {
61+
this.invalidated = invalidated;
62+
}
5863
}

0 commit comments

Comments
 (0)