src/share/vm/services/diagnosticCommand.cpp

Print this page




  38   // First argument specifies which interfaces will export the command
  39   // Second argument specifies if the command is enabled
  40   // Third  argument specifies if the command is hidden
  41   uint32_t full_export = DCmd_Source_Internal | DCmd_Source_AttachAPI
  42                          | DCmd_Source_MBean;
  43   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<HelpDCmd>(full_export, true, false));
  44   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<VersionDCmd>(full_export, true, false));
  45   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<CommandLineDCmd>(full_export, true, false));
  46   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<PrintSystemPropertiesDCmd>(full_export, true, false));
  47   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<PrintVMFlagsDCmd>(full_export, true, false));
  48   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<VMDynamicLibrariesDCmd>(full_export, true, false));
  49   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<VMUptimeDCmd>(full_export, true, false));
  50   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<SystemGCDCmd>(full_export, true, false));
  51   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<RunFinalizationDCmd>(full_export, true, false));
  52 #if INCLUDE_SERVICES // Heap dumping/inspection supported
  53   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<HeapDumpDCmd>(DCmd_Source_Internal | DCmd_Source_AttachAPI, true, false));
  54   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ClassHistogramDCmd>(full_export, true, false));
  55   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ClassStatsDCmd>(full_export, true, false));
  56 #endif // INCLUDE_SERVICES
  57   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ThreadDumpDCmd>(full_export, true, false));

  58 
  59   // Enhanced JMX Agent Support
  60   // These commands won't be exported via the DiagnosticCommandMBean until an
  61   // appropriate permission is created for them
  62   uint32_t jmx_agent_export_flags = DCmd_Source_Internal | DCmd_Source_AttachAPI;
  63   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<JMXStartRemoteDCmd>(jmx_agent_export_flags, true,false));
  64   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<JMXStartLocalDCmd>(jmx_agent_export_flags, true,false));
  65   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<JMXStopRemoteDCmd>(jmx_agent_export_flags, true,false));
  66 
  67 }
  68 
  69 #ifndef HAVE_EXTRA_DCMD
  70 void DCmdRegistrant::register_dcmds_ext(){
  71    // Do nothing here
  72 }
  73 #endif
  74 
  75 
  76 HelpDCmd::HelpDCmd(outputStream* output, bool heap) : DCmdWithParser(output, heap),
  77   _all("-all", "Show help for all commands", "BOOLEAN", false, "false"),


 642     // management server
 643     // throw java.lang.NoSuchMethodError if method doesn't exist
 644 
 645     Handle loader = Handle(THREAD, SystemDictionary::java_system_loader());
 646     Klass* k = SystemDictionary::resolve_or_fail(vmSymbols::sun_management_Agent(), loader, Handle(), true, CHECK);
 647     instanceKlassHandle ik (THREAD, k);
 648 
 649     JavaValue result(T_VOID);
 650     JavaCalls::call_static(&result, ik, vmSymbols::stopRemoteAgent_name(), vmSymbols::void_method_signature(), CHECK);
 651 }
 652 
 653 VMDynamicLibrariesDCmd::VMDynamicLibrariesDCmd(outputStream *output, bool heap_allocated) :
 654   DCmd(output, heap_allocated) {
 655   // do nothing
 656 }
 657 
 658 void VMDynamicLibrariesDCmd::execute(DCmdSource source, TRAPS) {
 659   os::print_dll_info(output());
 660   output()->cr();
 661 }












  38   // First argument specifies which interfaces will export the command
  39   // Second argument specifies if the command is enabled
  40   // Third  argument specifies if the command is hidden
  41   uint32_t full_export = DCmd_Source_Internal | DCmd_Source_AttachAPI
  42                          | DCmd_Source_MBean;
  43   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<HelpDCmd>(full_export, true, false));
  44   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<VersionDCmd>(full_export, true, false));
  45   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<CommandLineDCmd>(full_export, true, false));
  46   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<PrintSystemPropertiesDCmd>(full_export, true, false));
  47   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<PrintVMFlagsDCmd>(full_export, true, false));
  48   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<VMDynamicLibrariesDCmd>(full_export, true, false));
  49   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<VMUptimeDCmd>(full_export, true, false));
  50   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<SystemGCDCmd>(full_export, true, false));
  51   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<RunFinalizationDCmd>(full_export, true, false));
  52 #if INCLUDE_SERVICES // Heap dumping/inspection supported
  53   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<HeapDumpDCmd>(DCmd_Source_Internal | DCmd_Source_AttachAPI, true, false));
  54   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ClassHistogramDCmd>(full_export, true, false));
  55   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ClassStatsDCmd>(full_export, true, false));
  56 #endif // INCLUDE_SERVICES
  57   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ThreadDumpDCmd>(full_export, true, false));
  58   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<RotateGCLogDCmd>(full_export, true, false));
  59 
  60   // Enhanced JMX Agent Support
  61   // These commands won't be exported via the DiagnosticCommandMBean until an
  62   // appropriate permission is created for them
  63   uint32_t jmx_agent_export_flags = DCmd_Source_Internal | DCmd_Source_AttachAPI;
  64   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<JMXStartRemoteDCmd>(jmx_agent_export_flags, true,false));
  65   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<JMXStartLocalDCmd>(jmx_agent_export_flags, true,false));
  66   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<JMXStopRemoteDCmd>(jmx_agent_export_flags, true,false));
  67 
  68 }
  69 
  70 #ifndef HAVE_EXTRA_DCMD
  71 void DCmdRegistrant::register_dcmds_ext(){
  72    // Do nothing here
  73 }
  74 #endif
  75 
  76 
  77 HelpDCmd::HelpDCmd(outputStream* output, bool heap) : DCmdWithParser(output, heap),
  78   _all("-all", "Show help for all commands", "BOOLEAN", false, "false"),


 643     // management server
 644     // throw java.lang.NoSuchMethodError if method doesn't exist
 645 
 646     Handle loader = Handle(THREAD, SystemDictionary::java_system_loader());
 647     Klass* k = SystemDictionary::resolve_or_fail(vmSymbols::sun_management_Agent(), loader, Handle(), true, CHECK);
 648     instanceKlassHandle ik (THREAD, k);
 649 
 650     JavaValue result(T_VOID);
 651     JavaCalls::call_static(&result, ik, vmSymbols::stopRemoteAgent_name(), vmSymbols::void_method_signature(), CHECK);
 652 }
 653 
 654 VMDynamicLibrariesDCmd::VMDynamicLibrariesDCmd(outputStream *output, bool heap_allocated) :
 655   DCmd(output, heap_allocated) {
 656   // do nothing
 657 }
 658 
 659 void VMDynamicLibrariesDCmd::execute(DCmdSource source, TRAPS) {
 660   os::print_dll_info(output());
 661   output()->cr();
 662 }
 663 
 664 void RotateGCLogDCmd::execute(DCmdSource source, TRAPS) {
 665   if (UseGCLogFileRotation) {
 666     VM_RotateGCLog rotateop(output());
 667     VMThread::execute(&rotateop);
 668   } else {
 669     output()->print_cr("Target VM does not support GC log file rotation.");
 670   }
 671 }
 672