100 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<CommandLineDCmd>(full_export, true, false));
101 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<PrintSystemPropertiesDCmd>(full_export, true, false));
102 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<PrintVMFlagsDCmd>(full_export, true, false));
103 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<SetVMFlagDCmd>(full_export, true, false));
104 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<VMDynamicLibrariesDCmd>(full_export, true, false));
105 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<VMUptimeDCmd>(full_export, true, false));
106 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<VMInfoDCmd>(full_export, true, false));
107 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<SystemGCDCmd>(full_export, true, false));
108 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<RunFinalizationDCmd>(full_export, true, false));
109 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<HeapInfoDCmd>(full_export, true, false));
110 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<FinalizerInfoDCmd>(full_export, true, false));
111 #if INCLUDE_SERVICES
112 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<HeapDumpDCmd>(DCmd_Source_Internal | DCmd_Source_AttachAPI, true, false));
113 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ClassHistogramDCmd>(full_export, true, false));
114 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<SystemDictionaryDCmd>(full_export, true, false));
115 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ClassHierarchyDCmd>(full_export, true, false));
116 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ClassesDCmd>(full_export, true, false));
117 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<SymboltableDCmd>(full_export, true, false));
118 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<StringtableDCmd>(full_export, true, false));
119 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<metaspace::MetaspaceDCmd>(full_export, true, false));
120 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<EventLogDCmd>(full_export, true, false));
121 #if INCLUDE_JVMTI // Both JVMTI and SERVICES have to be enabled to have this dcmd
122 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<JVMTIAgentLoadDCmd>(full_export, true, false));
123 #endif // INCLUDE_JVMTI
124 #endif // INCLUDE_SERVICES
125 #if INCLUDE_JVMTI
126 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<JVMTIDataDumpDCmd>(full_export, true, false));
127 #endif // INCLUDE_JVMTI
128 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ThreadDumpDCmd>(full_export, true, false));
129 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ThreadDumpToFileDCmd>(full_export, true, false));
130 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<VThreadSchedulerDCmd>(full_export, true, false));
131 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<VThreadPollersDCmd>(full_export, true, false));
132 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ClassLoaderStatsDCmd>(full_export, true, false));
133 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ClassLoaderHierarchyDCmd>(full_export, true, false));
134 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<CompileQueueDCmd>(full_export, true, false));
135 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<CodeListDCmd>(full_export, true, false));
136 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<CodeCacheDCmd>(full_export, true, false));
137 #ifdef LINUX
138 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<PerfMapDCmd>(full_export, true, false));
139 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<TrimCLibcHeapDCmd>(full_export, true, false));
928 #if INCLUDE_SERVICES
929 ClassHierarchyDCmd::ClassHierarchyDCmd(outputStream* output, bool heap) :
930 DCmdWithParser(output, heap),
931 _print_interfaces("-i", "Inherited interfaces should be printed.", "BOOLEAN", false, "false"),
932 _print_subclasses("-s", "If a classname is specified, print its subclasses "
933 "in addition to its superclasses. Without this option only the "
934 "superclasses will be printed.", "BOOLEAN", false, "false"),
935 _classname("classname", "Name of class whose hierarchy should be printed. "
936 "If not specified, all class hierarchies are printed.",
937 "STRING", false) {
938 _dcmdparser.add_dcmd_option(&_print_interfaces);
939 _dcmdparser.add_dcmd_option(&_print_subclasses);
940 _dcmdparser.add_dcmd_argument(&_classname);
941 }
942
943 void ClassHierarchyDCmd::execute(DCmdSource source, TRAPS) {
944 VM_PrintClassHierarchy printClassHierarchyOp(output(), _print_interfaces.value(),
945 _print_subclasses.value(), _classname.value());
946 VMThread::execute(&printClassHierarchyOp);
947 }
948 #endif
949
950 ClassesDCmd::ClassesDCmd(outputStream* output, bool heap) :
951 DCmdWithParser(output, heap),
952 _verbose("-verbose",
953 "Dump the detailed content of a Java class. "
954 "Some classes are annotated with flags: "
955 "F = has, or inherits, a non-empty finalize method, "
956 "f = has final method, "
957 "W = methods rewritten, "
958 "C = marked with @Contended annotation, "
959 "R = has been redefined, "
960 "S = is shared class",
961 "BOOLEAN", false, "false") {
962 _dcmdparser.add_dcmd_option(&_verbose);
963 }
964
965 class VM_PrintClasses : public VM_Operation {
966 private:
967 outputStream* _out;
968 bool _verbose;
|
100 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<CommandLineDCmd>(full_export, true, false));
101 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<PrintSystemPropertiesDCmd>(full_export, true, false));
102 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<PrintVMFlagsDCmd>(full_export, true, false));
103 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<SetVMFlagDCmd>(full_export, true, false));
104 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<VMDynamicLibrariesDCmd>(full_export, true, false));
105 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<VMUptimeDCmd>(full_export, true, false));
106 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<VMInfoDCmd>(full_export, true, false));
107 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<SystemGCDCmd>(full_export, true, false));
108 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<RunFinalizationDCmd>(full_export, true, false));
109 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<HeapInfoDCmd>(full_export, true, false));
110 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<FinalizerInfoDCmd>(full_export, true, false));
111 #if INCLUDE_SERVICES
112 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<HeapDumpDCmd>(DCmd_Source_Internal | DCmd_Source_AttachAPI, true, false));
113 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ClassHistogramDCmd>(full_export, true, false));
114 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<SystemDictionaryDCmd>(full_export, true, false));
115 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ClassHierarchyDCmd>(full_export, true, false));
116 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ClassesDCmd>(full_export, true, false));
117 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<SymboltableDCmd>(full_export, true, false));
118 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<StringtableDCmd>(full_export, true, false));
119 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<metaspace::MetaspaceDCmd>(full_export, true, false));
120 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<PrintClassLayoutDCmd>(full_export, true, false));
121 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<EventLogDCmd>(full_export, true, false));
122 #if INCLUDE_JVMTI // Both JVMTI and SERVICES have to be enabled to have this dcmd
123 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<JVMTIAgentLoadDCmd>(full_export, true, false));
124 #endif // INCLUDE_JVMTI
125 #endif // INCLUDE_SERVICES
126 #if INCLUDE_JVMTI
127 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<JVMTIDataDumpDCmd>(full_export, true, false));
128 #endif // INCLUDE_JVMTI
129 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ThreadDumpDCmd>(full_export, true, false));
130 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ThreadDumpToFileDCmd>(full_export, true, false));
131 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<VThreadSchedulerDCmd>(full_export, true, false));
132 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<VThreadPollersDCmd>(full_export, true, false));
133 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ClassLoaderStatsDCmd>(full_export, true, false));
134 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ClassLoaderHierarchyDCmd>(full_export, true, false));
135 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<CompileQueueDCmd>(full_export, true, false));
136 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<CodeListDCmd>(full_export, true, false));
137 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<CodeCacheDCmd>(full_export, true, false));
138 #ifdef LINUX
139 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<PerfMapDCmd>(full_export, true, false));
140 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<TrimCLibcHeapDCmd>(full_export, true, false));
929 #if INCLUDE_SERVICES
930 ClassHierarchyDCmd::ClassHierarchyDCmd(outputStream* output, bool heap) :
931 DCmdWithParser(output, heap),
932 _print_interfaces("-i", "Inherited interfaces should be printed.", "BOOLEAN", false, "false"),
933 _print_subclasses("-s", "If a classname is specified, print its subclasses "
934 "in addition to its superclasses. Without this option only the "
935 "superclasses will be printed.", "BOOLEAN", false, "false"),
936 _classname("classname", "Name of class whose hierarchy should be printed. "
937 "If not specified, all class hierarchies are printed.",
938 "STRING", false) {
939 _dcmdparser.add_dcmd_option(&_print_interfaces);
940 _dcmdparser.add_dcmd_option(&_print_subclasses);
941 _dcmdparser.add_dcmd_argument(&_classname);
942 }
943
944 void ClassHierarchyDCmd::execute(DCmdSource source, TRAPS) {
945 VM_PrintClassHierarchy printClassHierarchyOp(output(), _print_interfaces.value(),
946 _print_subclasses.value(), _classname.value());
947 VMThread::execute(&printClassHierarchyOp);
948 }
949
950 PrintClassLayoutDCmd::PrintClassLayoutDCmd(outputStream* output, bool heap) :
951 DCmdWithParser(output, heap),
952 _classname("classname", "Name of class whose layout should be printed. ",
953 "STRING", true) {
954 _dcmdparser.add_dcmd_argument(&_classname);
955 }
956
957 void PrintClassLayoutDCmd::execute(DCmdSource source, TRAPS) {
958 VM_PrintClassLayout printClassLayoutOp(output(), _classname.value());
959 VMThread::execute(&printClassLayoutOp);
960 }
961
962 int PrintClassLayoutDCmd::num_arguments() {
963 ResourceMark rm;
964 PrintClassLayoutDCmd* dcmd = new PrintClassLayoutDCmd(nullptr, false);
965 if (dcmd != nullptr) {
966 DCmdMark mark(dcmd);
967 return dcmd->_dcmdparser.num_arguments();
968 } else {
969 return 0;
970 }
971 }
972
973 #endif // INCLUDE_SERVICES
974
975 ClassesDCmd::ClassesDCmd(outputStream* output, bool heap) :
976 DCmdWithParser(output, heap),
977 _verbose("-verbose",
978 "Dump the detailed content of a Java class. "
979 "Some classes are annotated with flags: "
980 "F = has, or inherits, a non-empty finalize method, "
981 "f = has final method, "
982 "W = methods rewritten, "
983 "C = marked with @Contended annotation, "
984 "R = has been redefined, "
985 "S = is shared class",
986 "BOOLEAN", false, "false") {
987 _dcmdparser.add_dcmd_option(&_verbose);
988 }
989
990 class VM_PrintClasses : public VM_Operation {
991 private:
992 outputStream* _out;
993 bool _verbose;
|