[Crash-utility] How to use scripts in crash?

Bruce Korb bruce.korb at gmail.com
Wed Mar 7 16:25:03 UTC 2012


On Wed, Mar 7, 2012 at 8:08 AM, Dave Anderson <anderson at redhat.com> wrote:
>> I also notice there is "sial" script support in crash, but that is
>> too complex for me... I don't know how to start a basic usage with
>> that... Is there any detailed doc that could help me from a start?
>>
>> Thanks,
>> Lei
>
> I can't help you with sial usage, but there is a ~1000-page README
> file in crash-6.0.4/extensions/libsial.  And perhaps the sample
> ps.c and files.c sial scripts from the crash extensions page could
> be used as templates for your requirements.

There's also pykdump, if you don't mind python.  It is rigged up to be
able to call back into crash, which sial is not.  It also has better facilities
for coping with compile time structure variations.  So if you need to learn
a new language anyway (sial being a new language as it is not C),
it may as well be python.

Alternatively, you can also write shell scripts that emit crash commands
into a file that, when sourced, does a bunch of crash commands before
re-invoking itself.  I finally did that since there is no provision for scripts
to feed commands back to crash directly.  It works.  It's tricky.  Attached
is an example that will do approximate "bt"s on threads that were caught
"on proc" at the time of a crash.  It's my template.

Cheers - Bruce
-------------- next part --------------
A non-text attachment was scrubbed...
Name: live-bt
Type: application/octet-stream
Size: 1335 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/crash-utility/attachments/20120307/23af2b97/attachment.obj>


More information about the Crash-utility mailing list