Skip to content

Commit

Permalink
Merge remote-tracking branch 'github_johntortugo/add_compilation_id' …
Browse files Browse the repository at this point in the history
…into jchaloup/GR-61448/CompIdInTruffleCompLogs
  • Loading branch information
jchalou committed Jan 17, 2025
2 parents 53d6f05 + 605e0b4 commit 2e5bc96
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,11 @@ static class CompilationResultInfoImpl implements TruffleCompilerListener.Compil
this.compResult = compResult;
}

@Override
public String getCompilationId() {
return compResult.getCompilationId().toString(CompilationIdentifier.Verbosity.ID);
}

@Override
public int getTargetCodeSize() {
return compResult.getTargetCodeSize();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ interface GraphInfo {
* Summary information for the result of a compilation.
*/
interface CompilationResultInfo {
/** Gets the ID of the compilation. */
String getCompilationId();

/**
* Gets the size of the machine code generated.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,14 @@ public static void install(OptimizedTruffleRuntime runtime) {

public static final String TIER_FORMAT = "Tier %d";
private static final String QUEUE_FORMAT = "Queue: Size %4d Change %c%-2d Load %5.2f Time %5dus ";
private static final String TARGET_FORMAT = "engine=%-2d id=%-5d %-50s ";
private static final String TARGET_FORMAT = "engine=%-2d TargetId=%-5d %-50s ";
public static final String COUNT_THRESHOLD_FORMAT = "Count/Thres %9d/%9d";
private static final DateTimeFormatter TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSS").withZone(ZoneId.of("UTC"));
// @formatter:off
private static final String QUEUED_FORMAT = "opt queued " + TARGET_FORMAT + "|" + TIER_FORMAT + "|" + COUNT_THRESHOLD_FORMAT + "|" + QUEUE_FORMAT + "|UTC %s|Src %s";
private static final String UNQUEUED_FORMAT = "opt unque. " + TARGET_FORMAT + "|" + TIER_FORMAT + "|" + COUNT_THRESHOLD_FORMAT + "|" + QUEUE_FORMAT + "|UTC %s|Src %s|Reason %s";
private static final String START_FORMAT = "opt start " + TARGET_FORMAT + "|" + TIER_FORMAT + "|Priority %9d|Rate %.6f|" + QUEUE_FORMAT + "|UTC %s|Src %s";
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|UTC %s|Src %s";
private static final String DONE_FORMAT = "opt done " + TARGET_FORMAT + "|" + TIER_FORMAT + "|Time %18s|AST %4d|Inlined %3dY %3dN|IR %6d/%6d|CompilationId %s|CodeSize %7d|Addr 0x%012x|UTC %s|Src %s";
private static final String FAILED_FORMAT = "opt failed " + TARGET_FORMAT + "|" + TIER_FORMAT + "|Time %18s|Reason: %s|UTC %s|Src %s";
private static final String INV_FORMAT = "opt inval. " + TARGET_FORMAT + " |UTC %s|Src %s|Reason %s";
private static final String DEOPT_FORMAT = "opt deopt " + TARGET_FORMAT + "| |UTC %s|Src %s";
Expand Down Expand Up @@ -243,6 +243,7 @@ public void onCompilationSuccess(OptimizedCallTarget target, AbstractCompilation
inlinedAndDispatched[1],
compilation.nodeCountPartialEval,
graph == null ? 0 : graph.getNodeCount(),
result == null ? 0 : result.getCompilationId(),
result == null ? 0 : result.getTargetCodeSize(),
target.getCodeAddress(),
TIME_FORMATTER.format(ZonedDateTime.now()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,8 @@ public int getMarksCount() {
public int getDataPatchesCount() {
return TruffleToLibGraalCalls.getDataPatchesCount(getIsolateThread(), getHandle());
}

public String getCompilationId() {
return "LibGraal";
}
}

0 comments on commit 2e5bc96

Please sign in to comment.