106 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ClassLoaderHierarchyDCmd>(full_export, true, false));
107 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<CompileQueueDCmd>(full_export, true, false));
108 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<CodeListDCmd>(full_export, true, false));
109 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<CodeCacheDCmd>(full_export, true, false));
110 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<TouchedMethodsDCmd>(full_export, true, false));
111 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<CodeHeapAnalyticsDCmd>(full_export, true, false));
112
113 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<CompilerDirectivesPrintDCmd>(full_export, true, false));
114 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<CompilerDirectivesAddDCmd>(full_export, true, false));
115 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<CompilerDirectivesRemoveDCmd>(full_export, true, false));
116 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<CompilerDirectivesClearDCmd>(full_export, true, false));
117
118 // Enhanced JMX Agent Support
119 // These commands won't be exported via the DiagnosticCommandMBean until an
120 // appropriate permission is created for them
121 uint32_t jmx_agent_export_flags = DCmd_Source_Internal | DCmd_Source_AttachAPI;
122 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<JMXStartRemoteDCmd>(jmx_agent_export_flags, true,false));
123 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<JMXStartLocalDCmd>(jmx_agent_export_flags, true,false));
124 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<JMXStopRemoteDCmd>(jmx_agent_export_flags, true,false));
125 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<JMXStatusDCmd>(jmx_agent_export_flags, true,false));
126 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<VTBufferStatsDCmd>(full_export, true, false));
127 }
128
129 #ifndef HAVE_EXTRA_DCMD
130 void DCmdRegistrant::register_dcmds_ext(){
131 // Do nothing here
132 }
133 #endif
134
135
136 HelpDCmd::HelpDCmd(outputStream* output, bool heap) : DCmdWithParser(output, heap),
137 _all("-all", "Show help for all commands", "BOOLEAN", false, "false"),
138 _cmd("command name", "The name of the command for which we want help",
139 "STRING", false) {
140 _dcmdparser.add_dcmd_option(&_all);
141 _dcmdparser.add_dcmd_argument(&_cmd);
142 };
143
144
145 static int compare_strings(const char** s1, const char** s2) {
146 return ::strcmp(*s1, *s2);
1039 }
1040 };
1041
1042 TouchedMethodsDCmd::TouchedMethodsDCmd(outputStream* output, bool heap) :
1043 DCmdWithParser(output, heap)
1044 {}
1045
1046 void TouchedMethodsDCmd::execute(DCmdSource source, TRAPS) {
1047 if (!LogTouchedMethods) {
1048 output()->print_cr("VM.print_touched_methods command requires -XX:+LogTouchedMethods");
1049 return;
1050 }
1051 VM_DumpTouchedMethods dumper(output());
1052 VMThread::execute(&dumper);
1053 }
1054
1055 int TouchedMethodsDCmd::num_arguments() {
1056 return 0;
1057 }
1058
1059 VTBufferStatsDCmd::VTBufferStatsDCmd(outputStream* output, bool heap) :
1060 DCmd(output, heap) { }
1061
1062 void VTBufferStatsDCmd::execute(DCmdSource source, TRAPS) {
1063
1064 VM_VTBufferStats op1(output());
1065 VMThread::execute(&op1);
1066
1067 int in_pool;
1068 int max_in_pool;
1069 int total_allocated;
1070 int total_failed;
1071 {
1072 MutexLockerEx ml(VTBuffer::lock(), Mutex::_no_safepoint_check_flag);
1073 in_pool = VTBuffer::in_pool();
1074 max_in_pool = VTBuffer::max_in_pool();
1075 total_allocated = VTBuffer::total_allocated();
1076 total_failed = VTBuffer::total_failed();
1077 }
1078 output()->print_cr("Global VTBuffer Pool statistics:");
1079 output()->print_cr("\tChunks in pool : %d", in_pool);
1080 output()->print_cr("\tMax in pool : %d", max_in_pool);
1081 output()->print_cr("\tTotal allocated : %d", total_allocated);
1082 output()->print_cr("\tTotal failed : %d", total_failed);
1083 }
|
106 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ClassLoaderHierarchyDCmd>(full_export, true, false));
107 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<CompileQueueDCmd>(full_export, true, false));
108 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<CodeListDCmd>(full_export, true, false));
109 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<CodeCacheDCmd>(full_export, true, false));
110 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<TouchedMethodsDCmd>(full_export, true, false));
111 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<CodeHeapAnalyticsDCmd>(full_export, true, false));
112
113 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<CompilerDirectivesPrintDCmd>(full_export, true, false));
114 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<CompilerDirectivesAddDCmd>(full_export, true, false));
115 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<CompilerDirectivesRemoveDCmd>(full_export, true, false));
116 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<CompilerDirectivesClearDCmd>(full_export, true, false));
117
118 // Enhanced JMX Agent Support
119 // These commands won't be exported via the DiagnosticCommandMBean until an
120 // appropriate permission is created for them
121 uint32_t jmx_agent_export_flags = DCmd_Source_Internal | DCmd_Source_AttachAPI;
122 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<JMXStartRemoteDCmd>(jmx_agent_export_flags, true,false));
123 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<JMXStartLocalDCmd>(jmx_agent_export_flags, true,false));
124 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<JMXStopRemoteDCmd>(jmx_agent_export_flags, true,false));
125 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<JMXStatusDCmd>(jmx_agent_export_flags, true,false));
126 }
127
128 #ifndef HAVE_EXTRA_DCMD
129 void DCmdRegistrant::register_dcmds_ext(){
130 // Do nothing here
131 }
132 #endif
133
134
135 HelpDCmd::HelpDCmd(outputStream* output, bool heap) : DCmdWithParser(output, heap),
136 _all("-all", "Show help for all commands", "BOOLEAN", false, "false"),
137 _cmd("command name", "The name of the command for which we want help",
138 "STRING", false) {
139 _dcmdparser.add_dcmd_option(&_all);
140 _dcmdparser.add_dcmd_argument(&_cmd);
141 };
142
143
144 static int compare_strings(const char** s1, const char** s2) {
145 return ::strcmp(*s1, *s2);
1038 }
1039 };
1040
1041 TouchedMethodsDCmd::TouchedMethodsDCmd(outputStream* output, bool heap) :
1042 DCmdWithParser(output, heap)
1043 {}
1044
1045 void TouchedMethodsDCmd::execute(DCmdSource source, TRAPS) {
1046 if (!LogTouchedMethods) {
1047 output()->print_cr("VM.print_touched_methods command requires -XX:+LogTouchedMethods");
1048 return;
1049 }
1050 VM_DumpTouchedMethods dumper(output());
1051 VMThread::execute(&dumper);
1052 }
1053
1054 int TouchedMethodsDCmd::num_arguments() {
1055 return 0;
1056 }
1057
|