22 * |
22 * |
23 */ |
23 */ |
24 |
24 |
25 #include "precompiled.hpp" |
25 #include "precompiled.hpp" |
26 #include "gc/g1/g1EvacuationInfo.hpp" |
26 #include "gc/g1/g1EvacuationInfo.hpp" |
|
27 #include "gc/g1/g1HeapRegionTraceType.hpp" |
27 #include "gc/g1/g1Trace.hpp" |
28 #include "gc/g1/g1Trace.hpp" |
28 #include "gc/g1/g1YCTypes.hpp" |
29 #include "gc/g1/g1YCTypes.hpp" |
29 #include "gc/shared/gcHeapSummary.hpp" |
30 #include "gc/shared/gcHeapSummary.hpp" |
30 #include "jfr/jfrEvents.hpp" |
31 #include "jfr/jfrEvents.hpp" |
|
32 #if INCLUDE_JFR |
|
33 #include "jfr/metadata/jfrSerializer.hpp" |
|
34 #endif |
|
35 |
|
36 #if INCLUDE_JFR |
|
37 class G1HeapRegionTypeConstant : public JfrSerializer { |
|
38 public: |
|
39 void serialize(JfrCheckpointWriter& writer) { |
|
40 static const u4 nof_entries = G1HeapRegionTraceType::G1HeapRegionTypeEndSentinel; |
|
41 writer.write_count(nof_entries); |
|
42 for (u4 i = 0; i < nof_entries; ++i) { |
|
43 writer.write_key(i); |
|
44 writer.write(G1HeapRegionTraceType::to_string((G1HeapRegionTraceType::Type)i)); |
|
45 } |
|
46 } |
|
47 }; |
|
48 |
|
49 class G1YCTypeConstant : public JfrSerializer { |
|
50 public: |
|
51 void serialize(JfrCheckpointWriter& writer) { |
|
52 static const u4 nof_entries = G1YCTypeEndSentinel; |
|
53 writer.write_count(nof_entries); |
|
54 for (u4 i = 0; i < nof_entries; ++i) { |
|
55 writer.write_key(i); |
|
56 writer.write(G1YCTypeHelper::to_string((G1YCType)i)); |
|
57 } |
|
58 } |
|
59 }; |
|
60 |
|
61 static void register_jfr_type_constants() { |
|
62 JfrSerializer::register_serializer(TYPE_G1HEAPREGIONTYPE, false, true, |
|
63 new G1HeapRegionTypeConstant()); |
|
64 |
|
65 JfrSerializer::register_serializer(TYPE_G1YCTYPE, false, true, |
|
66 new G1YCTypeConstant()); |
|
67 } |
|
68 |
|
69 #endif |
|
70 |
|
71 void G1NewTracer::initialize() { |
|
72 JFR_ONLY(register_jfr_type_constants()); |
|
73 } |
31 |
74 |
32 void G1NewTracer::report_yc_type(G1YCType type) { |
75 void G1NewTracer::report_yc_type(G1YCType type) { |
33 _g1_young_gc_info.set_type(type); |
76 _g1_young_gc_info.set_type(type); |
34 } |
77 } |
35 |
78 |