comparison src/share/vm/services/diagnosticFramework.hpp @ 6275:957c266d8bc5

Merge with http://hg.openjdk.java.net/hsx/hsx24/hotspot/
author Doug Simon <doug.simon@oracle.com>
date Tue, 21 Aug 2012 10:39:19 +0200
parents 5a1f452f8f90
children 31a4e55f8c9d
comparison
equal deleted inserted replaced
5891:fd8832ae511d 6275:957c266d8bc5
236 } 236 }
237 237
238 static const char* name() { return "No Name";} 238 static const char* name() { return "No Name";}
239 static const char* description() { return "No Help";} 239 static const char* description() { return "No Help";}
240 static const char* disabled_message() { return "Diagnostic command currently disabled"; } 240 static const char* disabled_message() { return "Diagnostic command currently disabled"; }
241 // The impact() method returns a description of the intrusiveness of the diagnostic
242 // command on the Java Virtual Machine behavior. The rational for this method is that some
243 // diagnostic commands can seriously disrupt the behavior of the Java Virtual Machine
244 // (for instance a Thread Dump for an application with several tens of thousands of threads,
245 // or a Head Dump with a 40GB+ heap size) and other diagnostic commands have no serious
246 // impact on the JVM (for instance, getting the command line arguments or the JVM version).
247 // The recommended format for the description is <impact level>: [longer description],
248 // where the impact level is selected among this list: {Low, Medium, High}. The optional
249 // longer description can provide more specific details like the fact that Thread Dump
250 // impact depends on the heap size.
241 static const char* impact() { return "Low: No impact"; } 251 static const char* impact() { return "Low: No impact"; }
242 static int num_arguments() { return 0; } 252 static int num_arguments() { return 0; }
243 outputStream* output() { return _output; } 253 outputStream* output() { return _output; }
244 bool is_heap_allocated() { return _is_heap_allocated; } 254 bool is_heap_allocated() { return _is_heap_allocated; }
245 virtual void print_help(const char* name) { 255 virtual void print_help(const char* name) {
248 virtual void parse(CmdLine* line, char delim, TRAPS) { 258 virtual void parse(CmdLine* line, char delim, TRAPS) {
249 DCmdArgIter iter(line->args_addr(), line->args_len(), delim); 259 DCmdArgIter iter(line->args_addr(), line->args_len(), delim);
250 bool has_arg = iter.next(CHECK); 260 bool has_arg = iter.next(CHECK);
251 if (has_arg) { 261 if (has_arg) {
252 THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), 262 THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
253 "Unknown argument in diagnostic command"); 263 "The argument list of this diagnostic command should be empty.");
254 } 264 }
255 } 265 }
256 virtual void execute(TRAPS) { } 266 virtual void execute(TRAPS) { }
257 virtual void reset(TRAPS) { } 267 virtual void reset(TRAPS) { }
258 virtual void cleanup() { } 268 virtual void cleanup() { }
308 // Diagnostic commands are not directly instantiated but created with a factory. 318 // Diagnostic commands are not directly instantiated but created with a factory.
309 // Each diagnostic command class has its own factory. The DCmdFactory class also 319 // Each diagnostic command class has its own factory. The DCmdFactory class also
310 // manages the status of the diagnostic command (hidden, enabled). A DCmdFactory 320 // manages the status of the diagnostic command (hidden, enabled). A DCmdFactory
311 // has to be registered to make the diagnostic command available (see 321 // has to be registered to make the diagnostic command available (see
312 // management.cpp) 322 // management.cpp)
313 class DCmdFactory: public CHeapObj { 323 class DCmdFactory: public CHeapObj<mtInternal> {
314 private: 324 private:
315 static Mutex* _dcmdFactory_lock; 325 static Mutex* _dcmdFactory_lock;
316 // Pointer to the next factory in the singly-linked list of registered 326 // Pointer to the next factory in the singly-linked list of registered
317 // diagnostic commands 327 // diagnostic commands
318 DCmdFactory* _next; 328 DCmdFactory* _next;
366 public: 376 public:
367 DCmdFactoryImpl(bool enabled, bool hidden) : 377 DCmdFactoryImpl(bool enabled, bool hidden) :
368 DCmdFactory(DCmdClass::num_arguments(), enabled, hidden) { } 378 DCmdFactory(DCmdClass::num_arguments(), enabled, hidden) { }
369 // Returns a C-heap allocated instance 379 // Returns a C-heap allocated instance
370 virtual DCmd* create_Cheap_instance(outputStream* output) { 380 virtual DCmd* create_Cheap_instance(outputStream* output) {
371 return new (ResourceObj::C_HEAP) DCmdClass(output, true); 381 return new (ResourceObj::C_HEAP, mtInternal) DCmdClass(output, true);
372 } 382 }
373 // Returns a resourceArea allocated instance 383 // Returns a resourceArea allocated instance
374 virtual DCmd* create_resource_instance(outputStream* output) { 384 virtual DCmd* create_resource_instance(outputStream* output) {
375 return new DCmdClass(output, false); 385 return new DCmdClass(output, false);
376 } 386 }