86 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ClassHistogramDCmd>(full_export, true, false));
87 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ClassStatsDCmd>(full_export, true, false));
88 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<SystemDictionaryDCmd>(full_export, true, false));
89 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ClassHierarchyDCmd>(full_export, true, false));
90 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<SymboltableDCmd>(full_export, true, false));
91 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<StringtableDCmd>(full_export, true, false));
92 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<MetaspaceDCmd>(full_export, true, false));
93 #if INCLUDE_JVMTI // Both JVMTI and SERVICES have to be enabled to have this dcmd
94 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<JVMTIAgentLoadDCmd>(full_export, true, false));
95 #endif // INCLUDE_JVMTI
96 #endif // INCLUDE_SERVICES
97 #if INCLUDE_JVMTI
98 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<JVMTIDataDumpDCmd>(full_export, true, false));
99 #endif // INCLUDE_JVMTI
100 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ThreadDumpDCmd>(full_export, true, false));
101 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ClassLoaderStatsDCmd>(full_export, true, false));
102 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<CompileQueueDCmd>(full_export, true, false));
103 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<CodeListDCmd>(full_export, true, false));
104 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<CodeCacheDCmd>(full_export, true, false));
105 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<TouchedMethodsDCmd>(full_export, true, false));
106
107 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<CompilerDirectivesPrintDCmd>(full_export, true, false));
108 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<CompilerDirectivesAddDCmd>(full_export, true, false));
109 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<CompilerDirectivesRemoveDCmd>(full_export, true, false));
110 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<CompilerDirectivesClearDCmd>(full_export, true, false));
111
112 // Enhanced JMX Agent Support
113 // These commands won't be exported via the DiagnosticCommandMBean until an
114 // appropriate permission is created for them
115 uint32_t jmx_agent_export_flags = DCmd_Source_Internal | DCmd_Source_AttachAPI;
116 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<JMXStartRemoteDCmd>(jmx_agent_export_flags, true,false));
117 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<JMXStartLocalDCmd>(jmx_agent_export_flags, true,false));
118 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<JMXStopRemoteDCmd>(jmx_agent_export_flags, true,false));
119 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<JMXStatusDCmd>(jmx_agent_export_flags, true,false));
120
121 }
122
123 #ifndef HAVE_EXTRA_DCMD
124 void DCmdRegistrant::register_dcmds_ext(){
125 // Do nothing here
901 // do nothing
902 }
903
904 void VMDynamicLibrariesDCmd::execute(DCmdSource source, TRAPS) {
905 os::print_dll_info(output());
906 output()->cr();
907 }
908
909 void CompileQueueDCmd::execute(DCmdSource source, TRAPS) {
910 VM_PrintCompileQueue printCompileQueueOp(output());
911 VMThread::execute(&printCompileQueueOp);
912 }
913
914 void CodeListDCmd::execute(DCmdSource source, TRAPS) {
915 CodeCache::print_codelist(output());
916 }
917
918 void CodeCacheDCmd::execute(DCmdSource source, TRAPS) {
919 CodeCache::print_layout(output());
920 }
921
922 void CompilerDirectivesPrintDCmd::execute(DCmdSource source, TRAPS) {
923 DirectivesStack::print(output());
924 }
925
926 CompilerDirectivesAddDCmd::CompilerDirectivesAddDCmd(outputStream* output, bool heap) :
927 DCmdWithParser(output, heap),
928 _filename("filename","Name of the directives file", "STRING",true) {
929 _dcmdparser.add_dcmd_argument(&_filename);
930 }
931
932 void CompilerDirectivesAddDCmd::execute(DCmdSource source, TRAPS) {
933 DirectivesParser::parse_from_file(_filename.value(), output());
934 }
935
936 int CompilerDirectivesAddDCmd::num_arguments() {
937 ResourceMark rm;
938 CompilerDirectivesAddDCmd* dcmd = new CompilerDirectivesAddDCmd(NULL, false);
939 if (dcmd != NULL) {
940 DCmdMark mark(dcmd);
|
86 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ClassHistogramDCmd>(full_export, true, false));
87 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ClassStatsDCmd>(full_export, true, false));
88 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<SystemDictionaryDCmd>(full_export, true, false));
89 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ClassHierarchyDCmd>(full_export, true, false));
90 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<SymboltableDCmd>(full_export, true, false));
91 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<StringtableDCmd>(full_export, true, false));
92 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<MetaspaceDCmd>(full_export, true, false));
93 #if INCLUDE_JVMTI // Both JVMTI and SERVICES have to be enabled to have this dcmd
94 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<JVMTIAgentLoadDCmd>(full_export, true, false));
95 #endif // INCLUDE_JVMTI
96 #endif // INCLUDE_SERVICES
97 #if INCLUDE_JVMTI
98 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<JVMTIDataDumpDCmd>(full_export, true, false));
99 #endif // INCLUDE_JVMTI
100 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ThreadDumpDCmd>(full_export, true, false));
101 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ClassLoaderStatsDCmd>(full_export, true, false));
102 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<CompileQueueDCmd>(full_export, true, false));
103 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<CodeListDCmd>(full_export, true, false));
104 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<CodeCacheDCmd>(full_export, true, false));
105 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<TouchedMethodsDCmd>(full_export, true, false));
106 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<CodeHeapAnalyticsDCmd>(full_export, true, false));
107
108 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<CompilerDirectivesPrintDCmd>(full_export, true, false));
109 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<CompilerDirectivesAddDCmd>(full_export, true, false));
110 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<CompilerDirectivesRemoveDCmd>(full_export, true, false));
111 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<CompilerDirectivesClearDCmd>(full_export, true, false));
112
113 // Enhanced JMX Agent Support
114 // These commands won't be exported via the DiagnosticCommandMBean until an
115 // appropriate permission is created for them
116 uint32_t jmx_agent_export_flags = DCmd_Source_Internal | DCmd_Source_AttachAPI;
117 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<JMXStartRemoteDCmd>(jmx_agent_export_flags, true,false));
118 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<JMXStartLocalDCmd>(jmx_agent_export_flags, true,false));
119 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<JMXStopRemoteDCmd>(jmx_agent_export_flags, true,false));
120 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<JMXStatusDCmd>(jmx_agent_export_flags, true,false));
121
122 }
123
124 #ifndef HAVE_EXTRA_DCMD
125 void DCmdRegistrant::register_dcmds_ext(){
126 // Do nothing here
902 // do nothing
903 }
904
905 void VMDynamicLibrariesDCmd::execute(DCmdSource source, TRAPS) {
906 os::print_dll_info(output());
907 output()->cr();
908 }
909
910 void CompileQueueDCmd::execute(DCmdSource source, TRAPS) {
911 VM_PrintCompileQueue printCompileQueueOp(output());
912 VMThread::execute(&printCompileQueueOp);
913 }
914
915 void CodeListDCmd::execute(DCmdSource source, TRAPS) {
916 CodeCache::print_codelist(output());
917 }
918
919 void CodeCacheDCmd::execute(DCmdSource source, TRAPS) {
920 CodeCache::print_layout(output());
921 }
922
923 //---< BEGIN >--- CodeHeap State Analytics.
924 CodeHeapAnalyticsDCmd::CodeHeapAnalyticsDCmd(outputStream* output, bool heap) :
925 DCmdWithParser(output, heap),
926 _function("function", "Function to be performed (aggregate, UsedSpace, FreeSpace, MethodCount, MethodSpace, MethodAge, MethodNames, discard", "STRING", false, "all"),
927 _granularity("granularity", "Detail level - smaller value -> more detail", "STRING", false, "4096") {
928 _dcmdparser.add_dcmd_argument(&_function);
929 _dcmdparser.add_dcmd_argument(&_granularity);
930 }
931
932 void CodeHeapAnalyticsDCmd::execute(DCmdSource source, TRAPS) {
933 CompileBroker::print_heapinfo(output(), _function.value(), _granularity.value());
934 }
935
936 int CodeHeapAnalyticsDCmd::num_arguments() {
937 ResourceMark rm;
938 CodeHeapAnalyticsDCmd* dcmd = new CodeHeapAnalyticsDCmd(NULL, false);
939 if (dcmd != NULL) {
940 DCmdMark mark(dcmd);
941 return dcmd->_dcmdparser.num_arguments();
942 } else {
943 return 0;
944 }
945 }
946 //---< END >--- CodeHeap State Analytics.
947
948 void CompilerDirectivesPrintDCmd::execute(DCmdSource source, TRAPS) {
949 DirectivesStack::print(output());
950 }
951
952 CompilerDirectivesAddDCmd::CompilerDirectivesAddDCmd(outputStream* output, bool heap) :
953 DCmdWithParser(output, heap),
954 _filename("filename","Name of the directives file", "STRING",true) {
955 _dcmdparser.add_dcmd_argument(&_filename);
956 }
957
958 void CompilerDirectivesAddDCmd::execute(DCmdSource source, TRAPS) {
959 DirectivesParser::parse_from_file(_filename.value(), output());
960 }
961
962 int CompilerDirectivesAddDCmd::num_arguments() {
963 ResourceMark rm;
964 CompilerDirectivesAddDCmd* dcmd = new CompilerDirectivesAddDCmd(NULL, false);
965 if (dcmd != NULL) {
966 DCmdMark mark(dcmd);
|