8217841: Remove unused class TraceCPUTime

Reviewed-by: dholmes
This commit is contained in:
Claes Redestad 2019-01-28 09:56:00 +01:00
parent d271630fb2
commit ef07b1b314
2 changed files with 0 additions and 73 deletions

View File

@ -118,59 +118,3 @@ jlong TimeStamp::ticks_since_update() const {
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();
}
}

View File

@ -72,23 +72,6 @@ class TimeStamp {
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);