10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #include "precompiled.hpp"
26 #include "gc_implementation/shared/gcHeapSummary.hpp"
27 #include "gc_implementation/shared/gcTimer.hpp"
28 #include "gc_implementation/shared/gcTrace.hpp"
29 #include "gc_implementation/shared/gcWhen.hpp"
30 #include "gc_implementation/shared/promotionFailedInfo.hpp"
31 #include "trace/tracing.hpp"
32 #ifndef SERIALGC
33 #include "gc_implementation/g1/g1YCTypes.hpp"
34 #endif
35
36 // All GC dependencies against the trace framework is contained within this file.
37
38 typedef uintptr_t TraceAddress;
39
40 void GCTracer::send_garbage_collection_event() const {
41 EventGCGarbageCollection event(UNTIMED);
42 if (event.should_commit()) {
43 event.set_gcId(_shared_gc_info.id());
44 event.set_name(_shared_gc_info.name());
45 event.set_cause((u2) _shared_gc_info.cause());
46 event.set_sumOfPauses(_shared_gc_info.sum_of_pauses());
47 event.set_longestPause(_shared_gc_info.longest_pause());
48 event.set_starttime(_shared_gc_info.start_timestamp());
49 event.set_endtime(_shared_gc_info.end_timestamp());
50 event.commit();
75 void YoungGCTracer::send_young_gc_event() const {
76 EventGCYoungGarbageCollection e(UNTIMED);
77 if (e.should_commit()) {
78 e.set_gcId(_shared_gc_info.id());
79 e.set_starttime(_shared_gc_info.start_timestamp());
80 e.set_endtime(_shared_gc_info.end_timestamp());
81 e.commit();
82 }
83 }
84
85 void OldGCTracer::send_old_gc_event() const {
86 EventGCOldGarbageCollection e(UNTIMED);
87 if (e.should_commit()) {
88 e.set_gcId(_shared_gc_info.id());
89 e.set_starttime(_shared_gc_info.start_timestamp());
90 e.set_endtime(_shared_gc_info.end_timestamp());
91 e.commit();
92 }
93 }
94
95 void YoungGCTracer::send_promotion_failed_event(const PromotionFailedInfo& pf_info) const {
96 EventPromotionFailed e;
97 if (e.should_commit()) {
98 e.set_gcId(_shared_gc_info.id());
99 e.set_objectCount(pf_info.promotion_failed_count());
100 e.set_firstSize(pf_info.first_size());
101 e.set_smallestSize(pf_info.smallest_size());
102 e.set_totalSize(pf_info.total_size());
103 e.set_thread(pf_info.thread()->thread_id());
104 e.commit();
105 }
106 }
107
108 #ifndef SERIALGC
109 void G1NewTracer::send_g1_young_gc_event() {
110 EventGCG1GarbageCollection e(UNTIMED);
111 if (e.should_commit()) {
112 e.set_gcId(_shared_gc_info.id());
113 e.set_type(_g1_young_gc_info.type());
114 e.set_starttime(_shared_gc_info.start_timestamp());
115 e.set_endtime(_shared_gc_info.end_timestamp());
116 e.commit();
117 }
118 }
119 #endif
120
121 static TraceStructVirtualSpace to_trace_struct(const VirtualSpaceSummary& summary) {
122 TraceStructVirtualSpace space;
123 space.set_start((TraceAddress)summary.start());
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #include "precompiled.hpp"
26 #include "gc_implementation/shared/gcHeapSummary.hpp"
27 #include "gc_implementation/shared/gcTimer.hpp"
28 #include "gc_implementation/shared/gcTrace.hpp"
29 #include "gc_implementation/shared/gcWhen.hpp"
30 #include "gc_implementation/shared/copyFailedInfo.hpp"
31 #include "trace/tracing.hpp"
32 #ifndef SERIALGC
33 #include "gc_implementation/g1/g1YCTypes.hpp"
34 #endif
35
36 // All GC dependencies against the trace framework is contained within this file.
37
38 typedef uintptr_t TraceAddress;
39
40 void GCTracer::send_garbage_collection_event() const {
41 EventGCGarbageCollection event(UNTIMED);
42 if (event.should_commit()) {
43 event.set_gcId(_shared_gc_info.id());
44 event.set_name(_shared_gc_info.name());
45 event.set_cause((u2) _shared_gc_info.cause());
46 event.set_sumOfPauses(_shared_gc_info.sum_of_pauses());
47 event.set_longestPause(_shared_gc_info.longest_pause());
48 event.set_starttime(_shared_gc_info.start_timestamp());
49 event.set_endtime(_shared_gc_info.end_timestamp());
50 event.commit();
75 void YoungGCTracer::send_young_gc_event() const {
76 EventGCYoungGarbageCollection e(UNTIMED);
77 if (e.should_commit()) {
78 e.set_gcId(_shared_gc_info.id());
79 e.set_starttime(_shared_gc_info.start_timestamp());
80 e.set_endtime(_shared_gc_info.end_timestamp());
81 e.commit();
82 }
83 }
84
85 void OldGCTracer::send_old_gc_event() const {
86 EventGCOldGarbageCollection e(UNTIMED);
87 if (e.should_commit()) {
88 e.set_gcId(_shared_gc_info.id());
89 e.set_starttime(_shared_gc_info.start_timestamp());
90 e.set_endtime(_shared_gc_info.end_timestamp());
91 e.commit();
92 }
93 }
94
95 static TraceStructCopyFailed to_trace_struct(const CopyFailedInfo& cf_info) {
96 TraceStructCopyFailed failed_info;
97 failed_info.set_objectCount(cf_info.failed_count());
98 failed_info.set_firstSize(cf_info.first_size());
99 failed_info.set_smallestSize(cf_info.smallest_size());
100 failed_info.set_totalSize(cf_info.total_size());
101 failed_info.set_thread(cf_info.thread()->thread_id());
102 return failed_info;
103 }
104
105 void YoungGCTracer::send_promotion_failed_event(const PromotionFailedInfo& pf_info) const {
106 EventPromotionFailed e;
107 if (e.should_commit()) {
108 e.set_gcId(_shared_gc_info.id());
109 e.set_data(to_trace_struct(pf_info));
110 e.commit();
111 }
112 }
113
114 #ifndef SERIALGC
115 void G1NewTracer::send_g1_young_gc_event() {
116 EventGCG1GarbageCollection e(UNTIMED);
117 if (e.should_commit()) {
118 e.set_gcId(_shared_gc_info.id());
119 e.set_type(_g1_young_gc_info.type());
120 e.set_starttime(_shared_gc_info.start_timestamp());
121 e.set_endtime(_shared_gc_info.end_timestamp());
122 e.commit();
123 }
124 }
125 #endif
126
127 static TraceStructVirtualSpace to_trace_struct(const VirtualSpaceSummary& summary) {
128 TraceStructVirtualSpace space;
129 space.set_start((TraceAddress)summary.start());
|