< prev index next >
src/share/vm/gc/parallel/gcTaskThread.cpp
Print this page
rev 12781 : imported patch 8177963-gctasktimestampentries
rev 12782 : [mq]: 8177963-gctasktimestampentries-reviews
*** 52,72 ****
if (_time_stamps != NULL) {
FREE_C_HEAP_ARRAY(GCTaskTimeStamp, _time_stamps);
}
}
! void GCTaskThread::add_task_timestamp(char* name, jlong t_entry, jlong t_exit) {
! if (_time_stamp_index == GCTaskTimeStampEntries) {
! log_warning(gc, task, time)("GC-thread %u: Too many timestamps, overwriting last. Increase GCTaskTimeStampEntries to get more info.", id());
! }
!
! uint time = MIN2(_time_stamp_index, (uint)GCTaskTimeStampEntries - 1);
! GCTaskTimeStamp* time_stamp = time_stamp_at(time);
time_stamp->set_name(name);
time_stamp->set_entry_time(t_entry);
time_stamp->set_exit_time(t_exit);
!
_time_stamp_index++;
}
GCTaskTimeStamp* GCTaskThread::time_stamp_at(uint index) {
assert(index < GCTaskTimeStampEntries, "Precondition");
--- 52,76 ----
if (_time_stamps != NULL) {
FREE_C_HEAP_ARRAY(GCTaskTimeStamp, _time_stamps);
}
}
! void GCTaskThread::add_task_timestamp(const char* name, jlong t_entry, jlong t_exit) {
! if (_time_stamp_index < GCTaskTimeStampEntries) {
! GCTaskTimeStamp* time_stamp = time_stamp_at(_time_stamp_index);
time_stamp->set_name(name);
time_stamp->set_entry_time(t_entry);
time_stamp->set_exit_time(t_exit);
! } else {
! if (_time_stamp_index == GCTaskTimeStampEntries) {
! log_warning(gc, task, time)("GC-thread %u: Too many timestamps, ignoring future ones. "
! "Increase GCTaskTimeStampEntries to get more info.",
! id());
! }
! // Let _time_stamp_index keep counting to give the user an idea about how many
! // are needed.
! }
_time_stamp_index++;
}
GCTaskTimeStamp* GCTaskThread::time_stamp_at(uint index) {
assert(index < GCTaskTimeStampEntries, "Precondition");
*** 86,97 ****
assert(log_is_enabled(Debug, gc, task, time), "Sanity");
// Since _time_stamps is now lazily allocated we need to check that it
// has in fact been allocated when calling this function.
if (_time_stamps != NULL) {
! log_debug(gc, task, time)("GC-Thread %u entries: %d", id(), _time_stamp_index);
! const uint max_index = MIN2(_time_stamp_index, (uint)GCTaskTimeStampEntries);
for (uint i = 0; i < max_index; i++) {
GCTaskTimeStamp* time_stamp = time_stamp_at(i);
log_debug(gc, task, time)("\t[ %s " JLONG_FORMAT " " JLONG_FORMAT " ]",
time_stamp->name(),
time_stamp->entry_time(),
--- 90,103 ----
assert(log_is_enabled(Debug, gc, task, time), "Sanity");
// Since _time_stamps is now lazily allocated we need to check that it
// has in fact been allocated when calling this function.
if (_time_stamps != NULL) {
! log_debug(gc, task, time)("GC-Thread %u entries: %d%s", id(),
! _time_stamp_index,
! _time_stamp_index >= GCTaskTimeStampEntries ? " (overflow)" : "");
! const uint max_index = MIN2(_time_stamp_index, GCTaskTimeStampEntries);
for (uint i = 0; i < max_index; i++) {
GCTaskTimeStamp* time_stamp = time_stamp_at(i);
log_debug(gc, task, time)("\t[ %s " JLONG_FORMAT " " JLONG_FORMAT " ]",
time_stamp->name(),
time_stamp->entry_time(),
< prev index next >