Skip to content

Commit

Permalink
8238229: Remove TRACESPINNING debug code
Browse files Browse the repository at this point in the history
Reviewed-by: kbarrett, sjohanss
  • Loading branch information
Thomas Schatzl committed Feb 3, 2020
1 parent 77ad678 commit 358c56b
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 57 deletions.
7 changes: 0 additions & 7 deletions src/hotspot/share/gc/g1/g1CollectedHeap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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);
}

Expand Down
4 changes: 0 additions & 4 deletions src/hotspot/share/gc/parallel/psParallelCompact.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 0 additions & 4 deletions src/hotspot/share/gc/parallel/psScavenge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 0 additions & 4 deletions src/hotspot/share/gc/shared/genCollectedHeap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
22 changes: 0 additions & 22 deletions src/hotspot/share/gc/shared/taskTerminator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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.
Expand All @@ -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",
Expand All @@ -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);
{
Expand Down
16 changes: 0 additions & 16 deletions src/hotspot/share/gc/shared/taskTerminator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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.