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