src/share/vm/services/diagnosticCommand.hpp

Print this page


   1 /*
   2  * Copyright (c) 2011, 2014, 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  *


 254 protected:
 255   DCmdArgument<bool> _all;
 256   DCmdArgument<bool> _csv;
 257   DCmdArgument<bool> _help;
 258   DCmdArgument<char*> _columns;
 259 public:
 260   ClassStatsDCmd(outputStream* output, bool heap);
 261   static const char* name() {
 262     return "GC.class_stats";
 263   }
 264   static const char* description() {
 265     return "Provide statistics about Java class meta data. Requires -XX:+UnlockDiagnosticVMOptions.";
 266   }
 267   static const char* impact() {
 268     return "High: Depends on Java heap size and content.";
 269   }
 270   static int num_arguments();
 271   virtual void execute(DCmdSource source, TRAPS);
 272 };
 273 
















 274 // See also: thread_dump in attachListener.cpp
 275 class ThreadDumpDCmd : public DCmdWithParser {
 276 protected:
 277   DCmdArgument<bool> _locks;
 278 public:
 279   ThreadDumpDCmd(outputStream* output, bool heap);
 280   static const char* name() { return "Thread.print"; }
 281   static const char* description() {
 282     return "Print all threads with stacktraces.";
 283   }
 284   static const char* impact() {
 285     return "Medium: Depends on the number of threads.";
 286   }
 287   static const JavaPermission permission() {
 288     JavaPermission p = {"java.lang.management.ManagementPermission",
 289                         "monitor", NULL};
 290     return p;
 291   }
 292   static int num_arguments();
 293   virtual void execute(DCmdSource source, TRAPS);


   1 /*
   2  * Copyright (c) 2011, 2015, 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  *


 254 protected:
 255   DCmdArgument<bool> _all;
 256   DCmdArgument<bool> _csv;
 257   DCmdArgument<bool> _help;
 258   DCmdArgument<char*> _columns;
 259 public:
 260   ClassStatsDCmd(outputStream* output, bool heap);
 261   static const char* name() {
 262     return "GC.class_stats";
 263   }
 264   static const char* description() {
 265     return "Provide statistics about Java class meta data. Requires -XX:+UnlockDiagnosticVMOptions.";
 266   }
 267   static const char* impact() {
 268     return "High: Depends on Java heap size and content.";
 269   }
 270   static int num_arguments();
 271   virtual void execute(DCmdSource source, TRAPS);
 272 };
 273 
 274 
 275 class ClassHierarchyDCmd : public DCmd {
 276 public:
 277   ClassHierarchyDCmd(outputStream* output, bool heap) : DCmd(output, heap) { }
 278   static const char* name() {
 279     return "VM.class_hierarchy";
 280   }
 281   static const char* description() {
 282     return "Print a list of all loaded classes, indented to show the class hiearchy.";
 283   }
 284   static const char* impact() {
 285       return "Medium: Depends on number of loaded classes.";
 286   }
 287   virtual void execute(DCmdSource source, TRAPS);
 288 };
 289 
 290 // See also: thread_dump in attachListener.cpp
 291 class ThreadDumpDCmd : public DCmdWithParser {
 292 protected:
 293   DCmdArgument<bool> _locks;
 294 public:
 295   ThreadDumpDCmd(outputStream* output, bool heap);
 296   static const char* name() { return "Thread.print"; }
 297   static const char* description() {
 298     return "Print all threads with stacktraces.";
 299   }
 300   static const char* impact() {
 301     return "Medium: Depends on the number of threads.";
 302   }
 303   static const JavaPermission permission() {
 304     JavaPermission p = {"java.lang.management.ManagementPermission",
 305                         "monitor", NULL};
 306     return p;
 307   }
 308   static int num_arguments();
 309   virtual void execute(DCmdSource source, TRAPS);