< prev index next >

src/os/solaris/vm/os_solaris.cpp

Print this page
rev 10257 : 8149036: Add tracing for thread related events at os level
Reviewed-by: coleenp, mlarsson

*** 30,39 **** --- 30,40 ---- #include "code/vtableStubs.hpp" #include "compiler/compileBroker.hpp" #include "compiler/disassembler.hpp" #include "interpreter/interpreter.hpp" #include "jvm_solaris.h" + #include "logging/log.hpp" #include "memory/allocation.inline.hpp" #include "memory/filemap.hpp" #include "mutex_solaris.inline.hpp" #include "oops/oop.inline.hpp" #include "os_share_solaris.hpp"
*** 734,743 **** --- 735,747 ---- OSThread* osthr = thread->osthread(); osthr->set_lwp_id(_lwp_self()); // Store lwp in case we are bound thread->_schedctl = (void *) schedctl_init(); + log_debug(os, thread)("Thread is alive (tid: " UINTX_FORMAT ").", + os::current_thread_id()); + if (UseNUMA) { int lgrp_id = os::numa_get_group_id(); if (lgrp_id != -1) { thread->set_lgrp_id(lgrp_id); }
*** 779,788 **** --- 783,794 ---- // which frees the CodeHeap containing the Atomic::dec code if (thread != VMThread::vm_thread() && VMThread::vm_thread() != NULL) { Atomic::dec(&os::Solaris::_os_thread_count); } + log_debug(os, thread)("Thread finished (tid: " UINTX_FORMAT ").", os::current_thread_id()); + if (UseDetachedThreads) { thr_exit(NULL); ShouldNotReachHere(); } return NULL;
*** 851,860 **** --- 857,869 ---- // initialize signal mask for this thread // and save the caller's signal mask os::Solaris::hotspot_sigmask(thread); + log_debug(os, thread)("Thread attached (tid: " UINTX_FORMAT ").", + os::current_thread_id()); + return true; } bool os::create_main_thread(JavaThread* thread) { #ifdef ASSERT
*** 973,989 **** osthread->set_lwp_id(-1); osthread->set_thread_id(-1); status = thr_create(NULL, stack_size, java_start, thread, flags, &tid); if (status != 0) { ! if (PrintMiscellaneous && (Verbose || WizardMode)) { ! perror("os::create_thread"); ! } thread->set_osthread(NULL); // Need to clean up stuff we've allocated so far delete osthread; return false; } Atomic::inc(&os::Solaris::_os_thread_count); // Store info on the Solaris thread into the OSThread --- 982,999 ---- osthread->set_lwp_id(-1); osthread->set_thread_id(-1); status = thr_create(NULL, stack_size, java_start, thread, flags, &tid); if (status != 0) { ! log_warning(os, thread)("Failed to start thread - thr_create failed (%s)", ! strerror(status)); thread->set_osthread(NULL); // Need to clean up stuff we've allocated so far delete osthread; return false; + } else { + log_debug(os, thread)("Thread started (tid: " UINTX_FORMAT ").", (uintx) tid); } Atomic::inc(&os::Solaris::_os_thread_count); // Store info on the Solaris thread into the OSThread
< prev index next >