Commit Graph

5 Commits

Author SHA1 Message Date
Alexey Makhalov 7c8a7dddda vmware_guestdump: Various format versions support
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>
2024-11-04 15:03:58 +08:00
Dave Wysochanski b76e116c50 vmware: Improve output when we fail to read vmware 'vmsn' file
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>
2023-07-12 08:45:32 +09:00
Alexey Makhalov 6c5f0c6ff5 vmware_guestdump: add debugging of the init function
Dump memory and registers state after parsing.

Signed-off-by: Alexey Makhalov <amakhalov@vmware.com>
2021-09-28 17:00:29 +08:00
Kazuhito Hagio ea46a884da Fix for compiler warnings on 32-bit architectures
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>
2020-11-17 13:16:50 +09:00
Alexey Makhalov 3fedbee9bf vmware_guestdump: new input format
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>
2020-10-15 11:09:46 +09:00