annotate src/share/vm/utilities/events.cpp @ 1994:6cd6d394f280

7001033: assert(gch->gc_cause() == GCCause::_scavenge_alot || !gch->incremental_collection_failed()) 7002546: regression on SpecJbb2005 on 7b118 comparing to 7b117 on small heaps Summary: Relaxed assertion checking related to incremental_collection_failed flag to allow for ExplicitGCInvokesConcurrent behaviour where we do not want a failing scavenge to bail to a stop-world collection. Parameterized incremental_collection_will_fail() so we can selectively use, or not use, as appropriate, the statistical prediction at specific use sites. This essentially reverts the scavenge bail-out logic to what it was prior to some recent changes that had inadvertently started using the statistical prediction which can be noisy in the presence of bursty loads. Added some associated verbose non-product debugging messages. Reviewed-by: johnc, tonyp
author ysr
date Tue, 07 Dec 2010 21:55:53 -0800
parents f95d63e2154a
children f08d439fab8c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 *
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
21 * questions.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
25 #include "precompiled.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
26 #include "memory/allocation.inline.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
27 #include "runtime/mutexLocker.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
28 #include "runtime/osThread.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
29 #include "runtime/threadLocalStorage.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
30 #include "runtime/timer.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
31 #include "utilities/events.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
32 #ifdef TARGET_OS_FAMILY_linux
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
33 # include "thread_linux.inline.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
34 #endif
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
35 #ifdef TARGET_OS_FAMILY_solaris
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
36 # include "thread_solaris.inline.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
37 #endif
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
38 #ifdef TARGET_OS_FAMILY_windows
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
39 # include "thread_windows.inline.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
40 #endif
0
a61af66fc99e Initial load
duke
parents:
diff changeset
41
a61af66fc99e Initial load
duke
parents:
diff changeset
42
a61af66fc99e Initial load
duke
parents:
diff changeset
43 #ifndef PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
44
a61af66fc99e Initial load
duke
parents:
diff changeset
45 ////////////////////////////////////////////////////////////////////////////
a61af66fc99e Initial load
duke
parents:
diff changeset
46 // Event
a61af66fc99e Initial load
duke
parents:
diff changeset
47
a61af66fc99e Initial load
duke
parents:
diff changeset
48 typedef u4 EventID;
a61af66fc99e Initial load
duke
parents:
diff changeset
49
a61af66fc99e Initial load
duke
parents:
diff changeset
50 class Event VALUE_OBJ_CLASS_SPEC {
a61af66fc99e Initial load
duke
parents:
diff changeset
51 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
52 jlong _time_tick;
a61af66fc99e Initial load
duke
parents:
diff changeset
53 intx _thread_id;
a61af66fc99e Initial load
duke
parents:
diff changeset
54 const char* _format;
a61af66fc99e Initial load
duke
parents:
diff changeset
55 int _indent;
a61af66fc99e Initial load
duke
parents:
diff changeset
56 intptr_t _arg_1;
a61af66fc99e Initial load
duke
parents:
diff changeset
57 intptr_t _arg_2;
a61af66fc99e Initial load
duke
parents:
diff changeset
58 intptr_t _arg_3;
a61af66fc99e Initial load
duke
parents:
diff changeset
59
a61af66fc99e Initial load
duke
parents:
diff changeset
60 // only EventBuffer::add_event() can assign event id
a61af66fc99e Initial load
duke
parents:
diff changeset
61 friend class EventBuffer;
a61af66fc99e Initial load
duke
parents:
diff changeset
62 EventID _id;
a61af66fc99e Initial load
duke
parents:
diff changeset
63
a61af66fc99e Initial load
duke
parents:
diff changeset
64 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
65
a61af66fc99e Initial load
duke
parents:
diff changeset
66 void clear() { _format = NULL; }
a61af66fc99e Initial load
duke
parents:
diff changeset
67
a61af66fc99e Initial load
duke
parents:
diff changeset
68 EventID id() const { return _id; }
a61af66fc99e Initial load
duke
parents:
diff changeset
69
a61af66fc99e Initial load
duke
parents:
diff changeset
70 void fill(int indent, const char* format, intptr_t arg_1, intptr_t arg_2, intptr_t arg_3) {
a61af66fc99e Initial load
duke
parents:
diff changeset
71 _format = format;
a61af66fc99e Initial load
duke
parents:
diff changeset
72 _arg_1 = arg_1;
a61af66fc99e Initial load
duke
parents:
diff changeset
73 _arg_2 = arg_2;
a61af66fc99e Initial load
duke
parents:
diff changeset
74 _arg_3 = arg_3;
a61af66fc99e Initial load
duke
parents:
diff changeset
75
a61af66fc99e Initial load
duke
parents:
diff changeset
76 _indent = indent;
a61af66fc99e Initial load
duke
parents:
diff changeset
77
a61af66fc99e Initial load
duke
parents:
diff changeset
78 _thread_id = os::current_thread_id();
a61af66fc99e Initial load
duke
parents:
diff changeset
79 _time_tick = os::elapsed_counter();
a61af66fc99e Initial load
duke
parents:
diff changeset
80 }
a61af66fc99e Initial load
duke
parents:
diff changeset
81
a61af66fc99e Initial load
duke
parents:
diff changeset
82 void print_on(outputStream *st) {
a61af66fc99e Initial load
duke
parents:
diff changeset
83 if (_format == NULL) return;
a61af66fc99e Initial load
duke
parents:
diff changeset
84 st->print(" %d", _thread_id);
a61af66fc99e Initial load
duke
parents:
diff changeset
85 st->print(" %3.2g ", (double)_time_tick / os::elapsed_frequency());
a61af66fc99e Initial load
duke
parents:
diff changeset
86 st->fill_to(20);
a61af66fc99e Initial load
duke
parents:
diff changeset
87 for (int index = 0; index < _indent; index++) {
a61af66fc99e Initial load
duke
parents:
diff changeset
88 st->print("| ");
a61af66fc99e Initial load
duke
parents:
diff changeset
89 }
a61af66fc99e Initial load
duke
parents:
diff changeset
90 st->print_cr(_format, _arg_1, _arg_2, _arg_3);
a61af66fc99e Initial load
duke
parents:
diff changeset
91 }
a61af66fc99e Initial load
duke
parents:
diff changeset
92 };
a61af66fc99e Initial load
duke
parents:
diff changeset
93
a61af66fc99e Initial load
duke
parents:
diff changeset
94 ////////////////////////////////////////////////////////////////////////////
a61af66fc99e Initial load
duke
parents:
diff changeset
95 // EventBuffer
a61af66fc99e Initial load
duke
parents:
diff changeset
96 //
a61af66fc99e Initial load
duke
parents:
diff changeset
97 // Simple lock-free event queue. Every event has a unique 32-bit id.
a61af66fc99e Initial load
duke
parents:
diff changeset
98 // It's fine if two threads add events at the same time, because they
a61af66fc99e Initial load
duke
parents:
diff changeset
99 // will get different event id, and then write to different buffer location.
a61af66fc99e Initial load
duke
parents:
diff changeset
100 // However, it is assumed that add_event() is quick enough (or buffer size
a61af66fc99e Initial load
duke
parents:
diff changeset
101 // is big enough), so when one thread is adding event, there can't be more
a61af66fc99e Initial load
duke
parents:
diff changeset
102 // than "size" events created by other threads; otherwise we'll end up having
a61af66fc99e Initial load
duke
parents:
diff changeset
103 // two threads writing to the same location.
a61af66fc99e Initial load
duke
parents:
diff changeset
104
a61af66fc99e Initial load
duke
parents:
diff changeset
105 class EventBuffer : AllStatic {
a61af66fc99e Initial load
duke
parents:
diff changeset
106 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
107 static Event* buffer;
a61af66fc99e Initial load
duke
parents:
diff changeset
108 static int size;
a61af66fc99e Initial load
duke
parents:
diff changeset
109 static jint indent;
a61af66fc99e Initial load
duke
parents:
diff changeset
110 static volatile EventID _current_event_id;
a61af66fc99e Initial load
duke
parents:
diff changeset
111
a61af66fc99e Initial load
duke
parents:
diff changeset
112 static EventID get_next_event_id() {
a61af66fc99e Initial load
duke
parents:
diff changeset
113 return (EventID)Atomic::add(1, (jint*)&_current_event_id);
a61af66fc99e Initial load
duke
parents:
diff changeset
114 }
a61af66fc99e Initial load
duke
parents:
diff changeset
115
a61af66fc99e Initial load
duke
parents:
diff changeset
116 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
117 static void inc_indent() { Atomic::inc(&indent); }
a61af66fc99e Initial load
duke
parents:
diff changeset
118 static void dec_indent() { Atomic::dec(&indent); }
a61af66fc99e Initial load
duke
parents:
diff changeset
119
a61af66fc99e Initial load
duke
parents:
diff changeset
120 static bool get_event(EventID id, Event* event) {
a61af66fc99e Initial load
duke
parents:
diff changeset
121 int index = (int)(id % size);
a61af66fc99e Initial load
duke
parents:
diff changeset
122 if (buffer[index].id() == id) {
a61af66fc99e Initial load
duke
parents:
diff changeset
123 memcpy(event, &buffer[index], sizeof(Event));
a61af66fc99e Initial load
duke
parents:
diff changeset
124 // check id again; if buffer[index] is being updated by another thread,
a61af66fc99e Initial load
duke
parents:
diff changeset
125 // event->id() will contain different value.
a61af66fc99e Initial load
duke
parents:
diff changeset
126 return (event->id() == id);
a61af66fc99e Initial load
duke
parents:
diff changeset
127 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
128 // id does not match - id is invalid, or event is overwritten
a61af66fc99e Initial load
duke
parents:
diff changeset
129 return false;
a61af66fc99e Initial load
duke
parents:
diff changeset
130 }
a61af66fc99e Initial load
duke
parents:
diff changeset
131 }
a61af66fc99e Initial load
duke
parents:
diff changeset
132
a61af66fc99e Initial load
duke
parents:
diff changeset
133 // add a new event to the queue; if EventBuffer is full, this call will
a61af66fc99e Initial load
duke
parents:
diff changeset
134 // overwrite the oldest event in the queue
a61af66fc99e Initial load
duke
parents:
diff changeset
135 static EventID add_event(const char* format,
a61af66fc99e Initial load
duke
parents:
diff changeset
136 intptr_t arg_1, intptr_t arg_2, intptr_t arg_3) {
a61af66fc99e Initial load
duke
parents:
diff changeset
137 // assign a unique id
a61af66fc99e Initial load
duke
parents:
diff changeset
138 EventID id = get_next_event_id();
a61af66fc99e Initial load
duke
parents:
diff changeset
139
a61af66fc99e Initial load
duke
parents:
diff changeset
140 // event will be copied to buffer[index]
a61af66fc99e Initial load
duke
parents:
diff changeset
141 int index = (int)(id % size);
a61af66fc99e Initial load
duke
parents:
diff changeset
142
a61af66fc99e Initial load
duke
parents:
diff changeset
143 // first, invalidate id, buffer[index] can't have event with id = index + 2
a61af66fc99e Initial load
duke
parents:
diff changeset
144 buffer[index]._id = index + 2;
a61af66fc99e Initial load
duke
parents:
diff changeset
145
a61af66fc99e Initial load
duke
parents:
diff changeset
146 // make sure everyone has seen that buffer[index] is invalid
a61af66fc99e Initial load
duke
parents:
diff changeset
147 OrderAccess::fence();
a61af66fc99e Initial load
duke
parents:
diff changeset
148
a61af66fc99e Initial load
duke
parents:
diff changeset
149 // ... before updating its value
a61af66fc99e Initial load
duke
parents:
diff changeset
150 buffer[index].fill(indent, format, arg_1, arg_2, arg_3);
a61af66fc99e Initial load
duke
parents:
diff changeset
151
a61af66fc99e Initial load
duke
parents:
diff changeset
152 // finally, set up real event id, now buffer[index] contains valid event
a61af66fc99e Initial load
duke
parents:
diff changeset
153 OrderAccess::release_store(&(buffer[index]._id), id);
a61af66fc99e Initial load
duke
parents:
diff changeset
154
a61af66fc99e Initial load
duke
parents:
diff changeset
155 return id;
a61af66fc99e Initial load
duke
parents:
diff changeset
156 }
a61af66fc99e Initial load
duke
parents:
diff changeset
157
a61af66fc99e Initial load
duke
parents:
diff changeset
158 static void print_last(outputStream *st, int number) {
a61af66fc99e Initial load
duke
parents:
diff changeset
159 st->print_cr("[Last %d events in the event buffer]", number);
a61af66fc99e Initial load
duke
parents:
diff changeset
160 st->print_cr("-<thd>-<elapsed sec>-<description>---------------------");
a61af66fc99e Initial load
duke
parents:
diff changeset
161
a61af66fc99e Initial load
duke
parents:
diff changeset
162 int count = 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
163 EventID id = _current_event_id;
a61af66fc99e Initial load
duke
parents:
diff changeset
164 while (count < number) {
a61af66fc99e Initial load
duke
parents:
diff changeset
165 Event event;
a61af66fc99e Initial load
duke
parents:
diff changeset
166 if (get_event(id, &event)) {
a61af66fc99e Initial load
duke
parents:
diff changeset
167 event.print_on(st);
a61af66fc99e Initial load
duke
parents:
diff changeset
168 }
a61af66fc99e Initial load
duke
parents:
diff changeset
169 id--;
a61af66fc99e Initial load
duke
parents:
diff changeset
170 count++;
a61af66fc99e Initial load
duke
parents:
diff changeset
171 }
a61af66fc99e Initial load
duke
parents:
diff changeset
172 }
a61af66fc99e Initial load
duke
parents:
diff changeset
173
a61af66fc99e Initial load
duke
parents:
diff changeset
174 static void print_all(outputStream* st) {
a61af66fc99e Initial load
duke
parents:
diff changeset
175 print_last(st, size);
a61af66fc99e Initial load
duke
parents:
diff changeset
176 }
a61af66fc99e Initial load
duke
parents:
diff changeset
177
a61af66fc99e Initial load
duke
parents:
diff changeset
178 static void init() {
a61af66fc99e Initial load
duke
parents:
diff changeset
179 // Allocate the event buffer
a61af66fc99e Initial load
duke
parents:
diff changeset
180 size = EventLogLength;
a61af66fc99e Initial load
duke
parents:
diff changeset
181 buffer = NEW_C_HEAP_ARRAY(Event, size);
a61af66fc99e Initial load
duke
parents:
diff changeset
182
a61af66fc99e Initial load
duke
parents:
diff changeset
183 _current_event_id = 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
184
a61af66fc99e Initial load
duke
parents:
diff changeset
185 // Clear the event buffer
a61af66fc99e Initial load
duke
parents:
diff changeset
186 for (int index = 0; index < size; index++) {
a61af66fc99e Initial load
duke
parents:
diff changeset
187 buffer[index]._id = index + 1; // index + 1 is invalid id
a61af66fc99e Initial load
duke
parents:
diff changeset
188 buffer[index].clear();
a61af66fc99e Initial load
duke
parents:
diff changeset
189 }
a61af66fc99e Initial load
duke
parents:
diff changeset
190 }
a61af66fc99e Initial load
duke
parents:
diff changeset
191 };
a61af66fc99e Initial load
duke
parents:
diff changeset
192
a61af66fc99e Initial load
duke
parents:
diff changeset
193 Event* EventBuffer::buffer;
a61af66fc99e Initial load
duke
parents:
diff changeset
194 int EventBuffer::size;
a61af66fc99e Initial load
duke
parents:
diff changeset
195 volatile EventID EventBuffer::_current_event_id;
a61af66fc99e Initial load
duke
parents:
diff changeset
196 int EventBuffer::indent;
a61af66fc99e Initial load
duke
parents:
diff changeset
197
a61af66fc99e Initial load
duke
parents:
diff changeset
198 ////////////////////////////////////////////////////////////////////////////
a61af66fc99e Initial load
duke
parents:
diff changeset
199 // Events
a61af66fc99e Initial load
duke
parents:
diff changeset
200
a61af66fc99e Initial load
duke
parents:
diff changeset
201 // Events::log() is safe for signal handlers
a61af66fc99e Initial load
duke
parents:
diff changeset
202 void Events::log(const char* format, ...) {
a61af66fc99e Initial load
duke
parents:
diff changeset
203 if (LogEvents) {
a61af66fc99e Initial load
duke
parents:
diff changeset
204 va_list ap;
a61af66fc99e Initial load
duke
parents:
diff changeset
205 va_start(ap, format);
a61af66fc99e Initial load
duke
parents:
diff changeset
206 intptr_t arg_1 = va_arg(ap, intptr_t);
a61af66fc99e Initial load
duke
parents:
diff changeset
207 intptr_t arg_2 = va_arg(ap, intptr_t);
a61af66fc99e Initial load
duke
parents:
diff changeset
208 intptr_t arg_3 = va_arg(ap, intptr_t);
a61af66fc99e Initial load
duke
parents:
diff changeset
209 va_end(ap);
a61af66fc99e Initial load
duke
parents:
diff changeset
210
a61af66fc99e Initial load
duke
parents:
diff changeset
211 EventBuffer::add_event(format, arg_1, arg_2, arg_3);
a61af66fc99e Initial load
duke
parents:
diff changeset
212 }
a61af66fc99e Initial load
duke
parents:
diff changeset
213 }
a61af66fc99e Initial load
duke
parents:
diff changeset
214
a61af66fc99e Initial load
duke
parents:
diff changeset
215 void Events::print_all(outputStream *st) {
a61af66fc99e Initial load
duke
parents:
diff changeset
216 EventBuffer::print_all(st);
a61af66fc99e Initial load
duke
parents:
diff changeset
217 }
a61af66fc99e Initial load
duke
parents:
diff changeset
218
a61af66fc99e Initial load
duke
parents:
diff changeset
219 void Events::print_last(outputStream *st, int number) {
a61af66fc99e Initial load
duke
parents:
diff changeset
220 EventBuffer::print_last(st, number);
a61af66fc99e Initial load
duke
parents:
diff changeset
221 }
a61af66fc99e Initial load
duke
parents:
diff changeset
222
a61af66fc99e Initial load
duke
parents:
diff changeset
223 ///////////////////////////////////////////////////////////////////////////
a61af66fc99e Initial load
duke
parents:
diff changeset
224 // EventMark
a61af66fc99e Initial load
duke
parents:
diff changeset
225
a61af66fc99e Initial load
duke
parents:
diff changeset
226 EventMark::EventMark(const char* format, ...) {
a61af66fc99e Initial load
duke
parents:
diff changeset
227 if (LogEvents) {
a61af66fc99e Initial load
duke
parents:
diff changeset
228 va_list ap;
a61af66fc99e Initial load
duke
parents:
diff changeset
229 va_start(ap, format);
a61af66fc99e Initial load
duke
parents:
diff changeset
230 intptr_t arg_1 = va_arg(ap, intptr_t);
a61af66fc99e Initial load
duke
parents:
diff changeset
231 intptr_t arg_2 = va_arg(ap, intptr_t);
a61af66fc99e Initial load
duke
parents:
diff changeset
232 intptr_t arg_3 = va_arg(ap, intptr_t);
a61af66fc99e Initial load
duke
parents:
diff changeset
233 va_end(ap);
a61af66fc99e Initial load
duke
parents:
diff changeset
234
a61af66fc99e Initial load
duke
parents:
diff changeset
235 EventBuffer::add_event(format, arg_1, arg_2, arg_3);
a61af66fc99e Initial load
duke
parents:
diff changeset
236 EventBuffer::inc_indent();
a61af66fc99e Initial load
duke
parents:
diff changeset
237 }
a61af66fc99e Initial load
duke
parents:
diff changeset
238 }
a61af66fc99e Initial load
duke
parents:
diff changeset
239
a61af66fc99e Initial load
duke
parents:
diff changeset
240 EventMark::~EventMark() {
a61af66fc99e Initial load
duke
parents:
diff changeset
241 if (LogEvents) {
a61af66fc99e Initial load
duke
parents:
diff changeset
242 EventBuffer::dec_indent();
a61af66fc99e Initial load
duke
parents:
diff changeset
243 EventBuffer::add_event("done", 0, 0, 0);
a61af66fc99e Initial load
duke
parents:
diff changeset
244 }
a61af66fc99e Initial load
duke
parents:
diff changeset
245 }
a61af66fc99e Initial load
duke
parents:
diff changeset
246
a61af66fc99e Initial load
duke
parents:
diff changeset
247 ///////////////////////////////////////////////////////////////////////////
a61af66fc99e Initial load
duke
parents:
diff changeset
248
a61af66fc99e Initial load
duke
parents:
diff changeset
249 void eventlog_init() {
a61af66fc99e Initial load
duke
parents:
diff changeset
250 EventBuffer::init();
a61af66fc99e Initial load
duke
parents:
diff changeset
251 }
a61af66fc99e Initial load
duke
parents:
diff changeset
252
a61af66fc99e Initial load
duke
parents:
diff changeset
253 int print_all_events(outputStream *st) {
a61af66fc99e Initial load
duke
parents:
diff changeset
254 EventBuffer::print_all(st);
a61af66fc99e Initial load
duke
parents:
diff changeset
255 return 1;
a61af66fc99e Initial load
duke
parents:
diff changeset
256 }
a61af66fc99e Initial load
duke
parents:
diff changeset
257
a61af66fc99e Initial load
duke
parents:
diff changeset
258 #else
a61af66fc99e Initial load
duke
parents:
diff changeset
259
a61af66fc99e Initial load
duke
parents:
diff changeset
260 void eventlog_init() {}
a61af66fc99e Initial load
duke
parents:
diff changeset
261 int print_all_events(outputStream *st) { return 0; }
a61af66fc99e Initial load
duke
parents:
diff changeset
262
a61af66fc99e Initial load
duke
parents:
diff changeset
263 #endif // PRODUCT