Skip to content
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ private void doRun(Map<Method, CEntryPointData> entryPoints,
featureHandler.forEachFeature(feature -> feature.afterImageWrite(afterConfig));
}
reporter.printCreationEnd(imageTimer, writeTimer, image.getImageSize(), bb.getUniverse(), heap.getObjectCount(), image.getImageHeapSize(), codeCache.getCodeCacheSize(),
codeCache.getCompilations().size());
codeCache.getCompilations().size(), image.getDebugInfoSize());
if (SubstrateOptions.BuildOutputBreakdowns.getValue()) {
ProgressReporter.singleton().printBreakdowns(compileQueue.getCompilationTasks(), image.getHeap().getObjects());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public abstract class AbstractImage {
protected final NativeImageCodeCache codeCache;
protected final List<HostedMethod> entryPoints;
protected int resultingImageSize; // for statistical output
protected int debugInfoSize; // for statistical output

public enum NativeImageKind {
SHARED_LIBRARY(false) {
Expand Down Expand Up @@ -115,6 +116,10 @@ public int getImageSize() {
return resultingImageSize;
}

public int getDebugInfoSize() {
return debugInfoSize;
}

public NativeLibraries getNativeLibs() {
return nativeLibs;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,12 @@ protected final void write(DebugContext context, Path outputFile) {
throw shouldNotReachHere(ex);
}
resultingImageSize = (int) outputFile.toFile().length();
debugInfoSize = 0;
for (Element e : objectFile.getElements()) {
if (e.getName().contains(".debug")) {
debugInfoSize += e.getMemSize(objectFile.getDecisionsByElement());
}
}
if (NativeImageOptions.PrintImageElementSizes.getValue()) {
for (Element e : objectFile.getElements()) {
System.out.printf("PrintImageElementSizes: size: %15d name: %s\n", e.getMemSize(objectFile.getDecisionsByElement()), e.getElementName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,14 +328,18 @@ public void setDebugInfoTimer(Timer timer) {
}

public void printCreationEnd(Timer creationTimer, Timer writeTimer, int imageSize, AnalysisUniverse universe, int numHeapObjects, long imageHeapSize, int codeCacheSize,
int numCompilations) {
int numCompilations, int debugInfoSize) {
printStageEnd(creationTimer.getTotalTime() + writeTimer.getTotalTime());
String total = bytesToHuman("%4.2f", imageSize);
l().a("%9s in total (%2.2f%% for ", total, codeCacheSize / (double) imageSize * 100).doclink("code area", "#glossary-code-area")
.a(" and %2.2f%% for ", imageHeapSize / (double) imageSize * 100).doclink("image heap", "#glossary-image-heap").a(")").flushln();
l().a("%9s in code size: %,8d compilation units", bytesToHuman("%4.2f", codeCacheSize), numCompilations).flushln();
long numInstantiatedClasses = universe.getTypes().stream().filter(t -> t.isInstantiated()).count();
l().a("%9s in heap size: %,8d classes and %,d objects", bytesToHuman("%4.2f", imageHeapSize), numInstantiatedClasses, numHeapObjects).flushln();
if (debugInfoSize > 0) {
// TODO print number of DIEs etc.
l().a("%9s in debugInfo size", bytesToHuman("%4.2f", debugInfoSize)).flushln();
}
if (debugInfoTimer != null) {
String debugInfoTime = String.format("%.1fs", millisToSeconds(debugInfoTimer.getTotalTime()));
l().dim().a("%9s for generating debug info", debugInfoTime).reset().flushln();
Expand Down