Hi Kairui,
+has_valid_vmcore_dir() {
- local path=$1
- local vmcore_dir=$path/$(ls -1 $path | tail -n 1)
- if [ -e $vmcore_dir/vmcore ]; then
makedumpfile --dump-dmesg $vmcore_dir/vmcore $vmcore_dir/vmcore-dmesg.txt.2
- elif [ -e $vmcore_dir/vmcore.flat ]; then
makedumpfile --dump-dmesg $vmcore_dir/vmcore.flat $vmcore_dir/vmcore-dmesg.txt.2
- fi
Assume the $vmcore_dir/vmcore* is dumped by makedumpfile, but according to man page of makedumpfile, --dump-dmsg is use with the elf format /proc/vmcore, if it can also work with compressed vmcore then probably the man page just does not describe the case?
- [ $? -ne 0 ] && return 1
- [ ! -e $vmcore_dir/vmcore-dmesg.txt ] && return 1
- # Checking with `crash` is slow and consume a lot of memory/disk,
- # just do a sanity check by check if log are available.
- if diff $vmcore_dir/vmcore-dmesg.txt.2 $vmcore_dir/vmcore-dmesg.txt; then
return 1
- fi
Is it doable to print the vmcore saved path, kernel version etc, so that people can manually test the crash utility?
Thanks Dave