--- old/src/hotspot/share/services/diagnosticCommand.cpp 2018-03-01 18:10:04.359686000 +0100 +++ new/src/hotspot/share/services/diagnosticCommand.cpp 2018-03-01 18:10:04.125673000 +0100 @@ -103,6 +103,7 @@ DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); + DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); @@ -919,6 +920,31 @@ CodeCache::print_layout(output()); } +//---< BEGIN >--- 8198691: CodeHeap State Analytics. +CodeHeapAnalyticsDCmd::CodeHeapAnalyticsDCmd(outputStream* output, bool heap) : + DCmdWithParser(output, heap), + _function("function", "Function to be performed (aggregate, UsedSpace, FreeSpace, MethodCount, MethodSpace, MethodAge, MethodNames, discard", "STRING", false, "all"), + _granularity("granularity", "Detail level - smaller value -> more detail", "STRING", false, "4096") { + _dcmdparser.add_dcmd_argument(&_function); + _dcmdparser.add_dcmd_argument(&_granularity); +} + +void CodeHeapAnalyticsDCmd::execute(DCmdSource source, TRAPS) { + CompileBroker::print_heapinfo(output(), _function.value(), _granularity.value()); +} + +int CodeHeapAnalyticsDCmd::num_arguments() { + ResourceMark rm; + CodeHeapAnalyticsDCmd* dcmd = new CodeHeapAnalyticsDCmd(NULL, false); + if (dcmd != NULL) { + DCmdMark mark(dcmd); + return dcmd->_dcmdparser.num_arguments(); + } else { + return 0; + } +} +//---< END >--- 8198691: CodeHeap State Analytics. + void CompilerDirectivesPrintDCmd::execute(DCmdSource source, TRAPS) { DirectivesStack::print(output()); }