comparison src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @ 20190:0982ec23da03

8043607: Add a GC id as a log decoration similar to PrintGCTimeStamps Reviewed-by: jwilhelm, ehelin, tschatzl
author brutisso
date Thu, 19 Jun 2014 13:31:14 +0200
parents a45a4f5a9609
children fd81a5764900
comparison
equal deleted inserted replaced
20189:5d855d021755 20190:0982ec23da03
1303 assert(gc_cause() != GCCause::_java_lang_system_gc || explicit_gc, "invariant"); 1303 assert(gc_cause() != GCCause::_java_lang_system_gc || explicit_gc, "invariant");
1304 gclog_or_tty->date_stamp(G1Log::fine() && PrintGCDateStamps); 1304 gclog_or_tty->date_stamp(G1Log::fine() && PrintGCDateStamps);
1305 TraceCPUTime tcpu(G1Log::finer(), true, gclog_or_tty); 1305 TraceCPUTime tcpu(G1Log::finer(), true, gclog_or_tty);
1306 1306
1307 { 1307 {
1308 GCTraceTime t(GCCauseString("Full GC", gc_cause()), G1Log::fine(), true, NULL); 1308 GCTraceTime t(GCCauseString("Full GC", gc_cause()), G1Log::fine(), true, NULL, gc_tracer->gc_id());
1309 TraceCollectorStats tcs(g1mm()->full_collection_counters()); 1309 TraceCollectorStats tcs(g1mm()->full_collection_counters());
1310 TraceMemoryManagerStats tms(true /* fullGC */, gc_cause()); 1310 TraceMemoryManagerStats tms(true /* fullGC */, gc_cause());
1311 1311
1312 double start = os::elapsedTime(); 1312 double start = os::elapsedTime();
1313 g1_policy()->record_full_collection_start(); 1313 g1_policy()->record_full_collection_start();
3891 void G1CollectedHeap::log_gc_header() { 3891 void G1CollectedHeap::log_gc_header() {
3892 if (!G1Log::fine()) { 3892 if (!G1Log::fine()) {
3893 return; 3893 return;
3894 } 3894 }
3895 3895
3896 gclog_or_tty->date_stamp(PrintGCDateStamps); 3896 gclog_or_tty->gclog_stamp(_gc_tracer_stw->gc_id());
3897 gclog_or_tty->stamp(PrintGCTimeStamps);
3898 3897
3899 GCCauseString gc_cause_str = GCCauseString("GC pause", gc_cause()) 3898 GCCauseString gc_cause_str = GCCauseString("GC pause", gc_cause())
3900 .append(g1_policy()->gcs_are_young() ? "(young)" : "(mixed)") 3899 .append(g1_policy()->gcs_are_young() ? "(young)" : "(mixed)")
3901 .append(g1_policy()->during_initial_mark_pause() ? " (initial-mark)" : ""); 3900 .append(g1_policy()->during_initial_mark_pause() ? " (initial-mark)" : "");
3902 3901
5779 // Serial reference processing... 5778 // Serial reference processing...
5780 stats = rp->process_discovered_references(&is_alive, 5779 stats = rp->process_discovered_references(&is_alive,
5781 &keep_alive, 5780 &keep_alive,
5782 &drain_queue, 5781 &drain_queue,
5783 NULL, 5782 NULL,
5784 _gc_timer_stw); 5783 _gc_timer_stw,
5784 _gc_tracer_stw->gc_id());
5785 } else { 5785 } else {
5786 // Parallel reference processing 5786 // Parallel reference processing
5787 assert(rp->num_q() == no_of_gc_workers, "sanity"); 5787 assert(rp->num_q() == no_of_gc_workers, "sanity");
5788 assert(no_of_gc_workers <= rp->max_num_q(), "sanity"); 5788 assert(no_of_gc_workers <= rp->max_num_q(), "sanity");
5789 5789
5790 G1STWRefProcTaskExecutor par_task_executor(this, workers(), _task_queues, no_of_gc_workers); 5790 G1STWRefProcTaskExecutor par_task_executor(this, workers(), _task_queues, no_of_gc_workers);
5791 stats = rp->process_discovered_references(&is_alive, 5791 stats = rp->process_discovered_references(&is_alive,
5792 &keep_alive, 5792 &keep_alive,
5793 &drain_queue, 5793 &drain_queue,
5794 &par_task_executor, 5794 &par_task_executor,
5795 _gc_timer_stw); 5795 _gc_timer_stw,
5796 _gc_tracer_stw->gc_id());
5796 } 5797 }
5797 5798
5798 _gc_tracer_stw->report_gc_reference_stats(stats); 5799 _gc_tracer_stw->report_gc_reference_stats(stats);
5799 // We have completed copying any necessary live referent objects 5800 // We have completed copying any necessary live referent objects
5800 // (that were not copied during the actual pause) so we can 5801 // (that were not copied during the actual pause) so we can