1.1 --- a/src/share/vm/runtime/sweeper.cpp Thu Aug 01 03:44:03 2019 +0100 1.2 +++ b/src/share/vm/runtime/sweeper.cpp Mon Aug 12 18:30:40 2019 +0300 1.3 @@ -28,6 +28,7 @@ 1.4 #include "code/icBuffer.hpp" 1.5 #include "code/nmethod.hpp" 1.6 #include "compiler/compileBroker.hpp" 1.7 +#include "jfr/jfrEvents.hpp" 1.8 #include "memory/resourceArea.hpp" 1.9 #include "oops/method.hpp" 1.10 #include "runtime/atomic.hpp" 1.11 @@ -38,9 +39,8 @@ 1.12 #include "runtime/sweeper.hpp" 1.13 #include "runtime/thread.inline.hpp" 1.14 #include "runtime/vm_operations.hpp" 1.15 -#include "trace/tracing.hpp" 1.16 #include "utilities/events.hpp" 1.17 -#include "utilities/ticks.inline.hpp" 1.18 +#include "utilities/ticks.hpp" 1.19 #include "utilities/xmlstream.hpp" 1.20 1.21 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 1.22 @@ -318,6 +318,24 @@ 1.23 } 1.24 } 1.25 1.26 +static void post_sweep_event(EventSweepCodeCache* event, 1.27 + const Ticks& start, 1.28 + const Ticks& end, 1.29 + s4 traversals, 1.30 + int swept, 1.31 + int flushed, 1.32 + int zombified) { 1.33 + assert(event != NULL, "invariant"); 1.34 + assert(event->should_commit(), "invariant"); 1.35 + event->set_starttime(start); 1.36 + event->set_endtime(end); 1.37 + event->set_sweepId(traversals); 1.38 + event->set_sweptCount(swept); 1.39 + event->set_flushedCount(flushed); 1.40 + event->set_zombifiedCount(zombified); 1.41 + event->commit(); 1.42 +} 1.43 + 1.44 void NMethodSweeper::sweep_code_cache() { 1.45 ResourceMark rm; 1.46 Ticks sweep_start_counter = Ticks::now(); 1.47 @@ -394,15 +412,7 @@ 1.48 1.49 EventSweepCodeCache event(UNTIMED); 1.50 if (event.should_commit()) { 1.51 - event.set_starttime(sweep_start_counter); 1.52 - event.set_endtime(sweep_end_counter); 1.53 - event.set_sweepIndex(_traversals); 1.54 - event.set_sweepFractionIndex(NmethodSweepFraction - _sweep_fractions_left + 1); 1.55 - event.set_sweptCount(swept_count); 1.56 - event.set_flushedCount(_flushed_count); 1.57 - event.set_markedCount(_marked_for_reclamation_count); 1.58 - event.set_zombifiedCount(_zombified_count); 1.59 - event.commit(); 1.60 + post_sweep_event(&event, sweep_start_counter, sweep_end_counter, (s4)_traversals, swept_count, _flushed_count, _zombified_count); 1.61 } 1.62 1.63 #ifdef ASSERT