@@ -53,12 +53,12 @@ try (Scope s = debug.scope("CodeInstall", method)) {
53
53
```
54
54
55
55
The ` debug.log ` statement will send output to the console if ` CodeInstall ` is matched by the
56
- ` -Dgraal .Log ` option. The matching logic for this option is implemented in
56
+ ` -Djdk.graal .Log ` option. The matching logic for this option is implemented in
57
57
[ DebugFilter] ( ../src/jdk.graal.compiler/src/jdk/graal/compiler/debug/DebugFilter.java )
58
58
and documented in the
59
59
[ Dump help message] ( ../src/jdk.graal.compiler/src/jdk/graal/compiler/debug/doc-files/DumpHelp.txt ) . As
60
- mentioned in the javadoc, the same matching logic also applies to the ` -Dgraal .Dump ` ,
61
- ` -Dgraal. Time ` , ` -Dgraal. Count ` and ` -Dgraal .TrackMemUse ` options.
60
+ mentioned in the javadoc, the same matching logic also applies to the ` -Djdk.graal .Dump ` ,
61
+ ` -Djdk.graal. Time ` , ` -Djdk.graal. Count ` and ` -Djdk.graal .TrackMemUse ` options.
62
62
63
63
Since ` DebugContext ` objects are thread local, they need to be passed around as parameters. For
64
64
convenience, they may be available from objects such as a ` Graph ` or a ` Node ` but care needs to be
@@ -78,9 +78,9 @@ obtained with `-XX:+JVMCIPrintProperties`.
78
78
The compiler supports metrics in the form of counters, timers and memory trackers.
79
79
Each metric has a unique name. Metrics are collected per-compilation.
80
80
At shutdown, they are aggregated across all compilations and reported to the console.
81
- This ouput can be redirected to a file via the ` -Dgraal .AggregatedMetricsFile ` option.
81
+ This ouput can be redirected to a file via the ` -Djdk.graal .AggregatedMetricsFile ` option.
82
82
83
- To list the per-compilation metrics, use the ` -Dgraal .MetricsFile ` option. If not specified,
83
+ To list the per-compilation metrics, use the ` -Djdk.graal .MetricsFile ` option. If not specified,
84
84
per-compilation metrics are not reported.
85
85
86
86
Metrics are represented in the code via fields or variables of type ` CounterKey ` , ` TimerKey ` or ` MemUseTrackerKey ` .
@@ -136,11 +136,11 @@ CompilationMemory_Accm=100000 bytes
136
136
CompilationMemory_Flat=1000 bytes
137
137
```
138
138
139
- For both the ` -Dgraal. AggregatedMetricsFile ` and the ` -Dgraal .MetricsFile ` option, the output format
139
+ For both the ` -Djdk.graal. AggregatedMetricsFile ` and the ` -Djdk.graal .MetricsFile ` option, the output format
140
140
is determined by the file name suffix. A ` .csv ` suffix produces a semi-colon separated format that
141
141
is amenable to automatic data processing.
142
142
143
- The columns in the ` -Dgraal .MetricsFile ` CSV output are:
143
+ The columns in the ` -Djdk.graal .MetricsFile ` CSV output are:
144
144
* ** compilable** : A textual label such as the fully qualified name of the method being compiled.
145
145
For Truffle compilations, this will be a name describing the guest language function/method being compiled.
146
146
* ** compilable_identity** : The identity hash code of the ** compilable** . This is useful when the
@@ -156,7 +156,7 @@ but its identity will.
156
156
* ** metric_value** : The metric value being reported.
157
157
* ** metric_unit** : The unit of measurement for the value being reported. This will be the empty string for a counter.
158
158
159
- Example ` -Dgraal .MetricsFile ` output:
159
+ Example ` -Djdk.graal .MetricsFile ` output:
160
160
```
161
161
java.lang.String.hashCode()int;1272077530;0;HotSpotCompilation-95;PhaseNodes_PhaseSuite;1
162
162
java.lang.String.hashCode()int;1272077530;0;HotSpotCompilation-95;PhaseNodes_GraphBuilderPhase;1
@@ -167,12 +167,12 @@ java.lang.String.hashCode()int;1272077530;0;HotSpotCompilation-95;PhaseTime_Grap
167
167
java.lang.String.hashCode()int;1272077530;0;HotSpotCompilation-95;PhaseTime_GraphBuilderPhase_Flat;27724000
168
168
```
169
169
170
- The columns in the ` -Dgraal .AggregatedMetricsFile ` CSV output are:
170
+ The columns in the ` -Djdk.graal .AggregatedMetricsFile ` CSV output are:
171
171
* ** metric_name** : The name of the metric being reported.
172
172
* ** metric_value** : The metric value being reported.
173
173
* ** metric_unit** : The unit of measurement for the value being reported. This will be the empty string for a counter.
174
174
175
- Example ` -Dgraal .AggregatedMetricsFile ` output:
175
+ Example ` -Djdk.graal .AggregatedMetricsFile ` output:
176
176
```
177
177
AllocationsRemoved;6446;
178
178
BackEnd_Accm;7931303;us
@@ -183,30 +183,30 @@ LIRPhaseMemUse_AllocationStage_Accm;499763160;bytes
183
183
LIRPhaseMemUse_AllocationStage_Flat;17354112;bytes
184
184
```
185
185
186
- Note that ` -Dgraal .MetricsFile ` produces per-compilation output, not per-method output.
186
+ Note that ` -Djdk.graal .MetricsFile ` produces per-compilation output, not per-method output.
187
187
If a method is compiled multiple times, post-processing of the CSV output will be required
188
188
to obtain per-method metric values.
189
189
190
190
## Method filtering
191
191
192
- Specifying one of the debug scope options (i.e., ` -Dgraal. Log ` , ` -Dgraal. Dump ` , ` -Dgraal .Count ` ,
193
- ` -Dgraal. Time ` , or ` -Dgraal .TrackMemUse ` ) can generate a lot of output. Typically, you are only
192
+ Specifying one of the debug scope options (i.e., ` -Djdk.graal. Log ` , ` -Djdk.graal. Dump ` , ` -Djdk.graal .Count ` ,
193
+ ` -Djdk.graal. Time ` , or ` -Djdk.graal .TrackMemUse ` ) can generate a lot of output. Typically, you are only
194
194
interesting in compiler output related to a single or few methods. In this case, use the
195
- ` -Dgraal .MethodFilter ` option to specify a method filter. The matching logic for this option is
195
+ ` -Djdk.graal .MethodFilter ` option to specify a method filter. The matching logic for this option is
196
196
described in
197
197
[ MethodFilter] ( ../src/jdk.graal.compiler/src/jdk/graal/compiler/debug/MethodFilter.java#L33-L92 )
198
198
and documented in the
199
199
[ MethodFilter help message] ( ../src/jdk.graal.compiler/src/jdk/graal/compiler/debug/doc-files/MethodFilterHelp.txt ) .
200
200
201
201
## Metric filtering
202
202
203
- Alternatively, you may only want to see certain metrics. The ` -Dgraal. Timers ` , ` -Dgraal .Counters `
204
- and ` -Dgraal .MemUseTrackers ` exist for this purpose. These options take a comma separated list of
203
+ Alternatively, you may only want to see certain metrics. The ` -Djdk.graal. Timers ` , ` -Djdk.graal .Counters `
204
+ and ` -Djdk.graal .MemUseTrackers ` exist for this purpose. These options take a comma separated list of
205
205
metrics names. Only the named metrics will be activated and reported. To see the available metric
206
- names, specify ` -Dgraal .ListMetrics=true ` . At VM shutdown this option lists all the metrics that
206
+ names, specify ` -Djdk.graal .ListMetrics=true ` . At VM shutdown this option lists all the metrics that
207
207
were encountered during the VM execution. It does not list metrics registered on non-executed paths
208
208
since metric registration is lazy. For example, to see all the metrics available in a boot strap:
209
- ``` mx vm -XX:+UseJVMCICompiler -XX:+BootstrapJVMCI -Dgraal .ListMetrics=true -version ```
209
+ ``` mx vm -XX:+UseJVMCICompiler -XX:+BootstrapJVMCI -Djdk.graal .ListMetrics=true -version ```
210
210
211
211
## Dumping
212
212
@@ -218,19 +218,19 @@ visualizations of certain compiler data structures. Currently, there is support
218
218
[ Ideal Graph Visualizer (IGV)] ( ../../docs/tools/ideal-graph-visualizer.md ) , and
219
219
* LIR register allocation and generated code to the [ C1Visualizer] ( https://github.com/zakkak/c1visualizer )
220
220
221
- Dumping is enabled via the ` -Dgraal .Dump ` option. The dump handler for generating C1Visualizer
222
- output will also generate output for LIR graphs if the ` -Dgraal .PrintBackendCFG=true ` option is specified
223
- (in addition to the ` -Dgraal .Dump ` option).
221
+ Dumping is enabled via the ` -Djdk.graal .Dump ` option. The dump handler for generating C1Visualizer
222
+ output will also generate output for LIR graphs if the ` -Djdk.graal .PrintBackendCFG=true ` option is specified
223
+ (in addition to the ` -Djdk.graal .Dump ` option).
224
224
225
- By default, ` -Dgraal .Dump ` output is written to the local file system in a directory determined
226
- by the ` -Dgraal .DumpPath ` option (default is ` $CWD/graal_dumps ` ). You can send dumps directly to
227
- the IGV over a network socket with the ` -Dgraal. PrintGraph=Network ` option. The ` -Dgraal .PrintGraphHost `
228
- and ` -Dgraal .PrintGraphPort ` options determine where the dumps are sent. By default, they are
225
+ By default, ` -Djdk.graal .Dump ` output is written to the local file system in a directory determined
226
+ by the ` -Djdk.graal .DumpPath ` option (default is ` $CWD/graal_dumps ` ). You can send dumps directly to
227
+ the IGV over a network socket with the ` -Djdk.graal. PrintGraph=Network ` option. The ` -Djdk.graal .PrintGraphHost `
228
+ and ` -Djdk.graal .PrintGraphPort ` options determine where the dumps are sent. By default, they are
229
229
sent to _ 127.0.0.1:4445_ and IGV listens on port 4445 by default.
230
230
231
231
By default, the graph dumping code dumps every graph at a particular level even if the graph hasn't
232
232
changed since the previous dump. Internally the compiler tracks when changes are made to the edges
233
- of the graph and setting the flag ` -Dgraal .PrintUnmodifiedGraphs=false ` will cause it to elide graph
233
+ of the graph and setting the flag ` -Djdk.graal .PrintUnmodifiedGraphs=false ` will cause it to elide graph
234
234
dumps when no edges have changed since the previous dump. This can greatly reduce the number of
235
235
graphs dumped at high dump levels, though the resulting output can be a little harder to understand
236
236
without the context of the other graph names.
@@ -243,15 +243,15 @@ The IGV can be launched with `mx igv` and the C1Visualizer can be launched via `
243
243
244
244
Various other VM options are of interest to see activity related to compilation:
245
245
246
- - ` -XX:+PrintCompilation ` or ` -Dgraal .PrintCompilation=true ` for notification and brief info about each compilation
246
+ - ` -XX:+PrintCompilation ` or ` -Djdk.graal .PrintCompilation=true ` for notification and brief info about each compilation
247
247
- ` -XX:+TraceDeoptimization ` can be useful to see if excessive compilation is occurring
248
248
249
249
## Examples
250
250
#### Inspecting the compilation of a single method
251
251
252
252
To see the compiler data structures used while compiling ` Node.updateUsages ` , use the following command:
253
253
```
254
- > mx vm -XX:+UseJVMCICompiler -XX:+BootstrapJVMCI -XX:-TieredCompilation -Dgraal. Dump= -Dgraal .MethodFilter=Node.updateUsages -version
254
+ > mx vm -XX:+UseJVMCICompiler -XX:+BootstrapJVMCI -XX:-TieredCompilation -Djdk.graal. Dump= -Djdk.graal .MethodFilter=Node.updateUsages -version
255
255
Bootstrapping JVMCI....Dumping debug output in /Users/dsimon/graal/graal/compiler/dumps/1497910458736
256
256
................................................ in 38177 ms (compiled 5206 methods)
257
257
java version "1.8.0_212"
@@ -262,12 +262,12 @@ dumps/1497910458736/HotSpotCompilation-539[jdk.graal.compiler.graph.Node.updateU
262
262
dumps/1497910458736/HotSpotCompilation-539[jdk.graal.compiler.graph.Node.updateUsages(Node, Node)].cfg
263
263
```
264
264
265
- As you become familiar with the scope names used in the compiler, you can refine the ` -Dgraal .Dump ` option
265
+ As you become familiar with the scope names used in the compiler, you can refine the ` -Djdk.graal .Dump ` option
266
266
to limit the amount of dump output generated. For example, the ` "CodeGen" ` and ` "CodeInstall" `
267
267
scopes are active during code generation and installation respectively. To see the machine code (in
268
268
the C1Visualizer) produced during these scopes:
269
269
```
270
- mx vm -Dgraal. Dump=CodeGen,CodeInstall -Dgraal .MethodFilter=NodeClass.get -version
270
+ mx vm -Djdk.graal. Dump=CodeGen,CodeInstall -Djdk.graal .MethodFilter=NodeClass.get -version
271
271
```
272
272
You will notice that no IGV output is generated by this command.
273
273
0 commit comments