Add mips64 architecture support information to the README and help.c files.
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Youling Tang <tangyouling@loongson.cn>
This adds valgrind support for the crash's custom memory allocator
using the way described in the following valgrind's Memcheck manual:
https://www.valgrind.org/docs/manual/mc-manual.html#mc-manual.mempools
This helps detecting various memory errors on the crash's custom
memory allocator.
To enable this feature, build crash command as:
# make valgrind
Then, run crash commnad using valgrind as:
# valgrind ./crash vmlinux vmcore
Signed-off-by: HATAYAMA Daisuke <d.hatayama@fujitsu.com>
In older kernels that have the variable-length-record log_buf, the
log level and the log flags/facility are not separated. Since the
log level is only the last three bits, and the flags/facility and
level are separated in 5.10 and later kernels, only print those last
three bits when using 'log -m'.
[ kh: modified commit message ]
Suggested-by: David Jeffery <djeffery@redhat.com>
Signed-off-by: John Pittman <jpittman@redhat.com>
Currently the "mod" command shows the address of the module struct,
it is inconvenient to know the address range of the module, so extend
to show the base adddress.
[ kh: added help page update ]
Signed-off-by: Yunfeng Ye <yeyunfeng@huawei.com>
Signed-off-by: Kazuhito Hagio <k-hagio-ab@nec.com>
Currently there is no way to un-set the scope without having to
exit and re-enter crash. The ability to un-set can come in very
useful when running automated pykdump scripts and needing scope to
be cleared between script runs. Add the ability by allowing
vaddr 0 to be passed through gdb_set_crash_scope() and
gdb_command_funnel(), taking advantage of the !req->addr check in
gdb_set_crash_block(), enabling 'set scope 0' as a viable command.
Signed-off-by: John Pittman <jpittman@redhat.com>
Currently it's not easy to distinguish which time zone the output of
DATE uses:
crash> sys | grep DATE
DATE: Thu Nov 29 06:44:02 2018
Let's introduce ctime_tz() function like ctime() but explicitly appends
the time zone to its result string.
DATE: Thu Nov 29 06:44:02 JST 2018
Resolves: https://github.com/crash-utility/crash/issues/62
Suggested-by: Jacob Wen <jian.w.wen@oracle.com>
Signed-off-by: Kazuhito Hagio <k-hagio-ab@nec.com>
line option for Linux 5.4 and later dumpfiles, which require the
kernel's dynamically-determined "vabits_actual" value for virtual
address translation. Without the patch, the crash session fails
during initialization with the error message "crash: cannot determine
VA_BITS_ACTUAL". This option will become unnecessary when the
proposed TCR_EL1.T1SZ vmcoreinfo entry entry is incorporated into
the kernel.
(anderson@redhat.com)
shared object extension modules that are located in the directories
that are part of the normal search path that is used when a shared
object is loaded without a fully-qualified pathname.
(w@laoqinren.net)
kernels that contain commit b6c88d3b9d38f9448e0fcf44847a075ea81d5ca2,
titled "drivers/base/memory.c: don't store end_section_nr in memory
blocks". The initial fix only addressed the x86_64 architecture;
this incremental patch addresses the other architectures.
(msys.mizuma@gmail.com)
contain commit b6c88d3b9d38f9448e0fcf44847a075ea81d5ca2, titled
"drivers/base/memory.c: don't store end_section_nr in memory blocks".
Without the patch, the command option fails with the error message
"kmem: invalid structure member offset: memory_block_end_section_nr".
(msys.mizuma@gmail.com)
that contain commit 326e1b8f83a4318b09033ef754f40c785aed5e68,
titled "mm/sparsemem: introduce a SECTION_IS_EARLY flag". Without
the patch, mem_map addresses containing the flag in bit 3 incorrectly
show it as part of the virtual address; with the patch, the option
displays the new "E" state flag.
(k-hagio@ab.jp.nec.com)
destination of error messages. It can be set to either:
"default": error messages are always displayed on the
console; if the output of a command is piped to an
external command or redirected to a file, the error
messages are also sent to the pipe or file.
"redirect": if the output of a command is piped to an
external command or redirected to a file, error messages
are only sent to the pipe or file; otherwise they are
displayed on the console.
"filename": error messages are only sent to the specified
filename; they are not displayed on the console and
are not sent to a pipe or file.
(dkwon@redhat.com)
the "dis -r" and "dis -f" reverse/forward modes of operation. In
reverse mode, the specified "count" number of instructions leading
up to and including the target address will be displayed. In forward
mode, the display will be limited to "count" instructions. Without
the patch, using a count argument in either mode generates a "count
argument ignored" message, and the command proceeds as if it had
not been entered.
(anderson@redhat.com, atomlin@redhat.com)
reverse order. Memory will be displayed up to and including the
address argument, which requires that the count argument be greater
than 1 in order to display memory before the specified address.
(anderson@redhat.com)
remaining time in jiffies until the expiration of a timer entry, and
where a negative value displays the number of jiffies that have
elapsed since a timer has expired.
(oleksandr@redhat.com)
the panic task, regardless of the current context. This option is
only applicable when running against dumpfiles in which the panic
task is known.
(atomlin@redhat.com)
configuration in commit 2724273e8fd00b512596a77ee063f49b25f36507,
titled "vmcore: add API to collect hardware dump in second kernel",
in which device drivers may collect a device specific snapshot of the
hardware/firmware state of their underlying devices, and export the
data as a kdump ELF note with type NT_VMCOREDD. This patch
recognizes the new ELF note(s) in both ELF and compressed kdump
vmcore dumpfiles. The "help -[nD]" option shows basic information
about each note, and two new "dev" command options have been
introduced. The "dev -V" option displays an indexed list of each
note, showing the device name, the dumpfile offset, and the size
of each note. The "dev -v index [file]" option either dumps the
contents of a note to the display screen in a human-readable format,
or copies the note data directly to a specified file.
(surendra@chelsio.com)
randomization (KASLR) for s390X. This is the minimal patch-set
required to process s390x dumps for the kernels configured with
CONFIG_RANDOMIZE_BASE, and to accept the "--kaslr" command line
option. Only dumpfiles whose headers contain kernel VMCOREINFO
data are supported.
(zaslonko@linux.ibm.com)
CONFIG_ARM64_USER_VA_BITS_52, which causes the PTRS_PER_PGD count
to increase from 64 to 1024. Without the patch, "WARNING: cannot
access vmalloc'd module memory" will be displayed during session
initialization, and the translation of any mapped kernel virtual
address that requires a page table walk will fail, leading to a
myriad of other errors.
(anderson@redhat.com)
configured with CONFIG_RANDOMIZE_BASE. Linux 4.20 introduced
kernel commit d52888aa2753e3063a9d3a0c9f72f94aa9809c15, titled
"x86/mm: Move LDT remap out of KASLR region on 5-level paging",
which modified the 4-level and 5-level paging PAGE_OFFSET values.
Without this patch, the crash session fails during initialization
with the error message "crash: read error: kernel virtual address:
<address> type: tss_struct ist array". For kernels prior to
Linux 4.20.0 which have backports of the kernel commit, the kernel's
PAGE_OFFSET value must be manually specified via the command line
option "--machdep page_offset=ffff888000000000" for kernels with
4-level page tables, or "--machdep page_offset=ff11000000000000"
for kernels with 5-level paging. (or alternatively the shorter
version "-m page_offset=<address>" may be used). The command
line option requirement may be revisited in the future.
(anderson@redhat.com)
commit 7ff4f8035695984c513598e2d49c8277d5d234ca, titled "block:
remove dead queue members", in which the number of I/Os issued to
a disk driver are no longer stored in the request_queue structure.
Without the patch, the options indicate "dev: -d option not supported
or applicable on this architecture or kernel". With the patch, the
"DRV" column is not shown.
(m.mizuma@jp.fujitsu.com)
an XArray in Linux 4.20 and later kernels. The implementation is
similar to that of radix tree displays, but in addition, the "-p"
option will also display the index value of each entry in a radix
tree or XArray.
(anderson@redhat.com)
per-cgroup kmem_cache slabs, the number of slab caches displayed by
"kmem -s" can number into the thousands. Similar to /proc/slabinfo,
this new option displays the accumulated data of the root cache and
its children. It is limited to Linux 4.11 and later kernels that
contain the "slab_root_caches" list. Currently the command option
is restricted to kernels configured with CONFIG_SLUB.
(k-hagio@ab.jp.nec.com)
cache name string so that it is beneath the "NAME" header column when
the "kmem -I <slab-cache>" option is used to ignore a slab cache,
or if the scan of the metadata of a slab cache enounters corruption.
Also remove a superfluous line from the "help kmem" description of
the "kmem -I" option.
(k-hagio@ab.jp.nec.com, anderson@redhat.com)
the slab cache name string is moved from the second column to the
the last column. Since the slab cache name strings have become
increasingly longer over time, without the patch, the numerical
column contents may be skewed so far to the right that the output
becomes difficult to read.
(k-hagio@ab.jp.nec.com)
new process states, "ID" for the TASK_IDLE macro introduced in
Linux 4.2, and "NE" for the TASK_NEW bit introduced in Linux 4.8.
(k-hagio@ab.jp.nec.com)
items as it traverses the list. The hash table approach has worked
well for many years. However, with increasing memory sizes and list
sizes, the overhead of the hash table can be substantial, often
leading to commands running for a very long time. For large lists,
we have found that the existing hash based approach may slow the
system to a crawl and possibly never complete. You can turn off
the hash with "set hash off" but then there is no loop detection; in
that case, loop detection must be done manually after dumping the
list to disk or some other method. This patch is an implementation
of the cycle detection algorithm from R. P. Brent as an alternative
algorithm for the "list" command. The algorithm both avoids the
overhead of the hash table and yet is able to detect a loop. In
addition, further loop characteristics are printed, such as the
distance to the start of the loop as well as the loop length.
An excellent description of the algorithm can be found here on
the crash-utility mailing list:
https://www.redhat.com/archives/crash-utility/2018-July/msg00019.html
A new "list -B" option has been added to the "list" command to
invoke this new algorithm rather than using the hash table. In
addition to low memory usage, the output of the list command is
slightly different when a loop is detected. In addition to printing
the first duplicate entry, the length of the loop, and the distance
to the loop is output.
(dwysocha@redhat.com)
are contained in the "vm_numa_stat" array that was introduced in
Linux 4.14. Also, the command output separates the "vm_zone_stat",
"vm_node_stat" and "vm_numa_stat" entries into separate sections with
"VM_ZONE_STAT", "VM_NODE_STAT" and "VM_NUMA_STAT" headers. Without
the patch, the "vm_zone_stat" and "vm_node_stat" entries are listed
together under a "VM_STAT" header.
(anderson@redhat.com)
per-program and per-map data for the "bpf -p ID" and "bpf -m ID"
options, containing data items shown by the "bpftool prog list"
and "bpftool map list" options; new "bpf -P" and "bpf -M" options
have been added that dump the extra data for all loaded programs
or tasks.
(anderson@redhat.com)
loaded eBFP (extended Berkeley Packet Filter) programs and maps.
Because of its upstream fluidity, the capabilities of this command
will be an ongoing task. In its initial form, the command displays
the addresses, basic information, and key data structures of eBPF
programs and maps. It also translates the bytecode, and disassembles
the jited code, of loaded eBPF programs.
(anderson@redhat.com)
the tree sorted in linear order, starting with the leftmost node and
progressing to the right. Also, if a corrupted rb_node pointer is
encountered, do not fail immediately, but rather display the rb_node
address and the corrupt pointer and continue.
(neelx@redhat.com)
when the VM was suspended. This patch enables crash to read the
relevant registers from each vCPU state for use as the starting hooks
by the "bt" command. Also, support for "help -[D|n]" to display
dumpfile contents, and "help -r" to display vCPU register sets has
been implemented. This is also the first step towards implementing
automatic KASLR offset calculations for VMSS dumpfiles.
(slp@redhat.com)
patch is a cleanup/collaboration of the original logic used by the
various vtop functions, where several new common functions have been
added for extracting page table entries from PGD, P4D, PUD, PMD and
PTE pages. The usage of the former PML4 and UPML pages have been
replaced with the use of the common PGD page, and use the PUD page
in 4-level page table translation. Support for 5-level page tables
has been incorporated into the the existing x86_64_kvtop() and
x86_64_uvtop_level4() functions. Backwards compatibility for older
legacy kernels has been maintained. The third phase of support will
automatically detect whether the kernel proper, and whether an
individual user task, is utilizing 5-level page tables. This patch
enables support for kernel-only 5-level page tables by entering the
command line option "--machdep vm=5level".
(douly.fnst@cn.fujitsu.com)