where the threads gets exited

Submitted by sounak
on January 17, 2005 - 7:01am

dear sir
i want to know in which files / functions are called last when a thread(it is user as well as kernel) gets exited
exactly i want all information about the threads which are about to be exited.So in which function i will put my printk so that i get the threads id of the threads that are going to be exited by the user or by the system.
e.g is it in do_exit in exit.c or in any other file/function
thanks in advance
sounak