annotate src/share/vm/utilities/events.cpp @ 3960:f08d439fab8c

7089790: integrate bsd-port changes Reviewed-by: kvn, twisti, jrose Contributed-by: Kurt Miller <kurt@intricatesoftware.com>, Greg Lewis <glewis@eyesbeyond.com>, Jung-uk Kim <jkim@freebsd.org>, Christos Zoulas <christos@zoulas.com>, Landon Fuller <landonf@plausible.coop>, The FreeBSD Foundation <board@freebsdfoundation.org>, Michael Franz <mvfranz@gmail.com>, Roger Hoover <rhoover@apple.com>, Alexander Strange <astrange@apple.com>
author never
date Sun, 25 Sep 2011 16:03:29 -0700
parents f95d63e2154a
children aa3d708d67c4
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
3960
f08d439fab8c 7089790: integrate bsd-port changes
never
parents: 1972
diff changeset
41 #ifdef TARGET_OS_FAMILY_bsd
f08d439fab8c 7089790: integrate bsd-port changes
never
parents: 1972
diff changeset
42 # include "thread_bsd.inline.hpp"
f08d439fab8c 7089790: integrate bsd-port changes
never
parents: 1972
diff changeset
43 #endif
0
a61af66fc99e Initial load
duke
parents:
diff changeset
44
a61af66fc99e Initial load
duke
parents:
diff changeset
45
a61af66fc99e Initial load
duke
parents:
diff changeset
46 #ifndef PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
47
a61af66fc99e Initial load
duke
parents:
diff changeset
48 ////////////////////////////////////////////////////////////////////////////
a61af66fc99e Initial load
duke
parents:
diff changeset
49 // Event
a61af66fc99e Initial load
duke
parents:
diff changeset
50
a61af66fc99e Initial load
duke
parents:
diff changeset
51 typedef u4 EventID;
a61af66fc99e Initial load
duke
parents:
diff changeset
52
a61af66fc99e Initial load
duke
parents:
diff changeset
53 class Event VALUE_OBJ_CLASS_SPEC {
a61af66fc99e Initial load
duke
parents:
diff changeset
54 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
55 jlong _time_tick;
a61af66fc99e Initial load
duke
parents:
diff changeset
56 intx _thread_id;
a61af66fc99e Initial load
duke
parents:
diff changeset
57 const char* _format;
a61af66fc99e Initial load
duke
parents:
diff changeset
58 int _indent;
a61af66fc99e Initial load
duke
parents:
diff changeset
59 intptr_t _arg_1;
a61af66fc99e Initial load
duke
parents:
diff changeset
60 intptr_t _arg_2;
a61af66fc99e Initial load
duke
parents:
diff changeset
61 intptr_t _arg_3;
a61af66fc99e Initial load
duke
parents:
diff changeset
62
a61af66fc99e Initial load
duke
parents:
diff changeset
63 // only EventBuffer::add_event() can assign event id
a61af66fc99e Initial load
duke
parents:
diff changeset
64 friend class EventBuffer;
a61af66fc99e Initial load
duke
parents:
diff changeset
65 EventID _id;
a61af66fc99e Initial load
duke
parents:
diff changeset
66
a61af66fc99e Initial load
duke
parents:
diff changeset
67 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
68
a61af66fc99e Initial load
duke
parents:
diff changeset
69 void clear() { _format = NULL; }
a61af66fc99e Initial load
duke
parents:
diff changeset
70
a61af66fc99e Initial load
duke
parents:
diff changeset
71 EventID id() const { return _id; }
a61af66fc99e Initial load
duke
parents:
diff changeset
72
a61af66fc99e Initial load
duke
parents:
diff changeset
73 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
74 _format = format;
a61af66fc99e Initial load
duke
parents:
diff changeset
75 _arg_1 = arg_1;
a61af66fc99e Initial load
duke
parents:
diff changeset
76 _arg_2 = arg_2;
a61af66fc99e Initial load
duke
parents:
diff changeset
77 _arg_3 = arg_3;
a61af66fc99e Initial load
duke
parents:
diff changeset
78
a61af66fc99e Initial load
duke
parents:
diff changeset
79 _indent = indent;
a61af66fc99e Initial load
duke
parents:
diff changeset
80
a61af66fc99e Initial load
duke
parents:
diff changeset
81 _thread_id = os::current_thread_id();
a61af66fc99e Initial load
duke
parents:
diff changeset
82 _time_tick = os::elapsed_counter();
a61af66fc99e Initial load
duke
parents:
diff changeset
83 }
a61af66fc99e Initial load
duke
parents:
diff changeset
84
a61af66fc99e Initial load
duke
parents:
diff changeset
85 void print_on(outputStream *st) {
a61af66fc99e Initial load
duke
parents:
diff changeset
86 if (_format == NULL) return;
a61af66fc99e Initial load
duke
parents:
diff changeset
87 st->print(" %d", _thread_id);
a61af66fc99e Initial load
duke
parents:
diff changeset
88 st->print(" %3.2g ", (double)_time_tick / os::elapsed_frequency());
a61af66fc99e Initial load
duke
parents:
diff changeset
89 st->fill_to(20);
a61af66fc99e Initial load
duke
parents:
diff changeset
90 for (int index = 0; index < _indent; index++) {
a61af66fc99e Initial load
duke
parents:
diff changeset
91 st->print("| ");
a61af66fc99e Initial load
duke
parents:
diff changeset
92 }
a61af66fc99e Initial load
duke
parents:
diff changeset
93 st->print_cr(_format, _arg_1, _arg_2, _arg_3);
a61af66fc99e Initial load
duke
parents:
diff changeset
94 }
a61af66fc99e Initial load
duke
parents:
diff changeset
95 };
a61af66fc99e Initial load
duke
parents:
diff changeset
96
a61af66fc99e Initial load
duke
parents:
diff changeset
97 ////////////////////////////////////////////////////////////////////////////
a61af66fc99e Initial load
duke
parents:
diff changeset
98 // EventBuffer
a61af66fc99e Initial load
duke
parents:
diff changeset
99 //
a61af66fc99e Initial load
duke
parents:
diff changeset
100 // Simple lock-free event queue. Every event has a unique 32-bit id.
a61af66fc99e Initial load
duke
parents:
diff changeset
101 // It's fine if two threads add events at the same time, because they
a61af66fc99e Initial load
duke
parents:
diff changeset
102 // will get different event id, and then write to different buffer location.
a61af66fc99e Initial load
duke
parents:
diff changeset
103 // However, it is assumed that add_event() is quick enough (or buffer size
a61af66fc99e Initial load
duke
parents:
diff changeset
104 // is big enough), so when one thread is adding event, there can't be more
a61af66fc99e Initial load
duke
parents:
diff changeset
105 // than "size" events created by other threads; otherwise we'll end up having
a61af66fc99e Initial load
duke
parents:
diff changeset
106 // two threads writing to the same location.
a61af66fc99e Initial load
duke
parents:
diff changeset
107
a61af66fc99e Initial load
duke
parents:
diff changeset
108 class EventBuffer : AllStatic {
a61af66fc99e Initial load
duke
parents:
diff changeset
109 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
110 static Event* buffer;
a61af66fc99e Initial load
duke
parents:
diff changeset
111 static int size;
a61af66fc99e Initial load
duke
parents:
diff changeset
112 static jint indent;
a61af66fc99e Initial load
duke
parents:
diff changeset
113 static volatile EventID _current_event_id;
a61af66fc99e Initial load
duke
parents:
diff changeset
114
a61af66fc99e Initial load
duke
parents:
diff changeset
115 static EventID get_next_event_id() {
a61af66fc99e Initial load
duke
parents:
diff changeset
116 return (EventID)Atomic::add(1, (jint*)&_current_event_id);
a61af66fc99e Initial load
duke
parents:
diff changeset
117 }
a61af66fc99e Initial load
duke
parents:
diff changeset
118
a61af66fc99e Initial load
duke
parents:
diff changeset
119 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
120 static void inc_indent() { Atomic::inc(&indent); }
a61af66fc99e Initial load
duke
parents:
diff changeset
121 static void dec_indent() { Atomic::dec(&indent); }
a61af66fc99e Initial load
duke
parents:
diff changeset
122
a61af66fc99e Initial load
duke
parents:
diff changeset
123 static bool get_event(EventID id, Event* event) {
a61af66fc99e Initial load
duke
parents:
diff changeset
124 int index = (int)(id % size);
a61af66fc99e Initial load
duke
parents:
diff changeset
125 if (buffer[index].id() == id) {
a61af66fc99e Initial load
duke
parents:
diff changeset
126 memcpy(event, &buffer[index], sizeof(Event));
a61af66fc99e Initial load
duke
parents:
diff changeset
127 // check id again; if buffer[index] is being updated by another thread,
a61af66fc99e Initial load
duke
parents:
diff changeset
128 // event->id() will contain different value.
a61af66fc99e Initial load
duke
parents:
diff changeset
129 return (event->id() == id);
a61af66fc99e Initial load
duke
parents:
diff changeset
130 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
131 // id does not match - id is invalid, or event is overwritten
a61af66fc99e Initial load
duke
parents:
diff changeset
132 return false;
a61af66fc99e Initial load
duke
parents:
diff changeset
133 }
a61af66fc99e Initial load
duke
parents:
diff changeset
134 }
a61af66fc99e Initial load
duke
parents:
diff changeset
135
a61af66fc99e Initial load
duke
parents:
diff changeset
136 // add a new event to the queue; if EventBuffer is full, this call will
a61af66fc99e Initial load
duke
parents:
diff changeset
137 // overwrite the oldest event in the queue
a61af66fc99e Initial load
duke
parents:
diff changeset
138 static EventID add_event(const char* format,
a61af66fc99e Initial load
duke
parents:
diff changeset
139 intptr_t arg_1, intptr_t arg_2, intptr_t arg_3) {
a61af66fc99e Initial load
duke
parents:
diff changeset
140 // assign a unique id
a61af66fc99e Initial load
duke
parents:
diff changeset
141 EventID id = get_next_event_id();
a61af66fc99e Initial load
duke
parents:
diff changeset
142
a61af66fc99e Initial load
duke
parents:
diff changeset
143 // event will be copied to buffer[index]
a61af66fc99e Initial load
duke
parents:
diff changeset
144 int index = (int)(id % size);
a61af66fc99e Initial load
duke
parents:
diff changeset
145
a61af66fc99e Initial load
duke
parents:
diff changeset
146 // first, invalidate id, buffer[index] can't have event with id = index + 2
a61af66fc99e Initial load
duke
parents:
diff changeset
147 buffer[index]._id = index + 2;
a61af66fc99e Initial load
duke
parents:
diff changeset
148
a61af66fc99e Initial load
duke
parents:
diff changeset
149 // make sure everyone has seen that buffer[index] is invalid
a61af66fc99e Initial load
duke
parents:
diff changeset
150 OrderAccess::fence();
a61af66fc99e Initial load
duke
parents:
diff changeset
151
a61af66fc99e Initial load
duke
parents:
diff changeset
152 // ... before updating its value
a61af66fc99e Initial load
duke
parents:
diff changeset
153 buffer[index].fill(indent, format, arg_1, arg_2, arg_3);
a61af66fc99e Initial load
duke
parents:
diff changeset
154
a61af66fc99e Initial load
duke
parents:
diff changeset
155 // finally, set up real event id, now buffer[index] contains valid event
a61af66fc99e Initial load
duke
parents:
diff changeset
156 OrderAccess::release_store(&(buffer[index]._id), id);
a61af66fc99e Initial load
duke
parents:
diff changeset
157
a61af66fc99e Initial load
duke
parents:
diff changeset
158 return id;
a61af66fc99e Initial load
duke
parents:
diff changeset
159 }
a61af66fc99e Initial load
duke
parents:
diff changeset
160
a61af66fc99e Initial load
duke
parents:
diff changeset
161 static void print_last(outputStream *st, int number) {
a61af66fc99e Initial load
duke
parents:
diff changeset
162 st->print_cr("[Last %d events in the event buffer]", number);
a61af66fc99e Initial load
duke
parents:
diff changeset
163 st->print_cr("-<thd>-<elapsed sec>-<description>---------------------");
a61af66fc99e Initial load
duke
parents:
diff changeset
164
a61af66fc99e Initial load
duke
parents:
diff changeset
165 int count = 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
166 EventID id = _current_event_id;
a61af66fc99e Initial load
duke
parents:
diff changeset
167 while (count < number) {
a61af66fc99e Initial load
duke
parents:
diff changeset
168 Event event;
a61af66fc99e Initial load
duke
parents:
diff changeset
169 if (get_event(id, &event)) {
a61af66fc99e Initial load
duke
parents:
diff changeset
170 event.print_on(st);
a61af66fc99e Initial load
duke
parents:
diff changeset
171 }
a61af66fc99e Initial load
duke
parents:
diff changeset
172 id--;
a61af66fc99e Initial load
duke
parents:
diff changeset
173 count++;
a61af66fc99e Initial load
duke
parents:
diff changeset
174 }
a61af66fc99e Initial load
duke
parents:
diff changeset
175 }
a61af66fc99e Initial load
duke
parents:
diff changeset
176
a61af66fc99e Initial load
duke
parents:
diff changeset
177 static void print_all(outputStream* st) {
a61af66fc99e Initial load
duke
parents:
diff changeset
178 print_last(st, size);
a61af66fc99e Initial load
duke
parents:
diff changeset
179 }
a61af66fc99e Initial load
duke
parents:
diff changeset
180
a61af66fc99e Initial load
duke
parents:
diff changeset
181 static void init() {
a61af66fc99e Initial load
duke
parents:
diff changeset
182 // Allocate the event buffer
a61af66fc99e Initial load
duke
parents:
diff changeset
183 size = EventLogLength;
a61af66fc99e Initial load
duke
parents:
diff changeset
184 buffer = NEW_C_HEAP_ARRAY(Event, size);
a61af66fc99e Initial load
duke
parents:
diff changeset
185
a61af66fc99e Initial load
duke
parents:
diff changeset
186 _current_event_id = 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
187
a61af66fc99e Initial load
duke
parents:
diff changeset
188 // Clear the event buffer
a61af66fc99e Initial load
duke
parents:
diff changeset
189 for (int index = 0; index < size; index++) {
a61af66fc99e Initial load
duke
parents:
diff changeset
190 buffer[index]._id = index + 1; // index + 1 is invalid id
a61af66fc99e Initial load
duke
parents:
diff changeset
191 buffer[index].clear();
a61af66fc99e Initial load
duke
parents:
diff changeset
192 }
a61af66fc99e Initial load
duke
parents:
diff changeset
193 }
a61af66fc99e Initial load
duke
parents:
diff changeset
194 };
a61af66fc99e Initial load
duke
parents:
diff changeset
195
a61af66fc99e Initial load
duke
parents:
diff changeset
196 Event* EventBuffer::buffer;
a61af66fc99e Initial load
duke
parents:
diff changeset
197 int EventBuffer::size;
a61af66fc99e Initial load
duke
parents:
diff changeset
198 volatile EventID EventBuffer::_current_event_id;
a61af66fc99e Initial load
duke
parents:
diff changeset
199 int EventBuffer::indent;
a61af66fc99e Initial load
duke
parents:
diff changeset
200
a61af66fc99e Initial load
duke
parents:
diff changeset
201 ////////////////////////////////////////////////////////////////////////////
a61af66fc99e Initial load
duke
parents:
diff changeset
202 // Events
a61af66fc99e Initial load
duke
parents:
diff changeset
203
a61af66fc99e Initial load
duke
parents:
diff changeset
204 // Events::log() is safe for signal handlers
a61af66fc99e Initial load
duke
parents:
diff changeset
205 void Events::log(const char* format, ...) {
a61af66fc99e Initial load
duke
parents:
diff changeset
206 if (LogEvents) {
a61af66fc99e Initial load
duke
parents:
diff changeset
207 va_list ap;
a61af66fc99e Initial load
duke
parents:
diff changeset
208 va_start(ap, format);
a61af66fc99e Initial load
duke
parents:
diff changeset
209 intptr_t arg_1 = va_arg(ap, intptr_t);
a61af66fc99e Initial load
duke
parents:
diff changeset
210 intptr_t arg_2 = va_arg(ap, intptr_t);
a61af66fc99e Initial load
duke
parents:
diff changeset
211 intptr_t arg_3 = va_arg(ap, intptr_t);
a61af66fc99e Initial load
duke
parents:
diff changeset
212 va_end(ap);
a61af66fc99e Initial load
duke
parents:
diff changeset
213
a61af66fc99e Initial load
duke
parents:
diff changeset
214 EventBuffer::add_event(format, arg_1, arg_2, arg_3);
a61af66fc99e Initial load
duke
parents:
diff changeset
215 }
a61af66fc99e Initial load
duke
parents:
diff changeset
216 }
a61af66fc99e Initial load
duke
parents:
diff changeset
217
a61af66fc99e Initial load
duke
parents:
diff changeset
218 void Events::print_all(outputStream *st) {
a61af66fc99e Initial load
duke
parents:
diff changeset
219 EventBuffer::print_all(st);
a61af66fc99e Initial load
duke
parents:
diff changeset
220 }
a61af66fc99e Initial load
duke
parents:
diff changeset
221
a61af66fc99e Initial load
duke
parents:
diff changeset
222 void Events::print_last(outputStream *st, int number) {
a61af66fc99e Initial load
duke
parents:
diff changeset
223 EventBuffer::print_last(st, number);
a61af66fc99e Initial load
duke
parents:
diff changeset
224 }
a61af66fc99e Initial load
duke
parents:
diff changeset
225
a61af66fc99e Initial load
duke
parents:
diff changeset
226 ///////////////////////////////////////////////////////////////////////////
a61af66fc99e Initial load
duke
parents:
diff changeset
227 // EventMark
a61af66fc99e Initial load
duke
parents:
diff changeset
228
a61af66fc99e Initial load
duke
parents:
diff changeset
229 EventMark::EventMark(const char* format, ...) {
a61af66fc99e Initial load
duke
parents:
diff changeset
230 if (LogEvents) {
a61af66fc99e Initial load
duke
parents:
diff changeset
231 va_list ap;
a61af66fc99e Initial load
duke
parents:
diff changeset
232 va_start(ap, format);
a61af66fc99e Initial load
duke
parents:
diff changeset
233 intptr_t arg_1 = va_arg(ap, intptr_t);
a61af66fc99e Initial load
duke
parents:
diff changeset
234 intptr_t arg_2 = va_arg(ap, intptr_t);
a61af66fc99e Initial load
duke
parents:
diff changeset
235 intptr_t arg_3 = va_arg(ap, intptr_t);
a61af66fc99e Initial load
duke
parents:
diff changeset
236 va_end(ap);
a61af66fc99e Initial load
duke
parents:
diff changeset
237
a61af66fc99e Initial load
duke
parents:
diff changeset
238 EventBuffer::add_event(format, arg_1, arg_2, arg_3);
a61af66fc99e Initial load
duke
parents:
diff changeset
239 EventBuffer::inc_indent();
a61af66fc99e Initial load
duke
parents:
diff changeset
240 }
a61af66fc99e Initial load
duke
parents:
diff changeset
241 }
a61af66fc99e Initial load
duke
parents:
diff changeset
242
a61af66fc99e Initial load
duke
parents:
diff changeset
243 EventMark::~EventMark() {
a61af66fc99e Initial load
duke
parents:
diff changeset
244 if (LogEvents) {
a61af66fc99e Initial load
duke
parents:
diff changeset
245 EventBuffer::dec_indent();
a61af66fc99e Initial load
duke
parents:
diff changeset
246 EventBuffer::add_event("done", 0, 0, 0);
a61af66fc99e Initial load
duke
parents:
diff changeset
247 }
a61af66fc99e Initial load
duke
parents:
diff changeset
248 }
a61af66fc99e Initial load
duke
parents:
diff changeset
249
a61af66fc99e Initial load
duke
parents:
diff changeset
250 ///////////////////////////////////////////////////////////////////////////
a61af66fc99e Initial load
duke
parents:
diff changeset
251
a61af66fc99e Initial load
duke
parents:
diff changeset
252 void eventlog_init() {
a61af66fc99e Initial load
duke
parents:
diff changeset
253 EventBuffer::init();
a61af66fc99e Initial load
duke
parents:
diff changeset
254 }
a61af66fc99e Initial load
duke
parents:
diff changeset
255
a61af66fc99e Initial load
duke
parents:
diff changeset
256 int print_all_events(outputStream *st) {
a61af66fc99e Initial load
duke
parents:
diff changeset
257 EventBuffer::print_all(st);
a61af66fc99e Initial load
duke
parents:
diff changeset
258 return 1;
a61af66fc99e Initial load
duke
parents:
diff changeset
259 }
a61af66fc99e Initial load
duke
parents:
diff changeset
260
a61af66fc99e Initial load
duke
parents:
diff changeset
261 #else
a61af66fc99e Initial load
duke
parents:
diff changeset
262
a61af66fc99e Initial load
duke
parents:
diff changeset
263 void eventlog_init() {}
a61af66fc99e Initial load
duke
parents:
diff changeset
264 int print_all_events(outputStream *st) { return 0; }
a61af66fc99e Initial load
duke
parents:
diff changeset
265
a61af66fc99e Initial load
duke
parents:
diff changeset
266 #endif // PRODUCT