MAKEDUMPFILE(8) | Linux System Administrator's Manual | MAKEDUMPFILE(8) |
makedumpfile - make a small dumpfile of kdump
makedumpfile [OPTION] [-x VMLINUX|-i
VMCOREINFO] VMCORE DUMPFILE
makedumpfile -F [OPTION] [-x VMLINUX|-i
VMCOREINFO] VMCORE
makedumpfile [OPTION] -x VMLINUX [--config
FILTERCONFIGFILE] [--eppic EPPICMACRO] VMCORE
DUMPFILE
makedumpfile -R DUMPFILE
makedumpfile --split [OPTION] [-x VMLINUX|-i
VMCOREINFO] VMCORE DUMPFILE1 DUMPFILE2
[DUMPFILE3 ..]
makedumpfile [OPTION] [-x VMLINUX|-i VMCOREINFO]
--num-threads THREADNUM VMCORE DUMPFILE
makedumpfile --reassemble DUMPFILE1 DUMPFILE2
[DUMPFILE3 ..] DUMPFILE
makedumpfile -g VMCOREINFO -x VMLINUX
makedumpfile [OPTION] [--xen-syms
XEN-SYMS|--xen-vmcoreinfo VMCOREINFO] VMCORE
DUMPFILE
makedumpfile --dump-dmesg [--partial-dmesg] [-x VMLINUX|-i
VMCOREINFO] VMCORE LOGFILE
makedumpfile [OPTION] -x VMLINUX --diskset=VMCORE1
--diskset=VMCORE2 [--diskset=VMCORE3 ..] DUMPFILE
makedumpfile -h
makedumpfile -v
With kdump, the memory image of the first kernel (called "panicked kernel") can be taken as /proc/vmcore while the second kernel (called "kdump kernel" or "capture kernel") is running. This document represents /proc/vmcore as VMCORE. makedumpfile makes a small DUMPFILE by compressing dump data or by excluding unnecessary pages for analysis, or both. makedumpfile needs the first kernel's debug information, so that it can distinguish unnecessary pages by analyzing how the first kernel uses the memory. The information can be taken from VMLINUX or VMCOREINFO.
makedumpfile can exclude the following types of pages while
copying VMCORE to DUMPFILE, and a user can choose which type
of pages will be excluded.
- Pages filled with zero
- Cache pages without private flag (non-private cache)
- Cache pages with private flag (private cache)
- User process data pages
- Free pages
makedumpfile provides two DUMPFILE formats (the ELF format and the kdump-compressed format). By default, makedumpfile makes a DUMPFILE in the kdump-compressed format. The kdump-compressed format is readable only with the crash utility, and it can be smaller than the ELF format because of the compression support. The ELF format is readable with GDB and the crash utility. If a user wants to use GDB, DUMPFILE format has to be explicitly specified to be the ELF format.
Apart from the exclusion of unnecessary pages mentioned above, makedumpfile allows user to filter out targeted kernel data. The filter config file can be used to specify kernel/module symbols and its members that need to be filtered out through the erase command syntax. makedumpfile reads the filter config and builds the list of memory addresses and its sizes after processing filter commands. The memory locations that require to be filtered out are then poisoned with character 'X' (58 in Hex). Refer to makedumpfile.conf(5) for file format.
Eppic macros can also be used to specify kernel symbols and its members that need to be filtered. Eppic provides C semantics including language constructs such as conditional statements, logical and arithmetic operators, functions, nested loops to traverse and erase kernel data. --eppic requires eppic_makedumpfile.so and eppic library. eppic_makedumpfile.so can be built from makedumpfile source. Refer to http://code.google.com/p/eppic/ to build eppic library libeppic.a and for more information on writing eppic macros.
To analyze the first kernel's memory usage, makedumpfile can refer
to VMCOREINFO instead of VMLINUX. VMCOREINFO contains
the first kernel's information (structure size, field offset, etc.), and
VMCOREINFO is small enough to be included into the second kernel's
initrd.
If the second kernel is running on its initrd without mounting a root file
system, makedumpfile cannot refer to VMLINUX because the second
kernel's initrd cannot include a large file like VMLINUX. To solve
the problem, makedumpfile makes VMCOREINFO beforehand, and it refers
to VMCOREINFO instead of VMLINUX while the second kernel is
running.
VMCORE has contained VMCOREINFO since linux-2.6.24, and a user
does not need to specify neither -x nor -i option.
If the second kernel is running on its initrd without mounting any file system, a user needs to transport the dump data to a remote host. To transport the dump data by SSH, makedumpfile outputs the dump data in the intermediate format (the flattened format) to the standard output. By piping the output data to SSH, a user can transport the dump data to a remote host. Note that analysis tools (crash utility before version 5.1.2 or GDB) cannot read the flattened format directly, so on a remote host the received data in the flattened format needs to be rearranged to a readable DUMPFILE format by makedumpfile (or makedumpfile-R.pl).
makedumpfile can read a DUMPFILE in the kdump-compressed
format instead of VMCORE and re-filter it. This feature is useful in
situation that users need to reduce the file size of DUMPFILE for
sending it somewhere by ftp/scp/etc. (If all of the page types, which are
specified by a new dump_level, are excluded from an original DUMPFILE
already, a new DUMPFILE is the same as an original DUMPFILE.)
For example, makedumpfile can create a DUMPFILE of dump_level 31 from
the one of dump_level 3 like the following:
Example:
# makedumpfile -c -d 3 /proc/vmcore dumpfile.1
# makedumpfile -c -d 31 dumpfile.1 dumpfile.2
makedumpfile can read VMCORE(s) in three kinds of sadump formats: single partition format, diskset format and media backup format, and can convert each of them into kdump-compressed format with filtering and compression processing. Note that for VMCORE(s) created by sadump, you always need to pass VMLINUX with -x option. Also, to pass multiple VMCOREs created on diskset configuration, you need to use --diskset option.
Here is the all combinations of the bits.
| |non- | | |
dump | zero |private|private| user | free
level | page |cache |cache | data | page
-------+------+-------+-------+------+------
0 | | | | |
1 | X | | | |
2 | | X | | |
3 | X | X | | |
4 | | X | X | |
5 | X | X | X | |
6 | | X | X | |
7 | X | X | X | |
8 | | | | X |
9 | X | | | X |
10 | | X | | X |
11 | X | X | | X |
12 | | X | X | X |
13 | X | X | X | X |
14 | | X | X | X |
15 | X | X | X | X |
16 | | | | | X
17 | X | | | | X
18 | | X | | | X
19 | X | X | | | X
20 | | X | X | | X
21 | X | X | X | | X
22 | | X | X | | X
23 | X | X | X | | X
24 | | | | X | X
25 | X | | | X | X
26 | | X | | X | X
27 | X | X | | X | X
28 | | X | X | X | X
29 | X | X | X | X | X
30 | | X | X | X | X
31 | X | X | X | X | X
Instead of using -R option, a perl script
"makedumpfile-R.pl" rearranges the dump data in the flattened
format to a normal DUMPFILE, too. The perl script does not depend
on architecture, and most systems have perl command. Even if a remote
host does not have makedumpfile, it is possible to rearrange the dump
data in the flattened format to a readable DUMPFILE on a remote
host by running this script.
Example:
# makedumpfile -F -d 31 -x vmlinux /proc/vmcore \
| ssh user@host "makedumpfile-R.pl dumpfile"
num_of_cycles = system_memory / (buffer_size * 1024 *
bit_per_bytes * page_size )
The lesser number of cycles, the faster working speed is expected. By default, buffer_size will be calculated automatically depending on system memory size, so ordinary users don't need to specify this option.
Example:
# makedumpfile --cyclic-buffer 1024 -d 31 -x vmlinux /proc/vmcore
dumpfile
Example:
# makedumpfile --work-dir /tmp -d 31 -x vmlinux /proc/vmcore dumpfile
Example:
# makedumpfile -E -X --xen_phys_start 0xcee00000 /proc/vmcore dumpfile
message | progress | common | error | debug | report
level | indicator| message | message | message | message
---------+----------+---------+---------+---------+---------
0 | | | | |
1 | X | | | |
2 | | X | | |
3 | X | X | | |
4 | | | X | |
5 | X | | X | |
6 | | X | X | |
* 7 | X | X | X | |
8 | | | | X |
9 | X | | | X |
10 | | X | | X |
11 | X | X | | X |
12 | | | X | X |
13 | X | | X | X |
14 | | X | X | X |
15 | X | X | X | X |
16 | | | | | X
17 | X | | | | X
18 | | X | | | X
19 | X | X | | | X
20 | | | X | | X
21 | X | | X | | X
22 | | X | X | | X
23 | X | X | X | | X
24 | | | | X | X
25 | X | | | X | X
26 | | X | | X | X
27 | X | X | | X | X
28 | | | X | X | X
29 | X | | X | X | X
30 | | X | X | X | X
31 | X | X | X | X | X
Example:
# makedumpfile --dump-dmesg /proc/vmcore dmesgfile
# makedumpfile --dump-dmesg -x vmlinux /proc/vmcore dmesgfile
Example:
# makedumpfile --mem-usage /proc/kcore
Example:
# makedumpfile -x vmlinux --diskset=vmcore1 --diskset=vmcore2 dumpfile
makedumpfile exits with the following value.
Written by Masaki Tachibana, and Ken'ichi Ohmichi.
crash(8), gdb(1), kexec(8), makedumpfile.conf(5)
12 Apr 2024 | makedumpfile v1.7.5 |