|
From: <sv...@va...> - 2015-05-14 21:05:56
|
Author: philippe
Date: Thu May 14 22:05:49 2015
New Revision: 15231
Log:
Add the lwpid in the scheduler status information
E.g. we now have:
Thread 1: status = VgTs_Runnable (lwpid 15782)
==15782== at 0x8048EB5: main (sleepers.c:188)
client stack range: [0xBE836000 0xBE839FFF] client SP: 0xBE838F80
valgrind stack top usage: 10264 of 1048576
Thread 2: status = VgTs_WaitSys (lwpid 15828)
==15782== at 0x2E9451: ??? (syscall-template.S:82)
==15782== by 0x8048AD3: sleeper_or_burner (sleepers.c:84)
==15782== by 0x39B924: start_thread (pthread_create.c:297)
==15782== by 0x2F107D: clone (clone.S:130)
client stack range: [0x442F000 0x4E2EFFF] client SP: 0x4E2E338
valgrind stack top usage: 2288 of 1048576
This allows to attach with GDB to the good lwpid in case
you want to examine the valgrind state rather than the guest state.
(it is needed to attach to the specific lwpid as valgrind is not
linked with lib pthread, so GDB cannot discover the threads
of the process).
Modified:
trunk/coregrind/m_libcassert.c
Modified: trunk/coregrind/m_libcassert.c
==============================================================================
--- trunk/coregrind/m_libcassert.c (original)
+++ trunk/coregrind/m_libcassert.c Thu May 14 22:05:49 2015
@@ -369,8 +369,9 @@
has exited, then valgrind_stack_base points to the stack base. */
if (VG_(threads)[i].status == VgTs_Empty
&& (!exited_threads || stack == 0)) continue;
- VG_(printf)("\nThread %d: status = %s\n", i,
- VG_(name_of_ThreadStatus)(VG_(threads)[i].status) );
+ VG_(printf)("\nThread %d: status = %s (lwpid %d)\n", i,
+ VG_(name_of_ThreadStatus)(VG_(threads)[i].status),
+ VG_(threads)[i].os_state.lwpid);
if (VG_(threads)[i].status != VgTs_Empty)
VG_(get_and_pp_StackTrace)( i, BACKTRACE_DEPTH );
if (stack_usage && VG_(threads)[i].client_stack_highest_byte != 0 ) {
@@ -388,8 +389,8 @@
if (stack_usage && stack != 0)
VG_(printf)("valgrind stack top usage: %ld of %ld\n",
VG_(clo_valgrind_stacksize)
- - VG_(am_get_VgStack_unused_szB)(stack,
- VG_(clo_valgrind_stacksize)),
+ - VG_(am_get_VgStack_unused_szB)
+ (stack, VG_(clo_valgrind_stacksize)),
(SizeT) VG_(clo_valgrind_stacksize));
}
VG_(printf)("\n");
|