printing call stack of user thread
Is there any way to print the user stack of the thread which is getting killed ? What i\I want to do is following:
1. Send a Kill signal to a thread running in user space
2. Catch the signal in kernel in signal.c and print the call stack of the thread (not the signal stack ).
My intention is to see what the user thread was doing when it received the signal.
If anyone can help, please let me know. Thanks in advance
pstack to print process stak
You can use following command in your code to print stack trace of process
You can create string pstack <pid>.
for getting pid of current process used getpid system call.