8217841: Remove unused class TraceCPUTime
authorredestad
Mon, 28 Jan 2019 09:56:00 +0100
changeset 53520 5178e4b58b17
parent 53519 74a5ef4c81cc
child 53521 41fa3e6f2785
child 57116 5e54d94c238a
8217841: Remove unused class TraceCPUTime Reviewed-by: dholmes
src/hotspot/share/runtime/timer.cpp
src/hotspot/share/runtime/timer.hpp
--- a/src/hotspot/share/runtime/timer.cpp	Sat Jan 26 01:21:33 2019 +0100
+++ b/src/hotspot/share/runtime/timer.cpp	Mon Jan 28 09:56:00 2019 +0100
@@ -118,59 +118,3 @@
   assert(is_updated(), "must not be clear");
   return os::elapsed_counter() - _counter;
 }
-
-TraceCPUTime::TraceCPUTime(bool doit,
-               bool print_cr,
-               outputStream *logfile) :
-  _active(doit),
-  _print_cr(print_cr),
-  _starting_user_time(0.0),
-  _starting_system_time(0.0),
-  _starting_real_time(0.0),
-  _logfile(logfile),
-  _error(false) {
-  if (_active) {
-    if (logfile != NULL) {
-      _logfile = logfile;
-    } else {
-      _logfile = tty;
-    }
-
-    _error = !os::getTimesSecs(&_starting_real_time,
-                               &_starting_user_time,
-                               &_starting_system_time);
-  }
-}
-
-TraceCPUTime::~TraceCPUTime() {
-  if (_active) {
-    bool valid = false;
-    if (!_error) {
-      double real_secs;                 // walk clock time
-      double system_secs;               // system time
-      double user_secs;                 // user time for all threads
-
-      double real_time, user_time, system_time;
-      valid = os::getTimesSecs(&real_time, &user_time, &system_time);
-      if (valid) {
-
-        user_secs = user_time - _starting_user_time;
-        system_secs = system_time - _starting_system_time;
-        real_secs = real_time - _starting_real_time;
-
-        _logfile->print(" [Times: user=%3.2f sys=%3.2f real=%3.2f secs] ",
-          user_secs, system_secs, real_secs);
-
-      } else {
-        _logfile->print("[Invalid result in TraceCPUTime]");
-      }
-    } else {
-      _logfile->print("[Error in TraceCPUTime]");
-    }
-    if (_print_cr) {
-      _logfile->cr();
-    }
-    _logfile->flush();
-  }
-}
-
--- a/src/hotspot/share/runtime/timer.hpp	Sat Jan 26 01:21:33 2019 +0100
+++ b/src/hotspot/share/runtime/timer.hpp	Mon Jan 28 09:56:00 2019 +0100
@@ -72,23 +72,6 @@
   jlong ticks_since_update() const;
 };
 
-class TraceCPUTime: public StackObj {
- private:
-  bool _active;                 // true if times will be measured and printed
-  bool _print_cr;               // if true print carriage return at end
-  double _starting_user_time;   // user time at start of measurement
-  double _starting_system_time; // system time at start of measurement
-  double _starting_real_time;   // real time at start of measurement
-  outputStream* _logfile;       // output is printed to this stream
-  bool _error;                  // true if an error occurred, turns off output
-
- public:
-  TraceCPUTime(bool doit = true,
-               bool print_cr = true,
-               outputStream *logfile = NULL);
-  ~TraceCPUTime();
-};
-
 class TimeHelper {
  public:
   static double counter_to_seconds(jlong counter);