From 7ff19694dfef947bf65dbd15ec6497acefae39aa Mon Sep 17 00:00:00 2001 From: Thomas Stuefe Date: Mon, 1 Aug 2022 08:03:52 +0000 Subject: [PATCH] 8290067: Show stack dimensions in UL logging when attaching threads Reviewed-by: dholmes, mbaesken --- src/hotspot/os/aix/os_aix.cpp | 6 ++++-- src/hotspot/os/bsd/os_bsd.cpp | 7 ++++--- src/hotspot/os/linux/os_linux.cpp | 6 ++++-- src/hotspot/os/windows/os_windows.cpp | 6 ++++-- 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/hotspot/os/aix/os_aix.cpp b/src/hotspot/os/aix/os_aix.cpp index 935e4b96800..fb19b873363 100644 --- a/src/hotspot/os/aix/os_aix.cpp +++ b/src/hotspot/os/aix/os_aix.cpp @@ -889,8 +889,10 @@ bool os::create_attached_thread(JavaThread* thread) { // and save the caller's signal mask PosixSignals::hotspot_sigmask(thread); - log_info(os, thread)("Thread attached (tid: " UINTX_FORMAT ", kernel thread id: " UINTX_FORMAT ").", - os::current_thread_id(), (uintx) kernel_thread_id); + log_info(os, thread)("Thread attached (tid: " UINTX_FORMAT ", kernel thread id: " UINTX_FORMAT + ", stack: " PTR_FORMAT " - " PTR_FORMAT " (" SIZE_FORMAT "k) ).", + os::current_thread_id(), (uintx) kernel_thread_id, + p2i(thread->stack_base()), p2i(thread->stack_end()), thread->stack_size()); return true; } diff --git a/src/hotspot/os/bsd/os_bsd.cpp b/src/hotspot/os/bsd/os_bsd.cpp index e3dd839ab88..ab999ae4646 100644 --- a/src/hotspot/os/bsd/os_bsd.cpp +++ b/src/hotspot/os/bsd/os_bsd.cpp @@ -710,9 +710,10 @@ bool os::create_attached_thread(JavaThread* thread) { // and save the caller's signal mask PosixSignals::hotspot_sigmask(thread); - log_info(os, thread)("Thread attached (tid: " UINTX_FORMAT ", pthread id: " UINTX_FORMAT ").", - os::current_thread_id(), (uintx) pthread_self()); - + log_info(os, thread)("Thread attached (tid: " UINTX_FORMAT ", pthread id: " UINTX_FORMAT + ", stack: " PTR_FORMAT " - " PTR_FORMAT " (" SIZE_FORMAT "k) ).", + os::current_thread_id(), (uintx) pthread_self(), + p2i(thread->stack_base()), p2i(thread->stack_end()), thread->stack_size()); return true; } diff --git a/src/hotspot/os/linux/os_linux.cpp b/src/hotspot/os/linux/os_linux.cpp index 1bfcf55017c..fd57b303881 100644 --- a/src/hotspot/os/linux/os_linux.cpp +++ b/src/hotspot/os/linux/os_linux.cpp @@ -966,8 +966,10 @@ bool os::create_attached_thread(JavaThread* thread) { // and save the caller's signal mask PosixSignals::hotspot_sigmask(thread); - log_info(os, thread)("Thread attached (tid: " UINTX_FORMAT ", pthread id: " UINTX_FORMAT ").", - os::current_thread_id(), (uintx) pthread_self()); + log_info(os, thread)("Thread attached (tid: " UINTX_FORMAT ", pthread id: " UINTX_FORMAT + ", stack: " PTR_FORMAT " - " PTR_FORMAT " (" SIZE_FORMAT "k) ).", + os::current_thread_id(), (uintx) pthread_self(), + p2i(thread->stack_base()), p2i(thread->stack_end()), thread->stack_size()); return true; } diff --git a/src/hotspot/os/windows/os_windows.cpp b/src/hotspot/os/windows/os_windows.cpp index 979dada6053..c50e0796466 100644 --- a/src/hotspot/os/windows/os_windows.cpp +++ b/src/hotspot/os/windows/os_windows.cpp @@ -615,8 +615,10 @@ bool os::create_attached_thread(JavaThread* thread) { thread->set_osthread(osthread); - log_info(os, thread)("Thread attached (tid: " UINTX_FORMAT ").", - os::current_thread_id()); + log_info(os, thread)("Thread attached (tid: " UINTX_FORMAT ", stack: " + PTR_FORMAT " - " PTR_FORMAT " (" SIZE_FORMAT "k) ).", + os::current_thread_id(), p2i(thread->stack_base()), + p2i(thread->stack_end()), thread->stack_size()); return true; }