Commit Graph

8 Commits

Author SHA1 Message Date
Dave Anderson
70e58f1d10 Implemented a new STRDUPBUF() utility that will duplicate an existing
string into a buffer allocated with GETBUF().  As is the case with
any buffer allocated with GETBUF(), it is only meant to exist during
the life-span of the current command.  If it is not explicitly freed
via FREEBUF(), then it will be freed automatically prior to the next
command.
(anderson@redhat.com)
2015-04-14 16:02:09 -04:00
Dave Anderson
d5b362edf7 Implement a new "offline" internal crash variable that can be set to
either "show" (the default) or "hide".  When set to "hide", certain
command output associated with offline cpus will be hidden from view,
and the output will indicate that the cpu is "[OFFLINE]".  The new
variable can be set during invocation on the crash command line via
the option "--offline [show|hide]".  During runtime, or in a .crashrc
or other crash input file, the variable can be set by entering
"set offline [show|hide]".  The commands or options that are affected
when the variable is set to "hide" are as follows:

  o  On X86_64 machines, the "bt -E" option will not search exception
     stacks associated with offline cpus.
  o  On X86_64 machines, the "mach" command will append "[OFFLINE]"
     to the addresses of IRQ and exception stacks associated with
     offline cpus.
  o  On X86_64 machines, the "mach -c" command will not display the
     cpuinfo_x86 data structure associated with offline cpus.
  o  The "help -r" option has been fixed so as to not attempt to
     display register sets of offline cpus from ELF kdump vmcores,
     compressed kdump vmcores, and ELF kdump clones created by
     "virsh dump --memory-only".
  o  The "bt -c" option will not accept an offline cpu number.
  o  The "set -c" option will not accept an offline cpu number.
  o  The "irq -s" option will not display statistics associated with
     offline cpus.
  o  The "timer" command will not display hrtimer data associated
     with offline cpus.
  o  The "timer -r" option will not display hrtimer data associated
     with offline cpus.
  o  The "ptov" command will append "[OFFLINE]" when translating a
     per-cpu address offset to a virtal address of an offline cpu.
  o  The "kmem -o" option will append "[OFFLINE]" to the base per-cpu
     virtual address of an offline cpu.
  o  The "kmem -S" option in CONFIG_SLUB kernels will not display
     per-cpu data associated with offline cpus.
  o  When a per-cpu address reference is passed to the "struct"
     command, the data structure will not be displayed for offline
     cpus.
  o  When a per-cpu symbol and cpu reference is passed to the "p"
     command, the data will not be displayed for offline cpus.
  o  When the "ps -[l|m]" option is passed the optional "-C [cpus]"
     option, the tasks queued on offline cpus are not shown.
  o  The "runq" command and the "runq [-t/-m/-g/-d]" options will not
     display runqueue data for offline cpus.
  o  The "ps" command will replace the ">" active task indicator to
     a "-" for offline cpus.

The initial system information banner and the "sys" command will
display the total number of cpus as before, but will append the count
of offline cpus.  Lastly, a fix has been made for the initialization
time determination of the maximum number of per-cpu objects queued
in a CONFIG_SLAB kmem_cache so as to continue checking all cpus
higher than the first offline cpu.  These changes in behavior are not
dependent upon the setting of the crash "offline" variable.
(qiaonuohan@cn.fujitsu.com)
2014-10-06 15:32:37 -04:00
Dave Anderson
5b78ac4071 Fix the error message displayed if the vmlinux or vmcore file is
not the same endian as the crash utility binary.  Without the patch
the filename is shown with the incorrect/opposite endian type.
(hukeping@huawei.com)
2014-09-30 10:02:05 -04:00
Dave Anderson
10db83eb4e Re-run a command in the history list by entering an "!" followed by
the number identifying the command.  However, unlike the similar "r"
pseudo-command, if the number is a command name in the user's PATH,
maintain the current behavior and execute that command.
(anderson@redhat.com)
2014-08-07 15:30:28 -04:00
Dave Anderson
06dfdb8d87 Fix for the "p", "irq", "struct", "union" and "*" commands if a
cpu specification contains an invalid cpu number.  Without the
patch, a segmentation violation may be generated.
(anderson@redhat.com)
2014-05-02 14:18:57 -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
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
03e3937ec7 Initial commit: crash-7.0.4 2014-01-28 16:46:11 -05:00