src/share/vm/services/diagnosticCommand.hpp

Wed, 14 Dec 2011 04:30:57 -0800

author
fparain
date
Wed, 14 Dec 2011 04:30:57 -0800
changeset 3329
3b688d6ff3d0
child 3402
4f25538b54c9
permissions
-rw-r--r--

7104647: Adding a diagnostic command framework
Reviewed-by: phh, dcubed

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

mercurial