comparison src/share/vm/gc_implementation/shared/gcTraceTime.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 86e6d691f2e1
children f74dbdd45754
comparison
equal deleted inserted replaced
20189:5d855d021755 20190:0982ec23da03
22 * 22 *
23 */ 23 */
24 24
25 #include "precompiled.hpp" 25 #include "precompiled.hpp"
26 #include "gc_implementation/shared/gcTimer.hpp" 26 #include "gc_implementation/shared/gcTimer.hpp"
27 #include "gc_implementation/shared/gcTrace.hpp"
27 #include "gc_implementation/shared/gcTraceTime.hpp" 28 #include "gc_implementation/shared/gcTraceTime.hpp"
28 #include "runtime/globals.hpp" 29 #include "runtime/globals.hpp"
29 #include "runtime/os.hpp" 30 #include "runtime/os.hpp"
30 #include "runtime/safepoint.hpp" 31 #include "runtime/safepoint.hpp"
31 #include "runtime/thread.inline.hpp" 32 #include "runtime/thread.inline.hpp"
32 #include "runtime/timer.hpp" 33 #include "runtime/timer.hpp"
33 #include "utilities/ostream.hpp" 34 #include "utilities/ostream.hpp"
34 #include "utilities/ticks.inline.hpp" 35 #include "utilities/ticks.inline.hpp"
35 36
36 37
37 GCTraceTime::GCTraceTime(const char* title, bool doit, bool print_cr, GCTimer* timer) : 38 GCTraceTime::GCTraceTime(const char* title, bool doit, bool print_cr, GCTimer* timer, GCId gc_id) :
38 _title(title), _doit(doit), _print_cr(print_cr), _timer(timer), _start_counter() { 39 _title(title), _doit(doit), _print_cr(print_cr), _timer(timer), _start_counter() {
39 if (_doit || _timer != NULL) { 40 if (_doit || _timer != NULL) {
40 _start_counter.stamp(); 41 _start_counter.stamp();
41 } 42 }
42 43
49 50
50 if (_doit) { 51 if (_doit) {
51 if (PrintGCTimeStamps) { 52 if (PrintGCTimeStamps) {
52 gclog_or_tty->stamp(); 53 gclog_or_tty->stamp();
53 gclog_or_tty->print(": "); 54 gclog_or_tty->print(": ");
55 }
56 if (PrintGCID) {
57 gclog_or_tty->print("#%u: ", gc_id.id());
54 } 58 }
55 gclog_or_tty->print("[%s", title); 59 gclog_or_tty->print("[%s", title);
56 gclog_or_tty->flush(); 60 gclog_or_tty->flush();
57 } 61 }
58 } 62 }