added code to trace all threads.