Mercurial > hg > truffle
comparison src/share/vm/services/diagnosticCommand.cpp @ 14246:afa21611f918
8031304: Add dcmd to print all loaded dynamic libraries.
Summary: Adding VM.dynlibs as a dcmd to dump all loaded dynamic libraries.
Reviewed-by: sla, fparain, mgronlun, dsamersoff
author | farvidsson |
---|---|
date | Tue, 14 Jan 2014 15:27:01 +0100 |
parents | 82a9cdbf683e |
children | 4ca6dc0799b6 |
comparison
equal
deleted
inserted
replaced
14245:768421ed8211 | 14246:afa21611f918 |
---|---|
23 */ | 23 */ |
24 | 24 |
25 #include "precompiled.hpp" | 25 #include "precompiled.hpp" |
26 #include "gc_implementation/shared/vmGCOperations.hpp" | 26 #include "gc_implementation/shared/vmGCOperations.hpp" |
27 #include "runtime/javaCalls.hpp" | 27 #include "runtime/javaCalls.hpp" |
28 #include "runtime/os.hpp" | |
28 #include "services/diagnosticArgument.hpp" | 29 #include "services/diagnosticArgument.hpp" |
29 #include "services/diagnosticCommand.hpp" | 30 #include "services/diagnosticCommand.hpp" |
30 #include "services/diagnosticFramework.hpp" | 31 #include "services/diagnosticFramework.hpp" |
31 #include "services/heapDumper.hpp" | 32 #include "services/heapDumper.hpp" |
32 #include "services/management.hpp" | 33 #include "services/management.hpp" |
42 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<HelpDCmd>(full_export, true, false)); | 43 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<HelpDCmd>(full_export, true, false)); |
43 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<VersionDCmd>(full_export, true, false)); | 44 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<VersionDCmd>(full_export, true, false)); |
44 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<CommandLineDCmd>(full_export, true, false)); | 45 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<CommandLineDCmd>(full_export, true, false)); |
45 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<PrintSystemPropertiesDCmd>(full_export, true, false)); | 46 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<PrintSystemPropertiesDCmd>(full_export, true, false)); |
46 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<PrintVMFlagsDCmd>(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)); | |
47 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<VMUptimeDCmd>(full_export, true, false)); | 49 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<VMUptimeDCmd>(full_export, true, false)); |
48 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<SystemGCDCmd>(full_export, true, false)); | 50 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<SystemGCDCmd>(full_export, true, false)); |
49 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<RunFinalizationDCmd>(full_export, true, false)); | 51 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<RunFinalizationDCmd>(full_export, true, false)); |
50 #if INCLUDE_SERVICES // Heap dumping/inspection supported | 52 #if INCLUDE_SERVICES // Heap dumping/inspection supported |
51 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<HeapDumpDCmd>(DCmd_Source_Internal | DCmd_Source_AttachAPI, true, false)); | 53 DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<HeapDumpDCmd>(DCmd_Source_Internal | DCmd_Source_AttachAPI, true, false)); |
608 Handle str = java_lang_String::create_from_str(options.as_string(), CHECK); | 610 Handle str = java_lang_String::create_from_str(options.as_string(), CHECK); |
609 JavaCalls::call_static(&result, ik, vmSymbols::startRemoteAgent_name(), vmSymbols::string_void_signature(), str, CHECK); | 611 JavaCalls::call_static(&result, ik, vmSymbols::startRemoteAgent_name(), vmSymbols::string_void_signature(), str, CHECK); |
610 } | 612 } |
611 | 613 |
612 JMXStartLocalDCmd::JMXStartLocalDCmd(outputStream *output, bool heap_allocated) : | 614 JMXStartLocalDCmd::JMXStartLocalDCmd(outputStream *output, bool heap_allocated) : |
613 DCmd(output, heap_allocated) | 615 DCmd(output, heap_allocated) { |
614 { | |
615 // do nothing | 616 // do nothing |
616 } | 617 } |
617 | 618 |
618 void JMXStartLocalDCmd::execute(DCmdSource source, TRAPS) { | 619 void JMXStartLocalDCmd::execute(DCmdSource source, TRAPS) { |
619 ResourceMark rm(THREAD); | 620 ResourceMark rm(THREAD); |
630 | 631 |
631 JavaValue result(T_VOID); | 632 JavaValue result(T_VOID); |
632 JavaCalls::call_static(&result, ik, vmSymbols::startLocalAgent_name(), vmSymbols::void_method_signature(), CHECK); | 633 JavaCalls::call_static(&result, ik, vmSymbols::startLocalAgent_name(), vmSymbols::void_method_signature(), CHECK); |
633 } | 634 } |
634 | 635 |
635 | |
636 void JMXStopRemoteDCmd::execute(DCmdSource source, TRAPS) { | 636 void JMXStopRemoteDCmd::execute(DCmdSource source, TRAPS) { |
637 ResourceMark rm(THREAD); | 637 ResourceMark rm(THREAD); |
638 HandleMark hm(THREAD); | 638 HandleMark hm(THREAD); |
639 | 639 |
640 // Load and initialize the sun.management.Agent class | 640 // Load and initialize the sun.management.Agent class |
648 | 648 |
649 JavaValue result(T_VOID); | 649 JavaValue result(T_VOID); |
650 JavaCalls::call_static(&result, ik, vmSymbols::stopRemoteAgent_name(), vmSymbols::void_method_signature(), CHECK); | 650 JavaCalls::call_static(&result, ik, vmSymbols::stopRemoteAgent_name(), vmSymbols::void_method_signature(), CHECK); |
651 } | 651 } |
652 | 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 } |