Mercurial > hg > truffle
annotate src/share/vm/utilities/events.hpp @ 3678:9482471a7dfa
IdealGraphVisualizer: add a workaround to fix layouting of the QuickSearch combobar with the GTK look and feel
author | Peter Hofer <peter.hofer@jku.at> |
---|---|
date | Mon, 21 Nov 2011 15:54:32 +0100 |
parents | f95d63e2154a |
children | aa3d708d67c4 |
rev | line source |
---|---|
0 | 1 /* |
1972 | 2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. |
0 | 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 * | |
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 | 22 * |
23 */ | |
24 | |
1972 | 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 | |
0 | 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); | |
1972 | 71 |
72 #endif // SHARE_VM_UTILITIES_EVENTS_HPP |