Include non-attached native threads in the SIGQUIT output.
These threads look something like this:
"droid.phasebeam' prio=5 tid=? (not attached)
| sysTid=5369 nice=-4 sched=0/0 cgrp=default
| schedstat=( 0 0 0 ) utm=1 stm=8 core=0 HZ=100
native: __futex_syscall3+8 [0x40074678] (libc.so)
native: __pthread_cond_timedwait_relative+48 [0x40079474] (libc.so)
native: __pthread_cond_timedwait+72 [0x40079528] (libc.so)
native: android::renderscript::Signal::wait(unsigned long long)+58 [0x418bf117] (libRS.so)
native: android::renderscript::LocklessCommandFifo::wait(unsigned long long)+38 [0x418bab97] (libRS.so)
native: android::renderscript::LocklessCommandFifo::get(unsigned int*, unsigned int*, unsigned long long)+22 [0x418babbb] (libRS.so)
native: android::renderscript::ThreadIO::playCoreCommands(android::renderscript::Context*, bool, unsigned long long)+126 [0x418bf84b] (libRS.so)
native: android::renderscript::Context::threadProc(void*)+382 [0x418b7347] (libRS.so)
native: __thread_entry+48 [0x40079d30] (libc.so)
native: pthread_create+180 [0x40079884] (libc.so)
Also fix running tests on Mac OS, which has no /proc/self/cmdline.
Change-Id: Ib5e6f7e23dd45aecdf814e84f573361a5d91bac6
diff --git a/src/thread.h b/src/thread.h
index f51b581..7d885c0 100644
--- a/src/thread.h
+++ b/src/thread.h
@@ -129,6 +129,10 @@
// When full == false, dumps a one-line summary of thread state (used for operator<<).
void Dump(std::ostream& os, bool full = true) const;
+ // Dumps the SIGQUIT per-thread header. 'thread' can be NULL for a non-attached thread, in which
+ // case we use 'tid' to identify the thread, and we'll include as much information as we can.
+ static void DumpState(std::ostream& os, const Thread* thread, pid_t tid);
+
ThreadState GetState() const {
return state_;
}