RFR (S) 8001538: hs_err file does not list anymore compiled methods in compilation events
Christian Thalinger
christian.thalinger at oracle.com
Tue Nov 13 11:00:09 PST 2012
On Nov 13, 2012, at 10:43 AM, Christian Thalinger <christian.thalinger at oracle.com> wrote:
>
> On Nov 13, 2012, at 7:53 AM, Vladimir Ivanov <vladimir.x.ivanov at oracle.com> wrote:
>
>> http://cr.openjdk.java.net/~vlivanov/8001538/webrev.00/
>>
>> Due to incorrect message buffer size calculation, a message may be truncated to 4/8 characters.
>>
>> Also, changed how deoptimization events are logged:
>> - moved [1] from "Deoptimization events" to "Events" section.
>> - added [2] to "Deoptimization events" section
>>
>> Sample output from a hs_err file:
>> Deoptimization events (2 events):
>> Event: 3.438 Thread 0x0000000103804800 Uncommon trap: Test::f @ 23, reason: unloaded, action: reinterpret
>> Event: 3.482 Thread 0x0000000103804800 Uncommon trap: Test::main @ 38, reason: unloaded, action: reinterpret
>>
>> Internal exceptions (10 events):
>> ...
>>
>> Events (10 events):
>> Event: 3.441 Thread 0x0000000103804800 DEOPT UNPACKING pc=0x00000001046cf214 sp=0x0000000100700548 mode 2
>> Event: 3.482 Thread 0x0000000103804800 Uncommon trap 3 fr.pc 0x00000001046ffe1c
>> ...
>
> I have similar change in one of my workspaces:
>
> diff --git a/src/share/vm/runtime/deoptimization.cpp b/src/share/vm/runtime/deoptimization.cpp
> --- a/src/share/vm/runtime/deoptimization.cpp
> +++ b/src/share/vm/runtime/deoptimization.cpp
> @@ -1241,10 +1241,6 @@
> // before we are done with it.
> nmethodLocker nl(fr.pc());
>
> - // Log a message
> - Events::log_deopt_message(thread, "Uncommon trap %d fr.pc " INTPTR_FORMAT,
> - trap_request, fr.pc());
> -
> {
> ResourceMark rm;
>
> @@ -1265,6 +1261,11 @@
> int trap_bci = trap_scope->bci();
> Bytecodes::Code trap_bc = trap_method->java_code_at(trap_bci);
>
> + // Log a message
> + Events::log_deopt_message(thread, "Uncommon trap: reason=%s action=%s pc=" INTPTR_FORMAT " method=%s @ %d",
> + trap_reason_name(reason), trap_action_name(action), fr.pc(),
> + trap_method->name_and_sig_as_C_string(), trap_bci);
> +
> // Record this event in the histogram.
> gather_statistics(reason, action, trap_bc);
>
> Maybe you can merge them. Btw. I find the PC also very helpful in the log_deopt_message.
Oh, and this to have enough space in the event log buffer for method names:
diff --git a/src/share/vm/utilities/events.hpp b/src/share/vm/utilities/events.hpp
--- a/src/share/vm/utilities/events.hpp
+++ b/src/share/vm/utilities/events.hpp
@@ -135,7 +135,7 @@
};
// A simple wrapper class for fixed size text messages.
-class StringLogMessage : public FormatBuffer<132> {
+class StringLogMessage : public FormatBuffer<256> {
public:
// Wrap this buffer in a stringStream.
stringStream stream() {
-- Chris
>
> -- Chris
>
>>
>> Testing: JPRT, simple test w/ deopt events in the log.
>>
>> Best regards,
>> Vladimir Ivanov
>>
>> [1] Uncommon trap 3 fr.pc 0x00000001046ffe1c
>> [2] Uncommon trap: Test::f @ 23, reason=unloaded action=reinterpret
>
More information about the hotspot-compiler-dev
mailing list