On Wed, Jul 22, 2020 at 11:37 AM Dave Young <dyoung(a)redhat.com> wrote:
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?
It works well with the compressed format and flat and elf format,
maybe makedumpfile man page need a update. I'll check the code and
send an update.
> +
> + [ $? -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?
Yes, that's very doable. I didn't add that in the test routine because
debuginfo is too large and take a lot of time to install it and all
the dependencies, and will need to resize the VM image to contain
that, and also need to increase the VM memory to start the crash
utility. But give user a change to review it later is a good idea.
Thanks
Dave
--
Best Regards,
Kairui Song