Commit Graph

39 Commits

Author SHA1 Message Date
Dave Anderson
9eb2a4a616 Fix for the ARM64 virtual-to-physical translation of vmemmap page
structure addresses for kernels configured with 4K pages.  Without
the patch, any command that required the contents of a page structure
would fail with a readmem error.
(cldu@marvell.com, anderson@redhat.com)
2014-04-04 11:30:13 -04:00
Dave Anderson
b559631d73 Fix false-alarm warning from older compilers resulting from previous
"bt -l" update:

  x86_64.c: In function ‘x86_64_exception_frame’:
  x86_64.c:3814: warning: ‘sp’ may be used uninitialized in this function

(anderson@redhat.com)
2014-04-03 14:58:19 -04:00
Dave Anderson
409256c9d8 Update for the X86_64 "bt -l" option such that it also displays the
available file and line number information for functions indicated as
the "exception RIP" in kernel exception frames.  The line number
information will follow the exception frame register dump.
(anderson@redhat.com)
2014-04-03 14:42:32 -04:00
Dave Anderson
d6ce9d2bba Implemented support for the ARM64 "bt -l" option.
(anderson@redhat.com)
2014-04-03 10:39:54 -04:00
Dave Anderson
12e9faa3cd Implemented support for the ARM64 "bt -e" option.
(anderson@redhat.com)
2014-04-03 10:23:10 -04:00
Dave Anderson
13f25a3e58 Cleaned up the exception frame displays of 64-bit in-kernel and both
32-bit and 64-bit user-mode exceptions.
(anderson@redhat.com)
2014-04-02 15:37:17 -04:00
Dave Anderson
7462950108 Initial working implementation of the basic ARM64 "bt" command, with
several command options still under development.  In-kernel exception
frames are only dumped if the exception handler function is contained
within the symbol boundaries from "__exception_text_start" to
"__exception_text_end"; when ARM64 kdump is eventually implemented,
further exception-related work will be resumed.
(anderson@redhat.com)
2014-04-01 16:31:26 -04:00
Dave Anderson
72a37658da Fix for KVM dumpfiles created with "virsh dump --memory-only" if
an X86_64 kernel was loaded with a non-zero "phys_base".  Without
the patch, the crash session fails with the warning message "WARNING:
cannot read linux_banner string" followed by the fatal error message
"crash: vmlinux and <dumpfile name> do not match!".
(anderson@redhat.com)
2014-04-01 16:29:46 -04:00
Dave Anderson
f9b816565d Document the "--machdep phys_offset=<physical-address>" command
line option for the ARM64 architecture in the crash.8 man page and
the "crash -h" output.
(anderson@redhat.com)
2014-03-28 14:05:22 -04:00
Dave Anderson
0f6d989aa0 Updated the ARM64 implementation to support Linux 3.13 and later
kernels that expand to a 42-bit address space when 64K pages are
configured.  This is also the first crash version that has been
tested on a live ARM64 system with 4K pages, where it cleanly
make it to the "crash>" prompt.  However, it should be noted that
some commands (most notably "bt") still do not work as of yet.
(anderson@redhat.com)
2014-03-27 16:20:50 -04:00
Dave Anderson
3095a02308 If a host build system does not have /usr/bin/wget installed, and
the crash package is built from a directory that was git-cloned
from github.com/crash-utility/crash.git, the error message has
been clarified to indicate "/usr/bin/wget is required to download
gdb-7.6.tar.gz".  Without the patch, the message indicates "tar
(child): gdb-7.6.tar.gz: Cannot open: No such file or directory".
(anderson@redhat.com)
2014-03-21 11:18:51 -04:00
Dave Anderson
2bb552bed2 Correction for the "crash -h" and crash.8 man page documentation of
the "--machdep phys_base=<physical-address>" command line option.
In both places the parameter mistakenly indicated "physbase".
(ptesarik@suse.cz)
2014-03-20 14:00:51 -04:00
Dave Anderson
2312a65fcb If the first assembly language instruction in an X86_64 function is
"nopl   0x0(%rax,%rax,1)" or "data32 data32 data32 xchg %ax,%ax",
which are generated when the ftrace facility is configured, the
X86_64 "dis" command will append "[FTRACE NOP]" to the line.
(anderson@redhat.com)
2014-03-18 16:31:02 -04:00
Dave Anderson
32aa6bbbf7 Made the "kmem -f <address>" and "kmem <address>" options more
efficient by using the new do_list() callback function feature
as well as restricting the search to only the NUMA node that
contains the address.
(anderson@redhat.com)
2014-03-17 16:57:48 -04:00
Dave Anderson
d3e5664ec6 Created a new feature for the internal do_list() function if it
is necessary to immediately perform a function for each entry in a
list while the list is being traversed.  A callback function, and an
option callback data pointer, can be registered in the list_data
structure.  The address of each entry in the list along with the
optional callback data pointer will be passed to the callback
function.  If desired, the callback function may also dictate that
do_list() should stop the list traversal and return immediately to
its caller.
(anderson@redhat.com)
2014-03-17 16:42:13 -04:00
Dave Anderson
ed28aca0c0 Fix for the "kmem -F" display and the "kmem -f <page-address>"
or "kmem <page-address> options.  Without the patch, the first
page in a list of free page blocks is not displayed on its own
line by "kmem -F", but rather at the end of the line showing the
area number, block size, and free_area struct address that the
page is linked to.  Due to this error, both "kmem <page-address>"
and "kmem -f <page-address>" would not find a page if it happened
to be the first page, or any of the contiguous pages in a multi-page
block, in the list of free pages or page blocks.
(anderson@redhat.com)
2014-03-14 10:30:35 -04:00
Dave Anderson
5645af9598 Increase the internal hash queue head count from 128 to 32768.
The hash queue is used for gathering and verifying lists, and the
original count of 128 may be overwhelmed if a list is extremely
large.  For example, on a 256GB system with 192GB of free pages,
the "kmem -f" command takes hours to complete; with this patch,
the time is reduced to a few minutes.  In addition, a new command
line option "--hash <count>" has been added to allow a user to
override the default hash queue head count of 32768.
(anderson@redhat.com)
2014-03-13 11:56:30 -04:00
Dave Anderson
dc7fea0128 Adjustment to the internal symbol-handling to prevent the usage of
kernel system call alias/wrapper names, for examples, "SyS_read" and
"compat_SyS_futex" instead of "sys_read" and "compat_sys_futex".
Without the patch, commands such as "dis", "sym <address>", and
"sys -c" display the alias/wrapper name instead of the real system
call name in Linux 3.10 and later kernels.
(anderson@redhat.com)
2014-03-05 16:11:36 -05:00
Dave Anderson
1ea4b02988 Fix for the "crash --log vmcore" command to account for the kernel
data structure and VMCOREINFO string name changes from "log" to
"printk_log" in Linux 3.11-rc4 and later kernels.  Without the patch,
the command fails with the error message "crash: VMCOREINFO: no log
buffer data".
(anderson@redhat.com)
2014-02-28 14:27:10 -05:00
Dave Anderson
dbb01ee68a Enable kernel text line number capability for the "dis -l", "bt -l",
"sys -c", and "sym" commands for kernels that are configured with
CONFIG_RANDOMIZE_BASE.
(anderson@redhat.com)
2014-02-27 16:35:45 -05:00
Dave Anderson
b8db9a76e9 Added a new "--kaslr=auto" command line option for X86_64 kernels
that that are configured with CONFIG_RANDOMIZE_BASE.  When set to
"auto", the KASLR relocation value will be determined automatically
by comparing the "_stext" symbol value compiled into the vmlinux file
with the _stext symbol value stored in kdump vmcoreinfo data; on live
systems the comparison will be made with the "_stext" symbol value
that is found in /proc/kallsyms.
(ahonig@google.com, anderson@redhat.com)
2014-02-25 15:28:47 -05:00
Dave Anderson
648d0f62c5 Added a new "--kaslr <offset>" command line option for X86 or
X86_64 kernels that are configured with CONFIG_RANDOMIZE_BASE.
The offset value must be equal to the difference between the
symbol values compiled into the vmlinux file and their relocated
value.
(ahonig@google.com, anderson@redhat.com)
2014-02-21 10:32:04 -05:00
Dave Anderson
c0b7a74fc1 Fix to prevent a possible invocation-time error on Linux 3.7 and
later kernels configured with CONFIG_SLAB, running against vmcore
files filtered with the makedumpfile(8) facility.  Without the
patch, the message "crash: page excluded: kernel virtual address:
<address>  type: kmem_cache buffer" is immediately followed by
the message "crash: unable to initialize kmem slab cache subsystem".
Because of a kernel data structure name change from "cache_cache" to
"kmem_cache_boot", the crash utility failed to properly downsize
the stored size of the kernel's kmem_cache data structure from the
size indicated by the vmlinux debuginfo data.  This in turn could
lead to reading beyond the end of a kmem_cache data structure into
a page of memory that had been excluded from the vmcore.  The fix
was also applied to kernels configured with CONFIG_SLUB.
(anderson@redhat.com)
2014-02-20 15:36:25 -05:00
Dave Anderson
51f0a176c4 Fix for custom X86_64 kernels that change the declaration of the
context_switch() function so that it is not an inline function.
Without the patch, the message "crash: cannot determine thread return
address" is displayed during invocation, and backtraces of blocked
tasks may have missing or invalid frames.
(ahonig@google.com)
2014-02-20 14:53:13 -05:00
Dave Anderson
967e95de72 crash-7.0.4 -> crash-7.0.5 2014-02-14 11:29:18 -05:00
Dave Anderson
a70d608406 Fix for the X86_64 "bt" command if an async page fault exception
occurred in a KVM guest running a Linux 2.6.38 or later kernel.
Without the patch, the exception frame register dump is not displayed
above the "async_page_fault" stack frame.
(anderson@redhat.com)
2014-02-12 15:13:00 -05:00
Dave Anderson
4502313d43 Update crash banner copyright to 2014
(anderson@redhat.com)
2014-02-06 09:12:52 -05:00
Dave Anderson
4ba15a6172 Reduce the number of CTRL-c entries required to unconditionally
terminate any manually-entered command from three to one.
(anderson@redhat.com)
2014-01-31 13:42:12 -05:00
Dave Anderson
472aa4948b When invoking a crash session with a compressed vmlinux file,
make the same host-machine/vmlinux endian verification that is
done with uncompressed vmlinx files.
(anderson@redhat.com)
2014-01-29 15:23:51 -05:00
Dave Anderson
8697c8c176 Fix for the X86_64 "bt" command if a page fault exception was
generated by the invalid contents of the RIP register.  Without
the patch, the exception frame register dump is not displayed
above the "page_fault" stack frame; and in a related issue, the
"bt -e" option will not find and display the exception frame.
(anderson@redhat.com)
2014-01-29 15:22:22 -05:00
Dave Anderson
47a0fa259a Enhancement of the X86_64 "bt" command to more correctly determine
the function frame that called into a function that was interrupted.
Without the patch, the first frame just above an IRQ exception frame
register dump may show an invalid/stale function.
(anderson@redhat.com)
2014-01-29 15:20:47 -05:00
Dave Anderson
8807d12cf0 Fix for the X86_64 "bt" command to prevent an unwarranted message
indicating "WARNING: possibly bogus exception frame" generated
from a task that was in the process of being exec'd from a kernel
thread via the call_usermodehelper() facility.
(anderson@redhat.com)
2014-01-29 15:19:08 -05:00
Dave Anderson
0c12ab1094 Create a new memory display format for an address that comes from
a slab object, consisting of the slab cache name and the address
value, separated by a colon, and encompassed in brackets:

  [slab-cache-name:address]

