332
333 class GCHeapSummaryEventSender : public GCHeapSummaryVisitor {
334 GCId _gc_id;
335 GCWhen::Type _when;
336 public:
337 GCHeapSummaryEventSender(GCId gc_id, GCWhen::Type when) : _gc_id(gc_id), _when(when) {}
338
339 void visit(const GCHeapSummary* heap_summary) const {
340 const VirtualSpaceSummary& heap_space = heap_summary->heap();
341
342 EventGCHeapSummary e;
343 if (e.should_commit()) {
344 e.set_gcId(_gc_id.id());
345 e.set_when((u1)_when);
346 e.set_heapSpace(to_struct(heap_space));
347 e.set_heapUsed(heap_summary->used());
348 e.commit();
349 }
350 }
351
352 // void visit(const G1HeapSummary* g1_heap_summary) const {
353 // visit((GCHeapSummary*)g1_heap_summary);
354 //
355 // EventG1HeapSummary e;
356 // if (e.should_commit()) {
357 // e.set_gcId(_shared_gc_info.gc_id().id());
358 // e.set_when((u1)_when);
359 // e.set_edenUsedSize(g1_heap_summary->edenUsed());
360 // e.set_edenTotalSize(g1_heap_summary->edenCapacity());
361 // e.set_survivorUsedSize(g1_heap_summary->survivorUsed());
362 // e.set_numberOfRegions(g1_heap_summary->numberOfRegions());
363 // e.commit();
364 // }
365 // }
366
367 void visit(const PSHeapSummary* ps_heap_summary) const {
368 visit((GCHeapSummary*)ps_heap_summary);
369
370 const VirtualSpaceSummary& old_summary = ps_heap_summary->old();
371 const SpaceSummary& old_space = ps_heap_summary->old_space();
372 const VirtualSpaceSummary& young_summary = ps_heap_summary->young();
373 const SpaceSummary& eden_space = ps_heap_summary->eden();
374 const SpaceSummary& from_space = ps_heap_summary->from();
375 const SpaceSummary& to_space = ps_heap_summary->to();
376
377 EventPSHeapSummary e;
378 if (e.should_commit()) {
379 e.set_gcId(_gc_id.id());
380 e.set_when((u1)_when);
381
382 e.set_oldSpace(to_struct(ps_heap_summary->old()));
383 e.set_oldObjectSpace(to_struct(ps_heap_summary->old_space()));
384 e.set_youngSpace(to_struct(ps_heap_summary->young()));
385 e.set_edenSpace(to_struct(ps_heap_summary->eden()));
|
332
333 class GCHeapSummaryEventSender : public GCHeapSummaryVisitor {
334 GCId _gc_id;
335 GCWhen::Type _when;
336 public:
337 GCHeapSummaryEventSender(GCId gc_id, GCWhen::Type when) : _gc_id(gc_id), _when(when) {}
338
339 void visit(const GCHeapSummary* heap_summary) const {
340 const VirtualSpaceSummary& heap_space = heap_summary->heap();
341
342 EventGCHeapSummary e;
343 if (e.should_commit()) {
344 e.set_gcId(_gc_id.id());
345 e.set_when((u1)_when);
346 e.set_heapSpace(to_struct(heap_space));
347 e.set_heapUsed(heap_summary->used());
348 e.commit();
349 }
350 }
351
352 void visit(const G1HeapSummary* g1_heap_summary) const {
353 visit((GCHeapSummary*)g1_heap_summary);
354
355 EventG1HeapSummary e;
356 if (e.should_commit()) {
357 e.set_gcId(_gc_id.id());
358 e.set_when((u1)_when);
359 e.set_edenUsedSize(g1_heap_summary->edenUsed());
360 e.set_edenTotalSize(g1_heap_summary->edenCapacity());
361 e.set_survivorUsedSize(g1_heap_summary->survivorUsed());
362 e.set_numberOfRegions(g1_heap_summary->numberOfRegions());
363 e.commit();
364 }
365 }
366
367 void visit(const PSHeapSummary* ps_heap_summary) const {
368 visit((GCHeapSummary*)ps_heap_summary);
369
370 const VirtualSpaceSummary& old_summary = ps_heap_summary->old();
371 const SpaceSummary& old_space = ps_heap_summary->old_space();
372 const VirtualSpaceSummary& young_summary = ps_heap_summary->young();
373 const SpaceSummary& eden_space = ps_heap_summary->eden();
374 const SpaceSummary& from_space = ps_heap_summary->from();
375 const SpaceSummary& to_space = ps_heap_summary->to();
376
377 EventPSHeapSummary e;
378 if (e.should_commit()) {
379 e.set_gcId(_gc_id.id());
380 e.set_when((u1)_when);
381
382 e.set_oldSpace(to_struct(ps_heap_summary->old()));
383 e.set_oldObjectSpace(to_struct(ps_heap_summary->old_space()));
384 e.set_youngSpace(to_struct(ps_heap_summary->young()));
385 e.set_edenSpace(to_struct(ps_heap_summary->eden()));
|