Mercurial > hg > graal-jvmci-8
comparison src/share/vm/services/diagnosticCommand.hpp @ 4133:3b688d6ff3d0
7104647: Adding a diagnostic command framework
Reviewed-by: phh, dcubed
author | fparain |
---|---|
date | Wed, 14 Dec 2011 04:30:57 -0800 |
parents | |
children | 4f25538b54c9 |
comparison
equal
deleted
inserted
replaced
4131:e9b91fd07263 | 4133:3b688d6ff3d0 |
---|---|
1 /* | |
2 * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. | |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | |
4 * | |
5 * This code is free software; you can redistribute it and/or modify it | |
6 * under the terms of the GNU General Public License version 2 only, as | |
7 * published by the Free Software Foundation. | |
8 * | |
9 * This code is distributed in the hope that it will be useful, but WITHOUT | |
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
12 * version 2 for more details (a copy is included in the LICENSE file that | |
13 * accompanied this code). | |
14 * | |
15 * You should have received a copy of the GNU General Public License version | |
16 * 2 along with this work; if not, write to the Free Software Foundation, | |
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
18 * | |
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | |
20 * or visit www.oracle.com if you need additional information or have any | |
21 * questions. | |
22 * | |
23 */ | |
24 | |
25 #ifndef SHARE_VM_SERVICES_DIAGNOSTICCOMMAND_HPP | |
26 #define SHARE_VM_SERVICES_DIAGNOSTICCOMMAND_HPP | |
27 | |
28 #include "runtime/arguments.hpp" | |
29 #include "classfile/vmSymbols.hpp" | |
30 #include "utilities/ostream.hpp" | |
31 #include "runtime/vm_version.hpp" | |
32 #include "runtime/vmThread.hpp" | |
33 #include "runtime/os.hpp" | |
34 #include "services/diagnosticArgument.hpp" | |
35 #include "services/diagnosticCommand.hpp" | |
36 #include "services/diagnosticFramework.hpp" | |
37 | |
38 class HelpDCmd : public DCmd { | |
39 protected: | |
40 DCmdParser _dcmdparser; | |
41 DCmdArgument<bool> _all; | |
42 DCmdArgument<char*> _cmd; | |
43 public: | |
44 HelpDCmd(outputStream* output, bool heap); | |
45 static const char* name() { return "help"; } | |
46 static const char* description() { | |
47 return "For more information about a specific command use 'help <command>'. " | |
48 "With no argument this will show a list of available commands. " | |
49 "'help all' will show help for all commands."; | |
50 } | |
51 static const char* impact() { return "Low: "; } | |
52 static int num_arguments(); | |
53 virtual void parse(CmdLine* line, char delim, TRAPS); | |
54 virtual void execute(TRAPS); | |
55 virtual void reset(TRAPS); | |
56 virtual void cleanup(); | |
57 virtual void print_help(outputStream* out); | |
58 virtual GrowableArray<const char*>* argument_name_array(); | |
59 virtual GrowableArray<DCmdArgumentInfo*>* argument_info_array(); | |
60 }; | |
61 | |
62 class VersionDCmd : public DCmd { | |
63 public: | |
64 VersionDCmd(outputStream* output, bool heap) : DCmd(output,heap) { } | |
65 static const char* name() { return "VM.version"; } | |
66 static const char* description() { | |
67 return "Print JVM version information."; | |
68 } | |
69 static const char* impact() { return "Low: "; } | |
70 static int num_arguments() { return 0; } | |
71 virtual void parse(CmdLine* line, char delim, TRAPS) { } | |
72 virtual void execute(TRAPS); | |
73 virtual void print_help(outputStream* out) { } | |
74 }; | |
75 | |
76 #endif // SHARE_VM_SERVICES_DIAGNOSTICCOMMAND_HPP |