1 /* |
1 /* |
2 * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
22 */ |
22 */ |
23 |
23 |
24 #ifndef SHARE_GC_Z_ZTRACER_INLINE_HPP |
24 #ifndef SHARE_GC_Z_ZTRACER_INLINE_HPP |
25 #define SHARE_GC_Z_ZTRACER_INLINE_HPP |
25 #define SHARE_GC_Z_ZTRACER_INLINE_HPP |
26 |
26 |
|
27 #include "gc/z/zStat.hpp" |
27 #include "gc/z/zTracer.hpp" |
28 #include "gc/z/zTracer.hpp" |
|
29 #include "jfr/jfrEvents.hpp" |
28 |
30 |
29 inline ZTracer* ZTracer::tracer() { |
31 inline ZTracer* ZTracer::tracer() { |
30 return _tracer; |
32 return _tracer; |
|
33 } |
|
34 |
|
35 inline void ZTracer::report_stat_counter(const ZStatCounter& counter, uint64_t increment, uint64_t value) { |
|
36 if (EventZStatisticsCounter::is_enabled()) { |
|
37 send_stat_counter(counter, increment, value); |
|
38 } |
|
39 } |
|
40 |
|
41 inline void ZTracer::report_stat_sampler(const ZStatSampler& sampler, uint64_t value) { |
|
42 if (EventZStatisticsSampler::is_enabled()) { |
|
43 send_stat_sampler(sampler, value); |
|
44 } |
|
45 } |
|
46 |
|
47 inline void ZTracer::report_thread_phase(const char* name, const Ticks& start, const Ticks& end) { |
|
48 if (EventZThreadPhase::is_enabled()) { |
|
49 send_thread_phase(name, start, end); |
|
50 } |
|
51 } |
|
52 |
|
53 inline void ZTracer::report_page_alloc(size_t size, size_t used, size_t free, size_t cache, ZAllocationFlags flags) { |
|
54 if (EventZPageAllocation::is_enabled()) { |
|
55 send_page_alloc(size, used, free, cache, flags); |
|
56 } |
31 } |
57 } |
32 |
58 |
33 inline ZTraceThreadPhase::ZTraceThreadPhase(const char* name) : |
59 inline ZTraceThreadPhase::ZTraceThreadPhase(const char* name) : |
34 _start(Ticks::now()), |
60 _start(Ticks::now()), |
35 _name(name) {} |
61 _name(name) {} |