Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Crash Utility (http://www.linux-archive.org/crash-utility/)
-   -   How to use scripts in crash? (http://www.linux-archive.org/crash-utility/641925-how-use-scripts-crash.html)

Lei Wen 03-07-2012 02:57 PM

How to use scripts in crash?
 
Hi Dave,

Do you have some guide doc that describe how to use the scripts in crash?
Like the example, I want to print out current filesystems registered.
I then need do following
1. using "p" to get "file_systems" symbol value
2. using "list" with command as "list -o file_system_type.next -s file_system_type.name,fs_flags <the file_systems symbol value>"

So if the previous file_systems symbol value could be stored, and then I don't need to copy the "p" result to "list" command by hand, but could let script do such kind of thing.

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

--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility

Dave Anderson 03-07-2012 03:08 PM

How to use scripts in crash?
 
----- Original Message -----
> Hi Dave,
>
> Do you have some guide doc that describe how to use the scripts in
> crash?
> Like the example, I want to print out current filesystems registered.
> I then need do following
> 1. using "p" to get "file_systems" symbol value
> 2. using "list" with command as "list -o file_system_type.next -s
> file_system_type.name,fs_flags <the file_systems symbol value>"
>
> So if the previous file_systems symbol value could be stored, and
> then I don't need to copy the "p" result to "list" command by hand,
> but could let script do such kind of thing.
>
> 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.

Dave

--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility

Bruce Korb 03-07-2012 03:25 PM

How to use scripts in crash?
 
On Wed, Mar 7, 2012 at 8:08 AM, Dave Anderson <anderson@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
--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility


All times are GMT. The time now is 08:01 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.