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 "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, and listen for specific patterns on System.out/System.err.",
new String[] {
"The format of this option is:",
"",
" (err|out),start pattern,end pattern",
" ",
"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.",
},
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 < 7;
}
@Override
public OptionDescriptor next() {
switch (i++) {
case 0: return get("BenchmarkCountersDumpDynamic");
case 1: return get("BenchmarkCountersDumpStatic");
case 2: return get("BenchmarkCountersFile");
case 3: return get("BenchmarkDynamicCounters");
case 4: return get("DynamicCountersPrintGroupSeparator");
case 5: return get("GenericDynamicCounters");
case 6: return get("TimedDynamicCounters");
}
throw new NoSuchElementException();
}
};
}
}