< prev index next >

src/share/vm/gc/shared/gcTraceSend.cpp

Print this page




 403 
 404   return meta_sizes;
 405 }
 406 
 407 void GCTracer::send_meta_space_summary_event(GCWhen::Type when, const MetaspaceSummary& meta_space_summary) const {
 408   EventMetaspaceSummary e;
 409   if (e.should_commit()) {
 410     e.set_gcId(GCId::current());
 411     e.set_when((u1) when);
 412     e.set_gcThreshold(meta_space_summary.capacity_until_GC());
 413     e.set_metaspace(to_trace_struct(meta_space_summary.meta_space()));
 414     e.set_dataSpace(to_trace_struct(meta_space_summary.data_space()));
 415     e.set_classSpace(to_trace_struct(meta_space_summary.class_space()));
 416     e.commit();
 417   }
 418 }
 419 
 420 class PhaseSender : public PhaseVisitor {
 421  public:
 422   template<typename T>
 423   void send_phase(PausePhase* pause) {
 424     T event(UNTIMED);
 425     if (event.should_commit()) {
 426       event.set_gcId(GCId::current());
 427       event.set_name(pause->name());
 428       event.set_starttime(pause->start());
 429       event.set_endtime(pause->end());
 430       event.commit();
 431     }
 432   }
 433 
 434   void visit(GCPhase* pause) { ShouldNotReachHere(); }
 435   void visit(ConcurrentPhase* pause) { Unimplemented(); }
 436   void visit(PausePhase* pause) {
 437     assert(PhasesStack::PHASE_LEVELS == 5, "Need more event types");
 438 
 439     switch (pause->level()) {
 440       case 0: send_phase<EventGCPhasePause>(pause); break;
 441       case 1: send_phase<EventGCPhasePauseLevel1>(pause); break;
 442       case 2: send_phase<EventGCPhasePauseLevel2>(pause); break;
 443       case 3: send_phase<EventGCPhasePauseLevel3>(pause); break;
 444       default: /* Ignore sending this phase */ break;











 445     }
 446   }
 447 };
 448 
 449 void GCTracer::send_phase_events(TimePartitions* time_partitions) const {
 450   PhaseSender phase_reporter;
 451 
 452   TimePartitionPhasesIterator iter(time_partitions);
 453   while (iter.has_next()) {
 454     GCPhase* phase = iter.next();
 455     phase->accept(&phase_reporter);
 456   }
 457 }


 403 
 404   return meta_sizes;
 405 }
 406 
 407 void GCTracer::send_meta_space_summary_event(GCWhen::Type when, const MetaspaceSummary& meta_space_summary) const {
 408   EventMetaspaceSummary e;
 409   if (e.should_commit()) {
 410     e.set_gcId(GCId::current());
 411     e.set_when((u1) when);
 412     e.set_gcThreshold(meta_space_summary.capacity_until_GC());
 413     e.set_metaspace(to_trace_struct(meta_space_summary.meta_space()));
 414     e.set_dataSpace(to_trace_struct(meta_space_summary.data_space()));
 415     e.set_classSpace(to_trace_struct(meta_space_summary.class_space()));
 416     e.commit();
 417   }
 418 }
 419 
 420 class PhaseSender : public PhaseVisitor {
 421  public:
 422   template<typename T>
 423   void send_phase(GCPhase* phase) {
 424     T event(UNTIMED);
 425     if (event.should_commit()) {
 426       event.set_gcId(GCId::current());
 427       event.set_name(phase->name());
 428       event.set_starttime(phase->start());
 429       event.set_endtime(phase->end());
 430       event.commit();
 431     }
 432   }
 433 
 434   void visit(GCPhase* phase) {
 435     switch (phase->type()) {
 436       case GCPhase::PausePhaseType:
 437         assert(phase->level() < PhasesStack::PHASE_LEVELS, "Need more event types for PausePhase");
 438 
 439         switch (phase->level()) {
 440           case 0: send_phase<EventGCPhasePause>(phase); break;
 441           case 1: send_phase<EventGCPhasePauseLevel1>(phase); break;
 442           case 2: send_phase<EventGCPhasePauseLevel2>(phase); break;
 443           case 3: send_phase<EventGCPhasePauseLevel3>(phase); break;
 444           default: /* Ignore sending this phase */ break;
 445         }
 446         break;
 447 
 448       case GCPhase::ConcurrentPhaseType:
 449         assert(phase->level() < 1, "There's only one level for ConcurrentPhase");
 450 
 451         switch (phase->level()) {
 452           case 0: send_phase<EventGCPhaseConcurrent>(phase); break;
 453           default: /* Ignore sending this phase */ break;
 454         }
 455         break;
 456     }
 457   }
 458 };
 459 
 460 void GCTracer::send_phase_events(TimePartitions* time_partitions) const {
 461   PhaseSender phase_reporter;
 462 
 463   TimePartitionPhasesIterator iter(time_partitions);
 464   while (iter.has_next()) {
 465     GCPhase* phase = iter.next();
 466     phase->accept(&phase_reporter);
 467   }
 468 }
< prev index next >