There are several versions of debug.guest format. Current version of
the code is able to parse only version 4.
Improve parser to support other known versions. Split data structures
on sub-structures and introduce a helper functions to calculate a gap
between them based on the version number. Implement additional data
structure (struct mainmeminfo_old) and logic specifically for original
(version 1) format support.
Signed-off-by: Alexey Makhalov <alexey.makhalov@broadcom.com>
Today if crash fails to read some structure in a vmware 'vmsn' file,
it will throw an "No such file or directory" message. Such a generic
message does not give any clue as to the problem, but instead sounds
like the file may not exist when it does, for example:
$ crash ./vmcore.vmsn ./vmlinux
crash 8.0.3
...
crash: vmw: Failed to read './vmcore.vmsn': [Error 2] No such file or directory
crash: ./vmcore.vmsn: initialization failed
$ ls -l ./vmcore.vmsn
-rwxrwxrwx. 7 myuser mygroup 12128999 Jul 4 07:21 ./vmcore.vmsn
Improve the above error message so we at least know which portion
of the file crash had difficulty reading. After this patch, the
above error looks like:
crash: vmw: Failed to read 'cptgroupdesc' from file './vmcore.vmsn': [Error 2] No such file or directory
Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
Suppress compiler warnings "warning: format '%ld' expects argument
of type 'long int', but argument 4 has type 'uint64_t' [-Wformat=]"
and similar ones generated on 32-bit architectures as a result of
crash commit 3fedbee9bf ("vmware_guestdump: new input format").
Signed-off-by: Kazuhito Hagio <k-hagio-ab@nec.com>
Acked-by: Alexey Makhalov <amakhalov@vmware.com>
vmware_guestdump is extension to vmware_vmss with ability to debug
debug.guest and debug.vmem files.
debug.guest.gz and debug.vmem.gz can be obtained using following
.vmx options from VM running in debug mode:
monitor.mini-suspend_on_panic = TRUE
monitor.suspend_on_triplefault = TRUE
guestdump (debug.guest) is simplified version of *.vmss which does
not contain full VM state, but minimal guest state, such as memory
layout and CPUs state, needed for debugger. is_vmware_guestdump()
and vmware_guestdump_init() functions parse guestdump header and
populate vmss data structure (from vmware_vmss.c). As result, all
handlers (except mempry_dump) from vmware_vmss.c can be reused.
How to use: $ crash /path/to/debug_file.guest vmlinux
Companion debug_file.vmem must be present in the same folder as
debug_file.guest. Otherwise crash will shot a message:
vmw: Open the companion vmem file: /path/to/debug_file.vmem
crash: vmw: /path/to/debug_file.vmem: No such file or directory
Signed-off-by: Alexey Makhalov <amakhalov@vmware.com>