package org.graalvm.compiler.hotspot.debug;
import java.util.*;
import org.graalvm.compiler.options.*;
import org.graalvm.compiler.options.OptionType;
public class BenchmarkCounters_OptionDescriptors implements OptionDescriptors {
@Override
public OptionDescriptor get(String value) {
switch (value) {
case "AbortOnBenchmarkCounterOverflow": {
return OptionDescriptor.create(
"AbortOnBenchmarkCounterOverflow",
OptionType.Debug,
Boolean.class,
"Abort VM with SIGILL if benchmark counters controlled by the (Generic|Timed|Benchmark)DynamicCounters",
new String[] {
"option overflow. This feature is only supported on AMD64.",
"WARNING: No descriptive error message will be printed! In case of an overflow,",
"manual inspection of the emitted code is required.",
},
BenchmarkCounters.Options.class,
"AbortOnBenchmarkCounterOverflow",
BenchmarkCounters.Options.AbortOnBenchmarkCounterOverflow);
}
case "BenchmarkCountersDumpDynamic": {
return OptionDescriptor.create(
"BenchmarkCountersDumpDynamic",
OptionType.Debug,
Boolean.class,
"Dump dynamic counters",
BenchmarkCounters.Options.class,
"BenchmarkCountersDumpDynamic",
BenchmarkCounters.Options.BenchmarkCountersDumpDynamic);
}
case "BenchmarkCountersDumpStatic": {
return OptionDescriptor.create(
"BenchmarkCountersDumpStatic",
OptionType.Debug,
Boolean.class,
"Dump static counters",
BenchmarkCounters.Options.class,
"BenchmarkCountersDumpStatic",
BenchmarkCounters.Options.BenchmarkCountersDumpStatic);
}
case "BenchmarkCountersFile": {
return OptionDescriptor.create(
"BenchmarkCountersFile",
OptionType.Debug,
String.class,
"File to which benchmark counters are dumped. A CSV format is used if the file ends with .csv otherwise a more human readable format is used. The fields in the CSV format are: category, group, name, value",
BenchmarkCounters.Options.class,
"BenchmarkCountersFile",
BenchmarkCounters.Options.BenchmarkCountersFile);
}
case "BenchmarkDynamicCounters": {
return OptionDescriptor.create(
"BenchmarkDynamicCounters",
OptionType.Debug,
String.class,
"Turn on the benchmark counters. The format of this option is:",
new String[] {
"",
" (err|out),start pattern,end pattern",
" ",
"Start counting when the start pattern matches on the given stream and stop when the end pattern occurs.",
"You can use \"~\" to match 1 or more digits.",
"Examples:",
"",
" err, starting =====, PASSED in",
" out,Iteration ~ (~s) begins:,Iteration ~ (~s) ends:",
" ",
"The first pattern matches DaCapo output and the second matches SPECjvm2008 output.",
"",
"As a more detailed example, here are the options to use for getting statistics",
"about allocations within the DaCapo pmd benchmark:",
"",
" -XX:JVMCICounterSize=<value> -XX:-JVMCICountersExcludeCompiler \\",
" -Dgraal.BenchmarkDynamicCounters=\"err, starting ====, PASSED in \" \\",
" -Dgraal.ProfileAllocations=true",
" ",
"The JVMCICounterSize value depends on the granularity of the profiling -",
"10000 should be sufficient. Omit JVMCICountersExcludeCompiler to exclude",
"counting allocations on the compiler threads.",
"The counters can be further configured by the ProfileAllocationsContext option.",
"",
"We highly recommend the use of -Dgraal.AbortOnBenchmarkCounterOverflow=true to",
"detect counter overflows eagerly.",
},
BenchmarkCounters.Options.class,
"BenchmarkDynamicCounters",
BenchmarkCounters.Options.BenchmarkDynamicCounters);
}
case "DynamicCountersPrintGroupSeparator": {
return OptionDescriptor.create(
"DynamicCountersPrintGroupSeparator",
OptionType.Debug,
Boolean.class,
"Use grouping separators for number printing",
BenchmarkCounters.Options.class,
"DynamicCountersPrintGroupSeparator",
BenchmarkCounters.Options.DynamicCountersPrintGroupSeparator);
}
case "GenericDynamicCounters": {
return OptionDescriptor.create(
"GenericDynamicCounters",
OptionType.Debug,
Boolean.class,
"Turn on the benchmark counters, and displays the results on VM shutdown",
BenchmarkCounters.Options.class,
"GenericDynamicCounters",
BenchmarkCounters.Options.GenericDynamicCounters);
}
case "TimedDynamicCounters": {
return OptionDescriptor.create(
"TimedDynamicCounters",
OptionType.Debug,
Integer.class,
"Turn on the benchmark counters, and displays the results every n milliseconds",
BenchmarkCounters.Options.class,
"TimedDynamicCounters",
BenchmarkCounters.Options.TimedDynamicCounters);
}
}
return null;
}
@Override
public Iterator<OptionDescriptor> iterator() {
return new Iterator<OptionDescriptor>() {
int i = 0;
@Override
public boolean hasNext() {
return i < 8;
}
@Override
public OptionDescriptor next() {
switch (i++) {
case 0: return get("AbortOnBenchmarkCounterOverflow");
case 1: return get("BenchmarkCountersDumpDynamic");
case 2: return get("BenchmarkCountersDumpStatic");
case 3: return get("BenchmarkCountersFile");
case 4: return get("BenchmarkDynamicCounters");
case 5: return get("DynamicCountersPrintGroupSeparator");
case 6: return get("GenericDynamicCounters");
case 7: return get("TimedDynamicCounters");
}
throw new NoSuchElementException();
}
};
}
}