Skip to content

Commit b2a17ab

Browse files
committed
[GR-35721] Remove old build output.
PullRequest: graal/12104
2 parents fc9ed2a + f40aacb commit b2a17ab

File tree

14 files changed

+60
-169
lines changed

14 files changed

+60
-169
lines changed

substratevm/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
This changelog summarizes major changes to GraalVM Native Image.
44

5+
## Version 22.3.0
6+
* (GR-35721) Remove old build output style and the `-H:±BuildOutputUseNewStyle` option.
7+
58
## Version 22.2.0
69
* (GR-20653) Re-enable the usage of all CPU features for JIT compilation on AMD64.
710
* (GR-38413) Add support for `-XX:+ExitOnOutOfMemoryError`.

substratevm/src/com.oracle.graal.pointsto/src/com/oracle/graal/pointsto/AbstractAnalysisEngine.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public AbstractAnalysisEngine(OptionValues options, AnalysisUniverse universe, H
9898

9999
this.processFeaturesTimer = timerCollection.get(TimerCollection.Registry.FEATURES);
100100
this.verifyHeapTimer = timerCollection.get(TimerCollection.Registry.VERIFY_HEAP);
101-
this.reachabilityTimer = timerCollection.createTimer("(reachability)", false);
101+
this.reachabilityTimer = timerCollection.createTimer("(reachability)");
102102
this.analysisTimer = timerCollection.get(TimerCollection.Registry.ANALYSIS);
103103

104104
this.extendedAsserts = PointstoOptions.ExtendedAsserts.getValue(options);
@@ -182,13 +182,6 @@ public void cleanupAfterAnalysis() {
182182
universe.getHeapVerifier().cleanupAfterAnalysis();
183183
}
184184

185-
@Override
186-
public void printTimers() {
187-
reachabilityTimer.print();
188-
verifyHeapTimer.print();
189-
processFeaturesTimer.print();
190-
}
191-
192185
@Override
193186
public void printTimerStatistics(PrintWriter out) {
194187
// todo print reachability here

substratevm/src/com.oracle.graal.pointsto/src/com/oracle/graal/pointsto/BigBang.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
* Central static analysis interface that groups together the functionality of reachability analysis
5252
* and heap scanning and adds utility methods and lifecycle hooks that should be used to query and
5353
* change the state of the analysis.
54-
*
54+
*
5555
* In long term, all mutable accesses that change the state of the analysis should go through this
5656
* interface.
5757
*
@@ -73,11 +73,6 @@ public interface BigBang extends ReachabilityAnalysis, HeapScanning {
7373

7474
List<DebugHandlersFactory> getDebugHandlerFactories();
7575

76-
/**
77-
* Prints all analysis timers.
78-
*/
79-
void printTimers();
80-
8176
/**
8277
* Prints more detailed information about all analysis timers.
8378
*/

substratevm/src/com.oracle.graal.pointsto/src/com/oracle/graal/pointsto/PointsToAnalysis.java

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,7 @@ public PointsToAnalysis(OptionValues options, AnalysisUniverse universe, HostedP
142142
this.debugHandlerFactories = Collections.singletonList(new GraalDebugHandlersFactory(providers.getSnippetReflection()));
143143
this.debug = new Builder(options, debugHandlerFactories).build();
144144
this.hostVM = hostVM;
145-
String imageName = hostVM.getImageName();
146-
this.typeFlowTimer = timerCollection.createTimer(imageName, "(typeflow)", false);
145+
this.typeFlowTimer = timerCollection.createTimer("(typeflow)");
147146
this.verifyHeapTimer = timerCollection.get(TimerCollection.Registry.VERIFY_HEAP);
148147
this.processFeaturesTimer = timerCollection.get(TimerCollection.Registry.FEATURES);
149148
this.analysisTimer = timerCollection.get(TimerCollection.Registry.ANALYSIS);
@@ -184,13 +183,6 @@ public PointsToAnalysis(OptionValues options, AnalysisUniverse universe, HostedP
184183
: HeapScanningPolicy.skipTypes(skippedHeapTypes());
185184
}
186185

187-
@Override
188-
public void printTimers() {
189-
typeFlowTimer.print();
190-
verifyHeapTimer.print();
191-
processFeaturesTimer.print();
192-
}
193-
194186
@Override
195187
public void printTimerStatistics(PrintWriter out) {
196188
StatisticsPrinter.print(out, "typeflow_time_ms", typeFlowTimer.getTotalTime());
@@ -465,7 +457,7 @@ public AnalysisMethod addRootMethod(AnalysisMethod aMethod, boolean invokeSpecia
465457
* virtual invoke type flow. Since the virtual invoke observes the receiver flow
466458
* state it will get notified for any future reachable subtypes and will resolve the
467459
* method in each subtype.
468-
*
460+
*
469461
* In both cases the context-insensitive invoke parameters are initialized with the
470462
* corresponding declared type state. When a callee is resolved the method is parsed
471463
* and the actual parameter type state is propagated to the formal parameters. Then
@@ -483,7 +475,7 @@ public AnalysisMethod addRootMethod(AnalysisMethod aMethod, boolean invokeSpecia
483475
* Initialize the type flow of the invoke's actual parameters with the
484476
* corresponding parameter declared type. Thus, when the invoke links callees it
485477
* will propagate the parameter types too.
486-
*
478+
*
487479
* The parameter iteration skips the primitive parameters, as these are not
488480
* modeled. The type flow of the receiver is set to the receiver type already
489481
* when the invoke is created.

substratevm/src/com.oracle.graal.pointsto/src/com/oracle/graal/pointsto/util/Timer.java

Lines changed: 2 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,8 @@
2424
*/
2525
package com.oracle.graal.pointsto.util;
2626

27-
import org.graalvm.compiler.serviceprovider.GraalServices;
28-
2927
public class Timer {
30-
private static boolean disablePrinting = false;
31-
32-
private String prefix;
33-
3428
private final String name;
35-
private final boolean autoPrint;
3629
/** Timer start time in nanoseconds. */
3730
private long startTime;
3831
/** Timer total time in nanoseconds. */
@@ -42,25 +35,11 @@ public class Timer {
4235

4336
/**
4437
* Timers should only be instantiated via factory methods in TimerCollection.
45-
*
38+
*
4639
* @see TimerCollection
4740
*/
48-
Timer(String prefix, String name, boolean autoPrint) {
49-
this.prefix = prefix;
41+
Timer(String name) {
5042
this.name = name;
51-
this.autoPrint = autoPrint;
52-
}
53-
54-
public static void disablePrinting() {
55-
disablePrinting = true;
56-
}
57-
58-
/**
59-
* Registers the prefix to be used when {@linkplain Timer#print(long) printing} a timer. This
60-
* allows the output of interlaced native image executions to be disambiguated.
61-
*/
62-
public void setPrefix(String value) {
63-
this.prefix = value;
6443
}
6544

6645
public StopTimer start() {
@@ -72,30 +51,6 @@ public void stop() {
7251
long addTime = System.nanoTime() - startTime;
7352
totalTime += addTime;
7453
totalMemory = Runtime.getRuntime().totalMemory();
75-
if (autoPrint) {
76-
print(addTime);
77-
}
78-
}
79-
80-
private void print(long time) {
81-
// TODO GR-35721
82-
if (disablePrinting) {
83-
return;
84-
}
85-
final String concurrentPrefix;
86-
if (prefix != null) {
87-
// Add the PID to further disambiguate concurrent builds of images with the same name
88-
String pid = GraalServices.getExecutionID();
89-
concurrentPrefix = String.format("[%s:%s] ", prefix, pid);
90-
} else {
91-
concurrentPrefix = "";
92-
}
93-
double totalMemoryGB = totalMemory / 1024.0 / 1024.0 / 1024.0;
94-
System.out.format("%s%12s: %,10.2f ms, %,5.2f GB%n", concurrentPrefix, name, time / 1000000d, totalMemoryGB);
95-
}
96-
97-
public void print() {
98-
print(totalTime);
9954
}
10055

10156
/** Get timer total time in milliseconds. */

substratevm/src/com.oracle.graal.pointsto/src/com/oracle/graal/pointsto/util/TimerCollection.java

Lines changed: 21 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2021, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -44,39 +44,31 @@ public static TimerCollection singleton() {
4444
* A registry of well-known timers used when building images.
4545
*/
4646
public enum Registry {
47-
TOTAL("total", false),
48-
SETUP("setup", true),
49-
CLASSLIST("classlist", false),
50-
CLINIT("(clinit)", true),
51-
FEATURES("(features)", false),
52-
VERIFY_HEAP("(verify)", false),
53-
ANALYSIS("analysis", true),
54-
UNIVERSE("universe", true),
55-
COMPILE_TOTAL("compile", true),
56-
PARSE("(parse)", true),
57-
INLINE("(inline)", true),
58-
COMPILE("(compile)", true),
59-
DEBUG_INFO("dbginfo", true),
60-
IMAGE("image", true),
61-
WRITE("write", true);
47+
TOTAL("total"),
48+
SETUP("setup"),
49+
CLASSLIST("classlist"),
50+
CLINIT("(clinit)"),
51+
FEATURES("(features)"),
52+
VERIFY_HEAP("(verify)"),
53+
ANALYSIS("analysis"),
54+
UNIVERSE("universe"),
55+
COMPILE_TOTAL("compile"),
56+
PARSE("(parse)"),
57+
INLINE("(inline)"),
58+
COMPILE("(compile)"),
59+
DEBUG_INFO("dbginfo"),
60+
IMAGE("image"),
61+
WRITE("write");
6262

6363
public final String name;
6464

65-
public final boolean autoPrint;
66-
67-
Registry(String name, boolean autoPrint) {
65+
Registry(String name) {
6866
this.name = name;
69-
this.autoPrint = autoPrint;
7067
}
7168

7269
}
7370

7471
private final Map<String, Timer> timers = new ConcurrentHashMap<>();
75-
private final String imageName;
76-
77-
public TimerCollection(String imageName) {
78-
this.imageName = imageName;
79-
}
8072

8173
public Timer get(String name) {
8274
Timer timer = timers.get(name);
@@ -85,32 +77,20 @@ public Timer get(String name) {
8577
}
8678

8779
public Timer get(TimerCollection.Registry type) {
88-
return timers.computeIfAbsent(type.name, (name) -> new Timer(imageName, name, type.autoPrint));
80+
return timers.computeIfAbsent(type.name, (name) -> new Timer(name));
8981
}
9082

91-
public static Timer.StopTimer createTimerAndStart(String prefix, String name) {
92-
return singleton().createTimer(prefix, name).start();
83+
public static Timer.StopTimer createTimerAndStart(String name) {
84+
return singleton().createTimer(name).start();
9385
}
9486

9587
public static Timer.StopTimer createTimerAndStart(TimerCollection.Registry type) {
9688
return singleton().get(type).start();
9789
}
9890

9991
public Timer createTimer(String name) {
100-
return createTimer(null, name, true);
101-
}
102-
103-
public Timer createTimer(String prefix, String name) {
104-
return createTimer(prefix, name, true);
105-
}
106-
107-
public Timer createTimer(String name, boolean autoPrint) {
108-
return createTimer(null, name, autoPrint);
109-
}
110-
111-
public Timer createTimer(String prefix, String name, boolean autoPrint) {
11292
GraalError.guarantee(!timers.containsKey(name), "Name %s for a timer is already taken.", name);
113-
Timer timer = new Timer(prefix, name, autoPrint);
93+
Timer timer = new Timer(name);
11494
timers.put(timer.getName(), timer);
11595
return timer;
11696
}

substratevm/src/com.oracle.graal.reachability/src/com/oracle/graal/reachability/ReachabilityAnalysisEngine.java

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@
3232
import java.util.Set;
3333
import java.util.concurrent.ForkJoinPool;
3434

35-
import com.oracle.graal.pointsto.meta.InvokeInfo;
36-
import com.oracle.graal.pointsto.util.AnalysisError;
3735
import org.graalvm.compiler.debug.Indent;
3836
import org.graalvm.compiler.nodes.StructuredGraph;
3937
import org.graalvm.compiler.options.OptionValues;
@@ -46,6 +44,8 @@
4644
import com.oracle.graal.pointsto.meta.AnalysisType;
4745
import com.oracle.graal.pointsto.meta.AnalysisUniverse;
4846
import com.oracle.graal.pointsto.meta.HostedProviders;
47+
import com.oracle.graal.pointsto.meta.InvokeInfo;
48+
import com.oracle.graal.pointsto.util.AnalysisError;
4949
import com.oracle.graal.pointsto.util.CompletionExecutor;
5050
import com.oracle.graal.pointsto.util.Timer;
5151
import com.oracle.graal.pointsto.util.TimerCollection;
@@ -78,7 +78,7 @@ public ReachabilityAnalysisEngine(OptionValues options, AnalysisUniverse univers
7878
UnsupportedFeatures unsupportedFeatures, MethodSummaryProvider methodSummaryProvider, TimerCollection timerCollection) {
7979
super(options, universe, providers, hostVM, executorService, heartbeatCallback, unsupportedFeatures, timerCollection);
8080
this.methodSummaryProvider = methodSummaryProvider;
81-
this.summaryTimer = timerCollection.createTimer("((summaries))", false);
81+
this.summaryTimer = timerCollection.createTimer("((summaries))");
8282
ReachabilityAnalysisType objectType = assertReachabilityAnalysisType(metaAccess.lookupJavaType(Object.class));
8383
this.allInstantiatedTypes = Collections.unmodifiableSet(objectType.getInstantiatedSubtypes());
8484
}
@@ -409,10 +409,4 @@ public static ReachabilityAnalysisMethod assertReachabilityAnalysisMethod(Analys
409409
public static ReachabilityAnalysisType assertReachabilityAnalysisType(AnalysisType type) {
410410
return (ReachabilityAnalysisType) type;
411411
}
412-
413-
@Override
414-
public void printTimers() {
415-
summaryTimer.print();
416-
super.printTimers();
417-
}
418412
}

substratevm/src/com.oracle.svm.core.graal.llvm/src/com/oracle/svm/core/graal/llvm/LLVMNativeImageCodeCache.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,20 +131,20 @@ public int codeSizeFor(HostedMethod method) {
131131

132132
@Override
133133
@SuppressWarnings({"unused", "try"})
134-
public void layoutMethods(DebugContext debug, String imageName, BigBang bb, ForkJoinPool threadPool) {
134+
public void layoutMethods(DebugContext debug, BigBang bb, ForkJoinPool threadPool) {
135135
try (Indent indent = debug.logAndIndent("layout methods")) {
136136
BatchExecutor executor = new BatchExecutor(bb, threadPool);
137-
try (StopTimer t = TimerCollection.createTimerAndStart(imageName, "(bitcode)")) {
137+
try (StopTimer t = TimerCollection.createTimerAndStart("(bitcode)")) {
138138
writeBitcode(executor);
139139
}
140140
int numBatches;
141-
try (StopTimer t = TimerCollection.createTimerAndStart(imageName, "(prelink)")) {
141+
try (StopTimer t = TimerCollection.createTimerAndStart("(prelink)")) {
142142
numBatches = createBitcodeBatches(executor, debug);
143143
}
144-
try (StopTimer t = TimerCollection.createTimerAndStart(imageName, "(llvm)")) {
144+
try (StopTimer t = TimerCollection.createTimerAndStart("(llvm)")) {
145145
compileBitcodeBatches(executor, debug, numBatches);
146146
}
147-
try (StopTimer t = TimerCollection.createTimerAndStart(imageName, "(postlink)")) {
147+
try (StopTimer t = TimerCollection.createTimerAndStart("(postlink)")) {
148148
linkCompiledBatches(executor, debug, numBatches);
149149
}
150150
}

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/SubstrateOptions.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -394,9 +394,6 @@ public Boolean getValue(OptionValues values) {
394394
/*
395395
* Build output options.
396396
*/
397-
@Option(help = "Use new build output style", type = OptionType.User, deprecated = true, deprecationMessage = "The old build output style will be removed in a future release.")//
398-
public static final HostedOptionKey<Boolean> BuildOutputUseNewStyle = new HostedOptionKey<>(true);
399-
400397
@Option(help = "Prefix build output with '<pid>:<image name>'", type = OptionType.User)//
401398
public static final HostedOptionKey<Boolean> BuildOutputPrefix = new HostedOptionKey<>(false);
402399

0 commit comments

Comments
 (0)