author | jrose |
Sat, 09 Apr 2011 21:16:12 -0700 | |
changeset 9124 | f60dee480d49 |
parent 7397 | 5b173b4ca846 |
child 11636 | 3c07b54482a5 |
permissions | -rw-r--r-- |
1 | 1 |
/* |
7397 | 2 |
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. |
1 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. |
|
8 |
* |
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
* accompanied this code). |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License version |
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 |
* |
|
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1
diff
changeset
|
21 |
* questions. |
1 | 22 |
* |
23 |
*/ |
|
24 |
||
7397 | 25 |
#ifndef SHARE_VM_UTILITIES_EVENTS_HPP |
26 |
#define SHARE_VM_UTILITIES_EVENTS_HPP |
|
27 |
||
28 |
#include "memory/allocation.hpp" |
|
29 |
#include "utilities/top.hpp" |
|
30 |
||
1 | 31 |
// Events and EventMark provide interfaces to log events taking place in the vm. |
32 |
// This facility is extremly useful for post-mortem debugging. The eventlog |
|
33 |
// often provides crucial information about events leading up to the crash. |
|
34 |
// |
|
35 |
// All arguments past the format string must be passed as an intptr_t. |
|
36 |
// |
|
37 |
// To log a single event use: |
|
38 |
// Events::log("New nmethod has been created " INTPTR_FORMAT, nm); |
|
39 |
// |
|
40 |
// To log a block of events use: |
|
41 |
// EventMark m("GarbageCollecting %d", (intptr_t)gc_number); |
|
42 |
// |
|
43 |
// The constructor to eventlog indents the eventlog until the |
|
44 |
// destructor has been executed. |
|
45 |
// |
|
46 |
// IMPLEMENTATION RESTRICTION: |
|
47 |
// Max 3 arguments are saved for each logged event. |
|
48 |
// |
|
49 |
||
50 |
class Events : AllStatic { |
|
51 |
public: |
|
52 |
// Logs an event, format as printf |
|
53 |
static void log(const char* format, ...) PRODUCT_RETURN; |
|
54 |
||
55 |
// Prints all events in the buffer |
|
56 |
static void print_all(outputStream* st) PRODUCT_RETURN; |
|
57 |
||
58 |
// Prints last number events from the event buffer |
|
59 |
static void print_last(outputStream *st, int number) PRODUCT_RETURN; |
|
60 |
}; |
|
61 |
||
62 |
class EventMark : public StackObj { |
|
63 |
public: |
|
64 |
// log a begin event, format as printf |
|
65 |
EventMark(const char* format, ...) PRODUCT_RETURN; |
|
66 |
// log an end event |
|
67 |
~EventMark() PRODUCT_RETURN; |
|
68 |
}; |
|
69 |
||
70 |
int print_all_events(outputStream *st); |
|
7397 | 71 |
|
72 |
#endif // SHARE_VM_UTILITIES_EVENTS_HPP |