<div dir="ltr">Hi Patrick,<br><br>You can use the combination of foreach, awk and cut commands to get the <br>desired results. <br> <br>Eg:<br>crash> foreach RU task|grep " stack =" |awk '{print $3}'|cut -f1 -d"," |awk '{print "rd "$1 " " 3 }' > rd_stack_number<br>
<br>crash> rd 0xffffffff81a00000 3<br>ffffffff81a00000:  ffffffff81a8d020 ffffffff81a9a8a0    ...............<br>ffffffff81a00010:  0000000400000000                    ........<br>crash> rd 0xffff88106961e000 3<br>ffff88106961e000:  ffff884069dd8040 ffffffff81a9a8a0   @..i@...........<br>
ffff88106961e010:  0000000400000000                    ........<br><br>The above example is some what similar to the Louis example.<br><br>-- BKS<br><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 6 December 2013 14:32, Patrick Agrain <span dir="ltr"><<a href="mailto:patrick.agrain@alcatel-lucent.com" target="_blank">patrick.agrain@alcatel-lucent.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
We wish to call 'crash' with a script file to automate some basic command and output the result on a text file.<br>
<br>
This works perfectly for basic commands such as bt, log, mod and so on, especially when no input data is required.<br>
<br>
We try now to dump the kernel stack through a 'rd <@> <size>'.<br>
My problem is to "extract" this <@> and to "input" it in this 'rd' command.<br>
<br>
For the moment, I'm able to get the task_struct * with following command :<br>
ps | grep '>' | awk '{ print $5 };'<br>
<br>
>From that, the pointer of the thread_info would be available through (task_struct *)->stack.<br>
<br>
But how to get all these together to finally ouptut a valid 'rd' command ?<br>
Meaby another way to get this kernel stack dump would exist ?<br>
<br>
Any help would be appreciate.<br>
Regards,<br>
Patrick Agrain<br>
<br>
--<br>
Crash-utility mailing list<br>
<a href="mailto:Crash-utility@redhat.com" target="_blank">Crash-utility@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/crash-utility" target="_blank">https://www.redhat.com/<u></u>mailman/listinfo/crash-utility</a><br>
</blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr">BKS<br></div>
</div>