src/share/vm/services/diagnosticCommand.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Sdiff src/share/vm/services

src/share/vm/services/diagnosticCommand.cpp

Print this page
rev 6793 : 8054889: Compiler team's implementation task
Summary: Adding three new diagnostic commands for compiler
Reviewed-by:


  43   // Third  argument specifies if the command is hidden
  44   uint32_t full_export = DCmd_Source_Internal | DCmd_Source_AttachAPI
  45                          | DCmd_Source_MBean;
  46   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<HelpDCmd>(full_export, true, false));
  47   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<VersionDCmd>(full_export, true, false));
  48   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<CommandLineDCmd>(full_export, true, false));
  49   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<PrintSystemPropertiesDCmd>(full_export, true, false));
  50   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<PrintVMFlagsDCmd>(full_export, true, false));
  51   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<VMDynamicLibrariesDCmd>(full_export, true, false));
  52   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<VMUptimeDCmd>(full_export, true, false));
  53   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<SystemGCDCmd>(full_export, true, false));
  54   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<RunFinalizationDCmd>(full_export, true, false));
  55 #if INCLUDE_SERVICES // Heap dumping/inspection supported
  56   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<HeapDumpDCmd>(DCmd_Source_Internal | DCmd_Source_AttachAPI, true, false));
  57   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ClassHistogramDCmd>(full_export, true, false));
  58   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ClassStatsDCmd>(full_export, true, false));
  59 #endif // INCLUDE_SERVICES
  60   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ThreadDumpDCmd>(full_export, true, false));
  61   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<RotateGCLogDCmd>(full_export, true, false));
  62   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ClassLoaderStatsDCmd>(full_export, true, false));



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


 655     JavaCalls::call_static(&result, ik, vmSymbols::stopRemoteAgent_name(), vmSymbols::void_method_signature(), CHECK);
 656 }
 657 
 658 VMDynamicLibrariesDCmd::VMDynamicLibrariesDCmd(outputStream *output, bool heap_allocated) :
 659   DCmd(output, heap_allocated) {
 660   // do nothing
 661 }
 662 
 663 void VMDynamicLibrariesDCmd::execute(DCmdSource source, TRAPS) {
 664   os::print_dll_info(output());
 665   output()->cr();
 666 }
 667 
 668 void RotateGCLogDCmd::execute(DCmdSource source, TRAPS) {
 669   if (UseGCLogFileRotation) {
 670     VM_RotateGCLog rotateop(output());
 671     VMThread::execute(&rotateop);
 672   } else {
 673     output()->print_cr("Target VM does not support GC log file rotation.");
 674   }















 675 }
 676 


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


 658     JavaCalls::call_static(&result, ik, vmSymbols::stopRemoteAgent_name(), vmSymbols::void_method_signature(), CHECK);
 659 }
 660 
 661 VMDynamicLibrariesDCmd::VMDynamicLibrariesDCmd(outputStream *output, bool heap_allocated) :
 662   DCmd(output, heap_allocated) {
 663   // do nothing
 664 }
 665 
 666 void VMDynamicLibrariesDCmd::execute(DCmdSource source, TRAPS) {
 667   os::print_dll_info(output());
 668   output()->cr();
 669 }
 670 
 671 void RotateGCLogDCmd::execute(DCmdSource source, TRAPS) {
 672   if (UseGCLogFileRotation) {
 673     VM_RotateGCLog rotateop(output());
 674     VMThread::execute(&rotateop);
 675   } else {
 676     output()->print_cr("Target VM does not support GC log file rotation.");
 677   }
 678 }
 679 
 680 void CompileQueueDCmd::execute(DCmdSource source, TRAPS) {
 681   VM_PrintCompileQueue printCompileQueueOp(output());
 682   VMThread::execute(&printCompileQueueOp);
 683 }
 684 
 685 void CodeListDCmd::execute(DCmdSource source, TRAPS) {
 686   VM_PrintCodeList printCodeListOp(output());
 687   VMThread::execute(&printCodeListOp);
 688 }
 689 
 690 void CodeCacheDCmd::execute(DCmdSource source, TRAPS) {
 691   VM_PrintCodeCache printCodeCacheOp(output());
 692   VMThread::execute(&printCodeCacheOp);
 693 }
 694 
src/share/vm/services/diagnosticCommand.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File