| crash extension modules |
Crash extension modules are required to #include the
defs.h
file from the top-level directory of crash source tree.
There are three suggested manners for building a module:
-
Hand-compile the module's .so shared object file
like this:
$ gcc -nostartfiles -shared -rdynamic -o <module>.so <module>.c -fPIC -D<machine-type> $(TARGET_CFLAGS)
where <machine-type> is X86, X86_64, IA64, PPC64, ARM, S390 or S390X,
and where $(TARGET_CFLAGS) is -D_FILE_OFFSET_BITS=64 on 32-bit architectures,
and -m64 on ppc64.
As a convenience, the crash utility's crash-<version>.src.rpm package builds a crash-devel sub-package,
which installs
defs.h
into /usr/include/crash/defs.h.
-
Alternatively, copy the module's .c source file
to the crash-<version>/extensions subdirectory.
Then, from the top-level crash-<version> directory, enter:
$ make extensions
If the default compile line does not suffice, create an accompanying .mk makefile with
the same prefix as the .c file,
copy it to the crash-<version>/extensions subdirectory, and enter the same
make extensions command as above.
-
Lastly, some extension modules that do have both <module>.c and <module>.mk files
may be built without the crash source tree if the defs.h file
is located in the current directory or in the /usr/include/crash directory:
$ make -f <module>.mk
To add the module's command(s) to a running crash session, enter:
crash> extend <path-to>/<module>.so
The command(s) registered by the extension module will appear in the
crash help menu.
The module can be installed automatically if the
extend command above is entered in either ./.crashrc
or $HOME/.crashrc.
If the crash-<version>.src.rpm file is used to build the crash package,
a crash-extensions-<version>.rpm subpackage containing a subset of the
extension modules below is built. If the subpackage is installed, the extension
modules will be located in /usr/lib/crash/extensions or /usr/lib64/crash/extensions,
whichever is appropriate.
Lastly, there is a crash -x command line option that will load extension modules automatically
from a particular directory. The search for the extension module directory will be done in
the following order, and the first one (if any) that exists will be selected as the
target directory:
-
the directory specified in the CRASH_EXTENSIONS shell environment variable
-
/usr/lib64/crash/extensions (64-bit architectures)
-
/usr/lib/crash/extensions
-
./extensions
All extension modules that are found in the target directory will be loaded automatically.
|
| module |
commands |
comments |
| echo.c |
echo
|
|
snap.c
snap.mk |
snap
|
-
Takes a snapshot of physical memory and creates an ELF vmcore.
The default vmcore is a kdump-style dumpfile, but a netdump-style may be optionally
created. It supports the X86, X86_64, IA64 and PPC64 architectures only.
All caveats regarding the taking of
a "live" memory snapshot apply, such as the constantly-changing state of the kernel's
slab subsystem or active process set while the dump is taking place.
-
To build the module from the top-level crash-<version> directory, enter:
$ make extensions
-
The module also serves as an example of an extension module
that can be built in all three manners:
-
Copy snap.c
to the crash-<version>/extensions subdirectory,
and from the top-level crash-<version> directory, enter:
$ make extensions
-
Copy both snap.c and
snap.mk
to the crash-<version>/extensions subdirectory, and
from the top-level crash-<version> directory, enter:
$ make extensions
-
Copy snap.c,
snap.mk, and
defs.h
into any directory.
The defs.h file may also
be located in the /usr/include/crash directory, as would be
the case if the crash-devel sub-package had been installed.
Then enter:
$ make -f snap.mk
-
This module's source file and makefile are contained within the crash-<version>.src.rpm
and crash-<version>.tar.gz files, and the compiled module is included in the
crash-extensions-<version>.rpm subpackage when
crash-<version>.src.rpm is used to build the crash package.
-
Author: Dave Anderson <anderson@redhat.com>
|
sial.c
sial.mk |
load
unload
edit
|
|
| dminfo.c |
dminfo
|
|
| trace.c |
trace
|
|
gcore.c
gcore.mk
crash-gcore-command-1.1.1.tar.gz |
gcore
|
|
| spu.c |
spuctx
spus
spurq
|
|
| pykdump |
epython
crashinfo
xportshow
|
|
| qemu-vtop.c |
qemu-vtop
|
Translate a KVM guest physical address into the virtual and physical addresses of its KVM host.
-
To build the module from the top-level crash-<version> directory, enter:
$ cp <path-to>/qemu-vtop.c extensions
$ make extensions
-
Prior to executing the command, it is necessary to load the debuginfo symbols of the kvm kernel module:
crash> mod -s kvm
- Author: Qiao Nuohan <qiaonuohan@cn.fujitsu.com>
|
| ipcs.c |
ipcs
|
|
| |
| crash SIAL scripts |
SIAL scripts require no compilation, but they do require that the sial.so extension module
be pre-loaded with extend, because sial.so provides
the load command required to load SIAL scripts.
To add the module to a running crash session, enter:
crash> extend <path-to>/sial.so
The module can be installed automatically if the
extend command above is entered in either ./.crashrc
or $HOME/.crashrc.
SIAL scripts may be located anywhere. However, upon loading the
sial.so module, SIAL scripts located in the /usr/share/sial/crash or
$HOME/.sial directories will be loaded automatically.
The command(s) contained in a loaded SIAL script will appear in the
crash help menu.
The libsial README and
README.sial files contain information regarding
the format of SIAL scripts.
|
| script |
commands |
comments |
| ps.c |
sps
|
|
| files.c |
sfiles
|
|
| |
| crashdc: Crash Dump Data Collector |
The crashdc data collector is a script that can be used in conjunction with the crash utility to automatically
generate a text file containing major information about a newly generated crash dump. The package website
is here:
  http://crashdc.sourceforge.net
Author: Louis Bouchard <louis.bouchard@canonical.com>
|
| |
| crash Python scripts |
Pykdump scripts require no Python installed, but they do require the
mpykdump.so extension module
pre-loaded with extend. mpykdump.so provides
built-in Python intepreter and needed pure Python libraries as well as Python bindings to crash. Loading the extension registers 'epython' command which can be used to execute Python programs.
To minimize the extension size, only parts of Python standard library are included in the extension file. If you need anything extra (e.g. XML/RPC) please contact the author.
The mpykdump.so extension file is a shared library with ZIP-archive appended at the end of it. You can use standard ZIP command to view the contents of it and add your own Python programs. In addition to generic epython command, two useful programs are included in the extension (see Wiki documentation on SF site for more details).
The package website is here:
  http://pykdump.sourceforge.net
Author: Alex Sidorenko <asid@hp.com>
|
| crashinfo |
|
| xportshow |
|