Mercurial > hg > graal-compiler
comparison src/share/vm/runtime/vm_operations.cpp @ 10405:f2110083203d
8005849: JEP 167: Event-Based JVM Tracing
Reviewed-by: acorn, coleenp, sla
Contributed-by: Karen Kinnear <karen.kinnear@oracle.com>, Bengt Rutisson <bengt.rutisson@oracle.com>, Calvin Cheung <calvin.cheung@oracle.com>, Erik Gahlin <erik.gahlin@oracle.com>, Erik Helin <erik.helin@oracle.com>, Jesper Wilhelmsson <jesper.wilhelmsson@oracle.com>, Keith McGuigan <keith.mcguigan@oracle.com>, Mattias Tobiasson <mattias.tobiasson@oracle.com>, Markus Gronlund <markus.gronlund@oracle.com>, Mikael Auno <mikael.auno@oracle.com>, Nils Eliasson <nils.eliasson@oracle.com>, Nils Loodin <nils.loodin@oracle.com>, Rickard Backman <rickard.backman@oracle.com>, Staffan Larsen <staffan.larsen@oracle.com>, Stefan Karlsson <stefan.karlsson@oracle.com>, Yekaterina Kantserova <yekaterina.kantserova@oracle.com>
author | sla |
---|---|
date | Mon, 10 Jun 2013 11:30:51 +0200 |
parents | 68fe50d4f1d5 |
children | 836a62f43af9 510fbd28919c |
comparison
equal
deleted
inserted
replaced
10404:d0add7016434 | 10405:f2110083203d |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | 4 * |
5 * This code is free software; you can redistribute it and/or modify it | 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 | 6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
35 #include "runtime/interfaceSupport.hpp" | 35 #include "runtime/interfaceSupport.hpp" |
36 #include "runtime/sweeper.hpp" | 36 #include "runtime/sweeper.hpp" |
37 #include "runtime/thread.inline.hpp" | 37 #include "runtime/thread.inline.hpp" |
38 #include "runtime/vm_operations.hpp" | 38 #include "runtime/vm_operations.hpp" |
39 #include "services/threadService.hpp" | 39 #include "services/threadService.hpp" |
40 #include "trace/tracing.hpp" | |
40 | 41 |
41 #define VM_OP_NAME_INITIALIZE(name) #name, | 42 #define VM_OP_NAME_INITIALIZE(name) #name, |
42 | 43 |
43 const char* VM_Operation::_names[VM_Operation::VMOp_Terminating] = \ | 44 const char* VM_Operation::_names[VM_Operation::VMOp_Terminating] = \ |
44 { VM_OPS_DO(VM_OP_NAME_INITIALIZE) }; | 45 { VM_OPS_DO(VM_OP_NAME_INITIALIZE) }; |
60 if (TraceVMOperation) { | 61 if (TraceVMOperation) { |
61 tty->print_cr("]"); | 62 tty->print_cr("]"); |
62 } | 63 } |
63 } | 64 } |
64 | 65 |
66 const char* VM_Operation::mode_to_string(Mode mode) { | |
67 switch(mode) { | |
68 case _safepoint : return "safepoint"; | |
69 case _no_safepoint : return "no safepoint"; | |
70 case _concurrent : return "concurrent"; | |
71 case _async_safepoint: return "async safepoint"; | |
72 default : return "unknown"; | |
73 } | |
74 } | |
65 // Called by fatal error handler. | 75 // Called by fatal error handler. |
66 void VM_Operation::print_on_error(outputStream* st) const { | 76 void VM_Operation::print_on_error(outputStream* st) const { |
67 st->print("VM_Operation (" PTR_FORMAT "): ", this); | 77 st->print("VM_Operation (" PTR_FORMAT "): ", this); |
68 st->print("%s", name()); | 78 st->print("%s", name()); |
69 | 79 |
70 const char* mode; | 80 const char* mode = mode_to_string(evaluation_mode()); |
71 switch(evaluation_mode()) { | |
72 case _safepoint : mode = "safepoint"; break; | |
73 case _no_safepoint : mode = "no safepoint"; break; | |
74 case _concurrent : mode = "concurrent"; break; | |
75 case _async_safepoint: mode = "async safepoint"; break; | |
76 default : mode = "unknown"; break; | |
77 } | |
78 st->print(", mode: %s", mode); | 81 st->print(", mode: %s", mode); |
79 | 82 |
80 if (calling_thread()) { | 83 if (calling_thread()) { |
81 st->print(", requested by thread " PTR_FORMAT, calling_thread()); | 84 st->print(", requested by thread " PTR_FORMAT, calling_thread()); |
82 } | 85 } |