< prev index next >

src/hotspot/share/utilities/events.hpp

Print this page

        

@@ -27,12 +27,10 @@
 
 #include "memory/allocation.hpp"
 #include "runtime/mutexLocker.hpp"
 #include "runtime/thread.hpp"
 #include "utilities/formatBuffer.hpp"
-#include "utilities/globalDefinitions.hpp"
-#include "utilities/ostream.hpp"
 #include "utilities/vmError.hpp"
 
 // Events and EventMark provide interfaces to log events taking place in the vm.
 // This facility is extremly useful for post-mortem debugging. The eventlog
 // often provides crucial information about events leading up to the crash.

@@ -59,19 +57,11 @@
  public:
   // Automatically registers the log so that it will be printed during
   // crashes.
   EventLog();
 
-  // Print log to output stream.
-  virtual void print_log_on(outputStream* out, int max = -1) = 0;
-
-  // Returns true if s matches either the log name or the log handle.
-  virtual bool matches_name_or_handle(const char* s) const = 0;
-
-  // Print log names (for help output of VM.events).
-  virtual void print_names(outputStream* out) const = 0;
-
+  virtual void print_log_on(outputStream* out) = 0;
 };
 
 
 // A templated subclass of EventLog that provides basic ring buffer
 // functionality.  Most event loggers should subclass this, possibly

@@ -86,25 +76,20 @@
     X       data;
   };
 
  protected:
   Mutex           _mutex;
-  // Name is printed out as a header.
   const char*     _name;
-  // Handle is a short specifier used to select this particular event log
-  // for printing (see VM.events command).
-  const char*     _handle;
   int             _length;
   int             _index;
   int             _count;
   EventRecord<T>* _records;
 
  public:
-  EventLogBase<T>(const char* name, const char* handle, int length = LogEventsBufferEntries):
+  EventLogBase<T>(const char* name, int length = LogEventsBufferEntries):
     _mutex(Mutex::event, name, false, Monitor::_safepoint_check_never),
     _name(name),
-    _handle(handle),
     _length(length),
     _index(0),
     _count(0) {
     _records = new EventRecord<T>[length];
   }

@@ -129,20 +114,14 @@
     // avoids mutating the ring buffer when printing the log.
     return !VMError::fatal_error_in_progress();
   }
 
   // Print the contents of the log
-  void print_log_on(outputStream* out, int max = -1);
-
-  // Returns true if s matches either the log name or the log handle.
-  bool matches_name_or_handle(const char* s) const;
-
-  // Print log names (for help output of VM.events).
-  void print_names(outputStream* out) const;
+  void print_log_on(outputStream* out);
 
  private:
-  void print_log_impl(outputStream* out, int max = -1);
+  void print_log_impl(outputStream* out);
 
   // Print a single element.  A templated implementation might need to
   // be declared by subclasses.
   void print(outputStream* out, T& e);
 

@@ -164,12 +143,11 @@
 
 // A simple ring buffer of fixed size text messages.
 template <size_t bufsz>
 class FormatStringEventLog : public EventLogBase< FormatStringLogMessage<bufsz> > {
  public:
-  FormatStringEventLog(const char* name, const char* short_name, int count = LogEventsBufferEntries)
-   : EventLogBase< FormatStringLogMessage<bufsz> >(name, short_name, count) {}
+  FormatStringEventLog(const char* name, int count = LogEventsBufferEntries) : EventLogBase< FormatStringLogMessage<bufsz> >(name, count) {}
 
   void logv(Thread* thread, const char* format, va_list ap) ATTRIBUTE_PRINTF(3, 0) {
     if (!this->should_log()) return;
 
     double timestamp = this->fetch_timestamp();

@@ -193,21 +171,19 @@
 class InstanceKlass;
 
 // Event log for class unloading events to materialize the class name in place in the log stream.
 class UnloadingEventLog : public EventLogBase<StringLogMessage> {
  public:
-  UnloadingEventLog(const char* name, const char* short_name, int count = LogEventsBufferEntries)
-   : EventLogBase<StringLogMessage>(name, short_name, count) {}
+  UnloadingEventLog(const char* name, int count = LogEventsBufferEntries) : EventLogBase<StringLogMessage>(name, count) {}
 
   void log(Thread* thread, InstanceKlass* ik);
 };
 
 // Event log for exceptions
 class ExceptionsEventLog : public ExtendedStringEventLog {
  public:
-  ExceptionsEventLog(const char* name, const char* short_name, int count = LogEventsBufferEntries)
-   : ExtendedStringEventLog(name, short_name, count) {}
+  ExceptionsEventLog(const char* name, int count = LogEventsBufferEntries) : ExtendedStringEventLog(name, count) {}
 
   void log(Thread* thread, Handle h_exception, const char* message, const char* file, int line);
 };
 
 

@@ -231,17 +207,11 @@
   static StringEventLog* _redefinitions;
 
   // Class unloading events
   static UnloadingEventLog* _class_unloading;
  public:
-
-  // Print all event logs; limit number of events per event log to be printed with max
-  // (max == -1 prints all events).
-  static void print_all(outputStream* out, int max = -1);
-
-  // Print a single event log specified by name or handle.
-  static void print_one(outputStream* out, const char* log_name, int max = -1);
+  static void print_all(outputStream* out);
 
   // Dump all events to the tty
   static void print();
 
   // Logs a generic message with timestamp and format as printf.

@@ -307,72 +277,44 @@
     _deopt_messages->logv(thread, format, ap);
     va_end(ap);
   }
 }
 
+
 template <class T>
-inline void EventLogBase<T>::print_log_on(outputStream* out, int max) {
+inline void EventLogBase<T>::print_log_on(outputStream* out) {
   if (Thread::current_or_null() == NULL) {
     // Not yet attached? Don't try to use locking
-    print_log_impl(out, max);
+    print_log_impl(out);
   } else {
     MutexLocker ml(&_mutex, Mutex::_no_safepoint_check_flag);
-    print_log_impl(out, max);
+    print_log_impl(out);
   }
 }
 
-template <class T>
-inline bool EventLogBase<T>::matches_name_or_handle(const char* s) const {
-  return ::strcasecmp(s, _name) == 0 ||
-         ::strcasecmp(s, _handle) == 0;
-}
-
-template <class T>
-inline void EventLogBase<T>::print_names(outputStream* out) const {
-  out->print("\"%s\" : %s", _handle, _name);
-}
-
 // Dump the ring buffer entries that current have entries.
 template <class T>
-inline void EventLogBase<T>::print_log_impl(outputStream* out, int max) {
+inline void EventLogBase<T>::print_log_impl(outputStream* out) {
   out->print_cr("%s (%d events):", _name, _count);
   if (_count == 0) {
     out->print_cr("No events");
     out->cr();
     return;
   }
 
-  int printed = 0;
   if (_count < _length) {
     for (int i = 0; i < _count; i++) {
-      if (max > 0 && printed == max) {
-        break;
-      }
       print(out, _records[i]);
-      printed ++;
     }
   } else {
     for (int i = _index; i < _length; i++) {
-      if (max > 0 && printed == max) {
-        break;
-      }
       print(out, _records[i]);
-      printed ++;
     }
     for (int i = 0; i < _index; i++) {
-      if (max > 0 && printed == max) {
-        break;
-      }
       print(out, _records[i]);
-      printed ++;
     }
   }
-
-  if (printed == max) {
-    out->print_cr("...(skipped)");
-  }
-
   out->cr();
 }
 
 // Implement a printing routine for the StringLogMessage
 template <>
< prev index next >