Enhanced the "bt -F" option such that if "-F" is entered twice,
and if the stack frame contents reference a slab cache object, both
the slab cache name and the stack contents will be displayed within
brackets.

Enhanced the "rd -S" option such that if "-S" is entered twice,
and if the memory contents reference a slab cache object, both the
slab cache name and the memory contents will be displayed within
brackets.
(anderson@redhat.com)
2014-01-29 15:12:01 -05:00
Dave Anderson
d4f34069fd When executing the commands from an input file specified by the
"-i <file>" command line option, or when accepting input from a
file as a set of commands or as a set of command arguments using the
"<" redirection character, unconditionally cease the operation if
CTRL-c is entered.  Without the patch, depending upon the command
that was running when the SIGINT was received, the operation may
continue uninterruptibly until the file contents are consumed.
(anderson@redhat.com)
2014-01-29 15:09:17 -05:00
Dave Anderson
6a3ba6ae7b Fix for the "kmem -S" command for kernels that are configured with
CONFIG_SLUB.  Eash per-cpu slab object dump may show incorrect
ALLOCATED and FREE values; and as seen on Linux 3.5 and later
kernels, the TOTAL value and the number of individual objects dumped
may also be incorrect (too small).
(anderson@redhat.com)
 Please enter the c mmit message for your changes. Lines starting
