[Crash-utility] Retrieve pointer value for scripting

Patrick Agrain patrick.agrain at alcatel-lucent.com
Fri Dec 6 09:02:43 UTC 2013


Hello,

We wish to call 'crash' with a script file to automate some basic 
command and output the result on a text file.

This works perfectly for basic commands such as bt, log, mod and so on, 
especially when no input data is required.

We try now to dump the kernel stack through a 'rd <@> <size>'.
My problem is to "extract" this <@> and to "input" it in this 'rd' command.

For the moment, I'm able to get the task_struct * with following command :
ps | grep '>' | awk '{ print $5 };'

 From that, the pointer of the thread_info would be available through 
(task_struct *)->stack.

But how to get all these together to finally ouptut a valid 'rd' command ?
Meaby another way to get this kernel stack dump would exist ?

Any help would be appreciate.
Regards,
Patrick Agrain




More information about the Crash-utility mailing list