< prev index next >

src/hotspot/share/services/diagnosticCommand.cpp

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.

@@ -46,11 +46,10 @@
 #include "services/diagnosticFramework.hpp"
 #include "services/heapDumper.hpp"
 #include "services/management.hpp"
 #include "services/writeableFlags.hpp"
 #include "utilities/debug.hpp"
-#include "utilities/events.hpp"
 #include "utilities/formatBuffer.hpp"
 #include "utilities/macros.hpp"
 
 
 static void loadAgentModule(TRAPS) {

@@ -94,11 +93,10 @@
   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<SystemDictionaryDCmd>(full_export, true, false));
   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ClassHierarchyDCmd>(full_export, true, false));
   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<SymboltableDCmd>(full_export, true, false));
   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<StringtableDCmd>(full_export, true, false));
   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<metaspace::MetaspaceDCmd>(full_export, true, false));
-  DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<EventLogDCmd>(full_export, true, false));
 #if INCLUDE_JVMTI // Both JVMTI and SERVICES have to be enabled to have this dcmd
   DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<JVMTIAgentLoadDCmd>(full_export, true, false));
 #endif // INCLUDE_JVMTI
 #endif // INCLUDE_SERVICES
 #if INCLUDE_JVMTI

@@ -944,24 +942,17 @@
 
 //---<  BEGIN  >--- CodeHeap State Analytics.
 CodeHeapAnalyticsDCmd::CodeHeapAnalyticsDCmd(outputStream* output, bool heap) :
                                              DCmdWithParser(output, heap),
   _function("function", "Function to be performed (aggregate, UsedSpace, FreeSpace, MethodCount, MethodSpace, MethodAge, MethodNames, discard", "STRING", false, "all"),
-  _granularity("granularity", "Detail level - smaller value -> more detail", "INT", false, "4096") {
+  _granularity("granularity", "Detail level - smaller value -> more detail", "STRING", false, "4096") {
   _dcmdparser.add_dcmd_argument(&_function);
   _dcmdparser.add_dcmd_argument(&_granularity);
 }
 
 void CodeHeapAnalyticsDCmd::execute(DCmdSource source, TRAPS) {
-  jlong granularity = _granularity.value();
-  if (granularity < 1) {
-    Exceptions::fthrow(THREAD_AND_LOCATION, vmSymbols::java_lang_IllegalArgumentException(),
-                       "Invalid granularity value " JLONG_FORMAT  ". Should be positive.\n", granularity);
-    return;
-  }
-
-  CompileBroker::print_heapinfo(output(), _function.value(), granularity);
+  CompileBroker::print_heapinfo(output(), _function.value(), _granularity.value());
 }
 
 int CodeHeapAnalyticsDCmd::num_arguments() {
   ResourceMark rm;
   CodeHeapAnalyticsDCmd* dcmd = new CodeHeapAnalyticsDCmd(NULL, false);

@@ -972,49 +963,10 @@
     return 0;
   }
 }
 //---<  END  >--- CodeHeap State Analytics.
 
-EventLogDCmd::EventLogDCmd(outputStream* output, bool heap) :
-  DCmdWithParser(output, heap),
-  _log("log", "Name of log to be printed. If omitted, all logs are printed.", "STRING", false, NULL),
-  _max("max", "Maximum number of events to be printed (newest first). If omitted, all events are printed.", "STRING", false, NULL)
-{
-  _dcmdparser.add_dcmd_option(&_log);
-  _dcmdparser.add_dcmd_option(&_max);
-}
-
-void EventLogDCmd::execute(DCmdSource source, TRAPS) {
-  const char* max_value = _max.value();
-  long max = -1;
-  if (max_value != NULL) {
-    char* endptr = NULL;
-    max = ::strtol(max_value, &endptr, 10);
-    if (max == 0 && max_value == endptr) {
-      output()->print_cr("Invalid max option: \"%s\".", max_value);
-      return;
-    }
-  }
-  const char* log_name = _log.value();
-  if (log_name != NULL) {
-    Events::print_one(output(), log_name, max);
-  } else {
-    Events::print_all(output(), max);
-  }
-}
-
-int EventLogDCmd::num_arguments() {
-  ResourceMark rm;
-  EventLogDCmd* dcmd = new EventLogDCmd(NULL, false);
-  if (dcmd != NULL) {
-    DCmdMark mark(dcmd);
-    return dcmd->_dcmdparser.num_arguments();
-  } else {
-    return 0;
-  }
-}
-
 void CompilerDirectivesPrintDCmd::execute(DCmdSource source, TRAPS) {
   DirectivesStack::print(output());
 }
 
 CompilerDirectivesAddDCmd::CompilerDirectivesAddDCmd(outputStream* output, bool heap) :
< prev index next >