On 07/22/20 at 01:02pm, Kairui Song wrote:
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.
Ok, thanks. I think crash test no need to go into the vm, it can be done
in host side since it only needs vmcore and debuginfo. We can start
with tell people how to find the vmcore captured and then do some crash
tool test manually.
In the future, maybe we can try to hook some host side crash tool test
with those vmcores.