hotspot/src/share/vm/services/diagnosticCommand.cpp
changeset 29085 7b01b134b727
parent 29081 c61eb4914428
parent 29074 fbd83ffd242b
child 30121 cc43664a0ad7
equal deleted inserted replaced
29084:1b732f2836ce 29085:7b01b134b727
    56   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<RunFinalizationDCmd>(full_export, true, false));
    56   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<RunFinalizationDCmd>(full_export, true, false));
    57 #if INCLUDE_SERVICES // Heap dumping/inspection supported
    57 #if INCLUDE_SERVICES // Heap dumping/inspection supported
    58   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<HeapDumpDCmd>(DCmd_Source_Internal | DCmd_Source_AttachAPI, true, false));
    58   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<HeapDumpDCmd>(DCmd_Source_Internal | DCmd_Source_AttachAPI, true, false));
    59   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ClassHistogramDCmd>(full_export, true, false));
    59   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ClassHistogramDCmd>(full_export, true, false));
    60   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ClassStatsDCmd>(full_export, true, false));
    60   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ClassStatsDCmd>(full_export, true, false));
       
    61   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ClassHierarchyDCmd>(full_export, true, false));
    61   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<SymboltableDCmd>(full_export, true, false));
    62   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<SymboltableDCmd>(full_export, true, false));
    62   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<StringtableDCmd>(full_export, true, false));
    63   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<StringtableDCmd>(full_export, true, false));
    63 #endif // INCLUDE_SERVICES
    64 #endif // INCLUDE_SERVICES
    64   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ThreadDumpDCmd>(full_export, true, false));
    65   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ThreadDumpDCmd>(full_export, true, false));
    65   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<RotateGCLogDCmd>(full_export, true, false));
    66   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<RotateGCLogDCmd>(full_export, true, false));
   694 void CodeCacheDCmd::execute(DCmdSource source, TRAPS) {
   695 void CodeCacheDCmd::execute(DCmdSource source, TRAPS) {
   695   VM_PrintCodeCache printCodeCacheOp(output());
   696   VM_PrintCodeCache printCodeCacheOp(output());
   696   VMThread::execute(&printCodeCacheOp);
   697   VMThread::execute(&printCodeCacheOp);
   697 }
   698 }
   698 
   699 
       
   700 #if INCLUDE_SERVICES
       
   701 ClassHierarchyDCmd::ClassHierarchyDCmd(outputStream* output, bool heap) :
       
   702                                        DCmdWithParser(output, heap),
       
   703   _print_interfaces("-i", "Inherited interfaces should be printed.", "BOOLEAN", false, "false"),
       
   704   _print_subclasses("-s", "If a classname is specified, print its subclasses. "
       
   705                     "Otherwise only its superclasses are printed.", "BOOLEAN", false, "false"),
       
   706   _classname("classname", "Name of class whose hierarchy should be printed. "
       
   707              "If not specified, all class hierarchies are printed.",
       
   708              "STRING", false) {
       
   709   _dcmdparser.add_dcmd_option(&_print_interfaces);
       
   710   _dcmdparser.add_dcmd_option(&_print_subclasses);
       
   711   _dcmdparser.add_dcmd_argument(&_classname);
       
   712 }
       
   713 
       
   714 void ClassHierarchyDCmd::execute(DCmdSource source, TRAPS) {
       
   715   VM_PrintClassHierarchy printClassHierarchyOp(output(), _print_interfaces.value(),
       
   716                                                _print_subclasses.value(), _classname.value());
       
   717   VMThread::execute(&printClassHierarchyOp);
       
   718 }
       
   719 
       
   720 int ClassHierarchyDCmd::num_arguments() {
       
   721   ResourceMark rm;
       
   722   ClassHierarchyDCmd* dcmd = new ClassHierarchyDCmd(NULL, false);
       
   723   if (dcmd != NULL) {
       
   724     DCmdMark mark(dcmd);
       
   725     return dcmd->_dcmdparser.num_arguments();
       
   726   } else {
       
   727     return 0;
       
   728   }
       
   729 }
       
   730 
       
   731 #endif