Skip to content
Permalink
Browse files

8238229: Remove TRACESPINNING debug code

Reviewed-by: kbarrett, sjohanss
  • Loading branch information
Thomas Schatzl
Thomas Schatzl committed Feb 3, 2020
1 parent 77ad678 commit 358c56bb8bd720b84711014f261328ad7b49a2af
@@ -1132,9 +1132,6 @@ void G1CollectedHeap::print_heap_after_full_collection(G1HeapTransition* heap_tr
heap_transition->print();
print_heap_after_gc();
print_heap_regions();
#ifdef TRACESPINNING
TaskTerminator::print_termination_counts();
#endif
}

bool G1CollectedHeap::do_full_collection(bool explicit_gc,
@@ -3140,10 +3137,6 @@ void G1CollectedHeap::do_collection_pause_at_safepoint_helper(double target_paus

verify_after_young_collection(verify_type);

#ifdef TRACESPINNING
TaskTerminator::print_termination_counts();
#endif

gc_epilogue(false);
}

@@ -1969,10 +1969,6 @@ bool PSParallelCompact::invoke_no_policy(bool maximum_heap_compaction) {
marking_start.ticks(), compaction_start.ticks(),
collection_exit.ticks());

#ifdef TRACESPINNING
TaskTerminator::print_termination_counts();
#endif

AdaptiveSizePolicyOutput::print(size_policy, heap->total_collections());

_gc_timer.register_gc_end();
@@ -731,10 +731,6 @@ bool PSScavenge::invoke_no_policy() {
scavenge_entry.ticks(), scavenge_midpoint.ticks(),
scavenge_exit.ticks());

#ifdef TRACESPINNING
TaskTerminator::print_termination_counts();
#endif

AdaptiveSizePolicyOutput::print(size_policy, heap->total_collections());

_gc_timer.register_gc_end();
@@ -676,10 +676,6 @@ void GenCollectedHeap::do_collection(bool full,

print_heap_after_gc();
}

#ifdef TRACESPINNING
TaskTerminator::print_termination_counts();
#endif
}

bool GenCollectedHeap::should_do_full_collection(size_t size, bool full, bool is_tlab,
@@ -29,12 +29,6 @@
#include "gc/shared/taskqueue.hpp"
#include "logging/log.hpp"

#ifdef TRACESPINNING
uint TaskTerminator::_total_yields = 0;
uint TaskTerminator::_total_spins = 0;
uint TaskTerminator::_total_peeks = 0;
#endif

TaskTerminator::TaskTerminator(uint n_threads, TaskQueueSetSuper* queue_set) :
_n_threads(n_threads),
_queue_set(queue_set),
@@ -64,13 +58,6 @@ void TaskTerminator::yield() {
os::naked_yield();
}

#ifdef TRACESPINNING
void TaskTerminator::print_termination_counts() {
log_trace(gc, task)("TaskTerminator Yields: %u Spins: %u Peeks: %u",
total_yields(), total_spins(), total_peeks());
}
#endif

void TaskTerminator::reset_for_reuse() {
if (_offered_termination != 0) {
assert(_offered_termination == _n_threads,
@@ -192,9 +179,6 @@ bool TaskTerminator::do_spin_master_work(TerminatorTerminator* terminator) {
yield();
hard_spin_count = 0;
hard_spin_limit = hard_spin_start;
#ifdef TRACESPINNING
_total_yields++;
#endif
} else {
// Hard spin this time
// Increase the hard spinning period but only up to a limit.
@@ -204,9 +188,6 @@ bool TaskTerminator::do_spin_master_work(TerminatorTerminator* terminator) {
SpinPause();
}
hard_spin_count++;
#ifdef TRACESPINNING
_total_spins++;
#endif
}
} else {
log_develop_trace(gc, task)("TaskTerminator::do_spin_master_work() thread " PTR_FORMAT " sleeps after %u yields",
@@ -223,9 +204,6 @@ bool TaskTerminator::do_spin_master_work(TerminatorTerminator* terminator) {
}
}

#ifdef TRACESPINNING
_total_peeks++;
#endif
size_t tasks = tasks_in_queue_set();
bool exit = exit_termination(tasks, terminator);
{
@@ -29,9 +29,6 @@
#include "runtime/mutex.hpp"
#include "runtime/thread.hpp"

// Define this to enable additional tracing probes.
#undef TRACESPINNING

class TaskQueueSetSuper;
class TerminatorTerminator;

@@ -68,12 +65,6 @@ class TaskTerminator : public CHeapObj<mtGC> {
Monitor* _blocker;
Thread* _spin_master;

#ifdef TRACESPINNING
static uint _total_yields;
static uint _total_spins;
static uint _total_peeks;
#endif

// If we should exit current termination protocol
bool exit_termination(size_t tasks, TerminatorTerminator* terminator);

@@ -110,13 +101,6 @@ class TaskTerminator : public CHeapObj<mtGC> {
// Same as above but the number of parallel threads is set to the
// given number.
void reset_for_reuse(uint n_threads);

#ifdef TRACESPINNING
static uint total_yields() { return _total_yields; }
static uint total_spins() { return _total_spins; }
static uint total_peeks() { return _total_peeks; }
static void print_termination_counts();
#endif
};

#endif // SHARE_GC_SHARED_TASKTERMINATOR_HPP

0 comments on commit 358c56b

Please sign in to comment.