< prev index next >
src/share/vm/runtime/sweeper.cpp
Print this page
@@ -26,11 +26,13 @@
#include "code/codeCache.hpp"
#include "code/compiledIC.hpp"
#include "code/icBuffer.hpp"
#include "code/nmethod.hpp"
#include "compiler/compileBroker.hpp"
+#if INCLUDE_JFR
#include "jfr/jfrEvents.hpp"
+#endif
#include "memory/resourceArea.hpp"
#include "oops/method.hpp"
#include "runtime/atomic.hpp"
#include "runtime/compilationPolicy.hpp"
#include "runtime/mutexLocker.hpp"
@@ -316,10 +318,11 @@
// Release work, because another compiler thread could continue.
OrderAccess::release_store((int*)&_sweep_started, 0);
}
}
+#if INCLUDE_JFR
static void post_sweep_event(EventSweepCodeCache* event,
const Ticks& start,
const Ticks& end,
s4 traversals,
int swept,
@@ -333,10 +336,11 @@
event->set_sweptCount(swept);
event->set_flushedCount(flushed);
event->set_zombifiedCount(zombified);
event->commit();
}
+#endif
void NMethodSweeper::sweep_code_cache() {
ResourceMark rm;
Ticks sweep_start_counter = Ticks::now();
@@ -408,14 +412,16 @@
_total_time_this_sweep += sweep_time;
_peak_sweep_fraction_time = MAX2(sweep_time, _peak_sweep_fraction_time);
_total_flushed_size += freed_memory;
_total_nof_methods_reclaimed += _flushed_count;
+#if INCLUDE_JFR
EventSweepCodeCache event(UNTIMED);
if (event.should_commit()) {
post_sweep_event(&event, sweep_start_counter, sweep_end_counter, (s4)_traversals, swept_count, _flushed_count, _zombified_count);
}
+#endif
#ifdef ASSERT
if(PrintMethodFlushing) {
tty->print_cr("### sweeper: sweep time(%d): "
INT64_FORMAT, _sweep_fractions_left, (jlong)sweep_time.value());
< prev index next >