src/hotspot/share/gc/z/zTracer.cpp
changeset 58704 8b16701b4636
parent 57603 f9d9bed12d1a
child 58823 6a21dba79b81
child 58863 c16ac7a2eba4
--- a/src/hotspot/share/gc/z/zTracer.cpp	Mon Oct 21 09:55:48 2019 +0200
+++ b/src/hotspot/share/gc/z/zTracer.cpp	Mon Oct 21 09:55:58 2019 +0200
@@ -22,18 +22,19 @@
  */
 
 #include "precompiled.hpp"
+#include "gc/shared/gcId.hpp"
 #include "gc/z/zStat.hpp"
 #include "gc/z/zTracer.hpp"
-#include "gc/shared/gcId.hpp"
-#include "gc/shared/gcLocker.hpp"
 #include "jfr/jfrEvents.hpp"
-#include "runtime/safepoint.hpp"
 #include "runtime/safepointVerifiers.hpp"
+#include "utilities/debug.hpp"
+#include "utilities/macros.hpp"
 #if INCLUDE_JFR
 #include "jfr/metadata/jfrSerializer.hpp"
 #endif
 
 #if INCLUDE_JFR
+
 class ZStatisticsCounterTypeConstant : public JfrSerializer {
 public:
   virtual void serialize(JfrCheckpointWriter& writer) {
@@ -66,7 +67,8 @@
                                      true /* permit_cache */,
                                      new ZStatisticsSamplerTypeConstant());
 }
-#endif
+
+#endif // INCLUDE_JFR
 
 ZTracer* ZTracer::_tracer = NULL;
 
@@ -79,24 +81,24 @@
   JFR_ONLY(register_jfr_type_serializers());
 }
 
-void ZTracer::send_stat_counter(uint32_t counter_id, uint64_t increment, uint64_t value) {
+void ZTracer::send_stat_counter(const ZStatCounter& counter, uint64_t increment, uint64_t value) {
   NoSafepointVerifier nsv;
 
   EventZStatisticsCounter e;
   if (e.should_commit()) {
-    e.set_id(counter_id);
+    e.set_id(counter.id());
     e.set_increment(increment);
     e.set_value(value);
     e.commit();
   }
 }
 
-void ZTracer::send_stat_sampler(uint32_t sampler_id, uint64_t value) {
+void ZTracer::send_stat_sampler(const ZStatSampler& sampler, uint64_t value) {
   NoSafepointVerifier nsv;
 
   EventZStatisticsSampler e;
   if (e.should_commit()) {
-    e.set_id(sampler_id);
+    e.set_id(sampler.id());
     e.set_value(value);
     e.commit();
   }
@@ -115,7 +117,7 @@
   }
 }
 
-void ZTracer::send_page_alloc(size_t size, size_t used, size_t free, size_t cache, bool nonblocking, bool noreserve) {
+void ZTracer::send_page_alloc(size_t size, size_t used, size_t free, size_t cache, ZAllocationFlags flags) {
   NoSafepointVerifier nsv;
 
   EventZPageAllocation e;
@@ -124,28 +126,8 @@
     e.set_usedAfter(used);
     e.set_freeAfter(free);
     e.set_inCacheAfter(cache);
-    e.set_nonBlocking(nonblocking);
-    e.set_noReserve(noreserve);
+    e.set_nonBlocking(flags.non_blocking());
+    e.set_noReserve(flags.no_reserve());
     e.commit();
   }
 }
-
-void ZTracer::report_stat_counter(const ZStatCounter& counter, uint64_t increment, uint64_t value) {
-  send_stat_counter(counter.id(), increment, value);
-}
-
-void ZTracer::report_stat_sampler(const ZStatSampler& sampler, uint64_t value) {
-  send_stat_sampler(sampler.id(), value);
-}
-
-void ZTracer::report_thread_phase(const ZStatPhase& phase, const Ticks& start, const Ticks& end) {
-  send_thread_phase(phase.name(), start, end);
-}
-
-void ZTracer::report_thread_phase(const char* name, const Ticks& start, const Ticks& end) {
-  send_thread_phase(name, start, end);
-}
-
-void ZTracer::report_page_alloc(size_t size, size_t used, size_t free, size_t cache, ZAllocationFlags flags) {
-  send_page_alloc(size, used, free, cache, flags.non_blocking(), flags.no_reserve());
-}