2014-01-29 15:06:53 -05:00
Dave Anderson
bc21fc9263 Fix for the "kmem -S" command on Linux 3.1 and later kernels that are
configured with CONFIG_SLUB.  Because the the page structure's inuse
and objects fields used by SLUB were changed from discrete u16 types
to bit-fields within an unsigned int, the display of per-node partial
slab statistics are incorrect.  Without the patch, the TOTAL and
ALLOCATED values are incorrectly shown as equal values, and therefore
the FREE value is always zero.
(anderson@redhat.com)
2014-01-29 15:04:55 -05:00
Dave Anderson
d49b5eff88 Add support for Xen PVH guest types introduced in Xen 4.4. Without
the patch, running against a Xen 4.4 hypervisor binary would fail
during session initialization with the error message "crash: invalid
structure member offset: domain_is_hvm".  In addition, the PVH guest
type is being registered internally as an HVM guest type, the debug
"help -X ofs" command's display of the domain_domain_flags offset
has been fixed to show it in decimal, and the setting of the internal
dc->domain_flags has been fixed to contain all flags set, not just
the first one found.
(dslutz@verizon.com)
2014-01-29 15:02:07 -05:00
Dave Anderson
bb3e3a63b9 Fix for the "runq -g" option for kernels that are configured with
CONFIG_FAIR_GROUP_SCHED, but not CONFIG_CFS_BANDWIDTH.  Without the
patch, the command fails with the message "runq: invalid structure
member offset: cfs_rq_throttled".
(vinayakm.list@gmail.com)
2014-01-29 14:56:10 -05:00
Dave Anderson
03e3937ec7 Initial commit: crash-7.0.4 2014-01-28 16:46:11 -05:00