Skip to content

Commit

Permalink
address code style feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
neethu-prasad committed Aug 7, 2024
1 parent c1def27 commit 31e0b0e
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions src/hotspot/share/gc/shared/gcLocker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,25 +41,23 @@ unsigned int GCLocker::_total_collections = 0;

// GCLockerTimingDebugLogger tracks specific timing information for GC lock waits.
class GCLockerTimingDebugLogger : public StackObj {
private:
const char* _log_message;
Ticks _start;

public:
GCLockerTimingDebugLogger(const char* log_message) :
_log_message(log_message) {
assert(_log_message != nullptr, "GC locker debug message must be set.");
_start = Ticks::now();
}
const char* _log_message;
Ticks _start;

public:
GCLockerTimingDebugLogger(const char* log_message) : _log_message(log_message) {
assert(_log_message != nullptr, "GC locker debug message must be set.");
_start = Ticks::now();
}

~GCLockerTimingDebugLogger() {
~GCLockerTimingDebugLogger() {
Log(gc, jni) log;
if (log.is_debug()) {
ResourceMark rm; // JavaThread::name() allocates to convert to UTF8
const Tickspan elapsed_time = Ticks::now() - _start;
Log(gc, jni) log;
if (log.is_debug()) {
ResourceMark rm; // JavaThread::name() allocates to convert to UTF8
log.debug("%s Resumed after " UINT64_FORMAT "ms. Thread \"%s\".", _log_message, elapsed_time.milliseconds(), Thread::current()->name());
}
log.debug("%s Resumed after " UINT64_FORMAT "ms. Thread \"%s\".", _log_message, elapsed_time.milliseconds(), Thread::current()->name());
}
}
};

#ifdef ASSERT
Expand Down

0 comments on commit 31e0b0e

Please sign in to comment.