Commit Graph

127 Commits

Author SHA1 Message Date
Sergey Samoylenko
fb64fdd11d sbitmapq: add '-p' option
The -p option says, an associated with sbitmap_queue array contains
the pointers on a structure. This allows the sbitmapq command works
correctly with the array of pointers attached to the sbitmap_queue.

Signed-off-by: Sergey Samoylenko <s.samoylenko@yadro.com>
2022-02-22 09:53:30 +08:00
Sergey Samoylenko
ac86cc3558 Introduce sbitmapq command
Patch adds new 'sbitmapq' command. This command dumps
the contents of the sbitmap_queue structure and the used
bits in the bitmap. Also, it shows the dump of a structure
array associated with the sbitmap_queue.

Signed-off-by: Sergey Samoylenko <s.samoylenko@yadro.com>
2022-02-22 09:53:27 +08:00
Shogo Matsumoto
b0d447d78b log: introduce "log -s" option to display printk safe buffers
Introduce a new "log -s" option, which outputs unflushed logs in the
printk safe buffers (safe_print_seq and nmi_print_seq) as follows:

  crash> log -s
  PRINTK_SAFE_SEQ_BUF: nmi_print_seq
  CPU: 0  ADDR: ffff8ca4fbc19ce0 LEN: 150  MESSAGE_LOST: 0
    Uhhuh. NMI received for unknown reason 20 on CPU 0.
    Do you have a strange power saving mode enabled?
    Dazed and confused, but trying to continue
  ...

The buffers are displayed for each CPU.  For an empty buffer,
'(empty)' will be printed.

Also append those to the bottom of "log" command output so as not to
overlook them like this:

  crash> log
  ...
  [nmi_print_seq] Uhhuh. NMI received for unknown reason 30 on CPU 0.",
  [nmi_print_seq] Do you have a strange power saving mode enabled?",
  [nmi_print_seq] Dazed and confused, but trying to continue",

Note that the safe buffer (struct printk_safe_seq_buf) was introduced
at kernel-4.11 (Merge commit 7d91de74436a69c2b78a7a72f1e7f97f8b4396fa)
and removed at kernel-5.15 (93d102f094be9beab28e5afb656c188b16a3793b).

Link: https://listman.redhat.com/archives/crash-utility/2022-January/msg00052.html
Signed-off-by: Shogo Matsumoto <shogo.matsumoto@fujitsu.com>
Signed-off-by: Kazuhito Hagio <k-hagio-ab@nec.com>
2022-02-17 10:04:16 +09:00
Kazuhito Hagio
6bc104059b log: add warning to help text to inform the inaccuracy of -T option
The timestamps of the "log -T" option are inaccurate because they are
from local_clock(), which returns the raw counter in the local CPU and
it's different from the elapsed wall time.

The dmesg command, which the "log -T" option imitates, has a similar
behavior in nature and a warning in its help text.  Let's add a warning
also to the crash's help text to inform the inaccuracy for now.

Link: https://listman.redhat.com/archives/crash-utility/2021-September/msg00044.html
Reported-by: Martin Moore <martin.moore@hpe.com>
Signed-off-by: Kazuhito Hagio <k-hagio-ab@nec.com>
2021-11-19 13:06:12 +08:00
Kazuhito Hagio
05a3a328fc Remove text value cache code
The text value cache was implemented for analysis of remote dumpfiles
using the deprecated "crash daemon" running on the remote host.  On
updating GDB to 10.2, a regression occurred when we tried to fix a
"help -x" command problem, and there was no performance degradation
even without the text cache, so let's drop this functionality.

Signed-off-by: Kazuhito Hagio <k-hagio-ab@nec.com>
2021-09-28 17:00:49 +08:00
Alexey Makhalov
9fab193edb Update to gdb-10.2
Main changes:
[1] update gdb-7.6.patch to gdb-10.2.patch, and keep all functionality
    and good compatibility
[2] remove unneeded patches(gdb-7.6-proc_service.h.patch and
    gdb-7.6-ppc64le-support.patch)
[3] to make the c++ compiler happy, add the extern "C" to eliminate
    compilation issues, also add CXXFLAGS=-m32 to generate proper
    32bit object files
[4] the parameter types of some functions are changed, eg, the set of
    prettyprint variables
[5] eliminate error_hook() and SJLJ while running in C++ code (after
    gdb_command_funnel()) use try-catch mechanism instead
[6] request_types() is redone to do not call GNU_GET_NEXT_DATATYPE multiple
    times but single usage of GNU_ITERATE_DATATYPES with proper callback
    instead. Complete iteration happens on C++ side now.
[7] remove "struct global_iterator" from request structure, but add
    several fields (including callback pointer) to be able to perform
    iteration on C++ side
[8] type of "linux_banner" symbol is reported as 'D' by new gdb as its
    section ".rodata" marked as writable in vmlinux
[9] BFD API has changed.
[10] the deprecated_command_loop_hook got deprecated. So, call crash
     main_loop() directly from gdb captured_main()
[11] remove previously used hooks for that in target.c. Add crash_target
     for gdb to provide target operations such as xfer_partial to read
     and write crash dump memory.

Signed-off-by: Alexey Makhalov <amakhalov@vmware.com>
Signed-off-by: Lianbo Jiang <lijiang@redhat.com>
2021-09-28 17:00:05 +08:00
Kazuhito Hagio
7f38d1baf7 diskdump: Add support for reading dumpfiles compressed by Zstandard
Add support for reading dumpfiles compressed by Zstandard (zstd)
using makedumpfile.

To build crash with zstd support, type "make zstd".

Signed-off-by: Kazuhito Hagio <k-hagio-ab@nec.com>
2021-09-27 18:16:09 +09:00
Aaron Tomlin
80334ed258 kmem: Add support to -S option to specify a range of CPU-specific slab data
With this patch, it is now possible for one to explicitly specify a range
of CPU-specific slab data to list. For example:

Note: This is only applicable to a Linux kernel with Kconfig
      CONFIG_SLUB enabled. The optional argument GNU extension
      for getopt(3) is utilized; and, the CPU range must be
      specified as expected

    crash> kmem -S=1,4 kmalloc-512
    CACHE             OBJSIZE  ALLOCATED     TOTAL  SLABS  SSIZE  NAME
    ffff8d3f07c06c00      512       1916      3680    115    16k  kmalloc-512
    CPU 1 KMEM_CACHE_CPU:
      ffff8d461fa6f140
    CPU 1 SLAB:
      SLAB              MEMORY            NODE  TOTAL  ALLOCATED  FREE
      fffff540df7c4000  ffff8d45df100000     0     32          8    24
      FREE / [ALLOCATED]
       ffff8d45df100000  (cpu 1 cache)
      [ffff8d45df100200]
       ffff8d45df101000  (cpu 1 cache)
     ...skipped ...
    CPU 4 KMEM_CACHE_CPU:
      ffff8d461fb2f140
    CPU 4 SLAB:
      SLAB              MEMORY            NODE  TOTAL  ALLOCATED  FREE
      fffff540dfde3800  ffff8d45f78e0000     0     32          8    24
      FREE / [ALLOCATED]
      [ffff8d45f78e0000]
       ffff8d45f78e0200  (cpu 4 cache)
       ffff8d45f78e0400  (cpu 4 cache)
     ...skipped ...

Signed-off-by: Aaron Tomlin <atomlin@redhat.com>
Signed-off-by: Kazuhito Hagio <k-hagio-ab@nec.com>
2021-07-21 17:33:42 +09:00
Firo Yang
f091b5e76d list: add -O option for specifying head node offset
The -O option is very useful to specify the embedded head node's
offset which is different to the offset of other nodes embedded,
e.g. dentry.d_subdirs (the head node) and dentry.d_child.

[ kh: did some cosmetic adjustments ]

Signed-off-by: Firo Yang <firo.yang@suse.com>
Signed-off-by: Kazuhito Hagio <k-hagio-ab@nec.com>
2021-06-17 11:42:50 +09:00
Kazuhito Hagio
0b5435e101 memory: Add support for SECTION_TAINT_ZONE_DEVICE flag
Fix for "kmem -n|-p" options on Linux 5.12-rc1 and later kernels
that contain commit 1f90a3477df3f ("mm: teach pfn_to_online_page()
about ZONE_DEVICE section collisions").  Without the patch, the
"kmem -n" option incorrectly shows mem_map addresses containing the
flag in bit 5 as part of the virtual address, and also the "kmem -p"
option shows page structures at wrong position.  With the patch,
the "kmem -n" option displays the new "D" state flag.

Without the patch:
  crash> kmem -n
  ...
  NR      SECTION        CODED_MEM_MAP        MEM_MAP       STATE PFN
  1040  ffff9edf3ffd4100  ffffe2bcc0000010  ffffe2bd42000010  PMOE  34078720
                                        ^                 ^
  crash> kmem -p
      PAGE         PHYSICAL      MAPPING       INDEX CNT FLAGS
  ffffe2bd42000010 2080000000           400040 1ffffffff 9961471 dead000000000122 referenced,active,error
  ffffe2bd42000050 2080001000           800080 1ffffffff 9961471 dead000000000122 referenced,active,error
  ffffe2bd42000090 2080002000                0 1ffffffff 9961471 dead000000000122 referenced,active,error
                ^^
With the patch:
  crash> kmem -n
  ...
  NR      SECTION        CODED_MEM_MAP        MEM_MAP       STATE PFN
  1040  ffff9edf3ffd4100  ffffe2bcc0000000  ffffe2bd42000000  PMOED 34078720

  crash> kmem -p
      PAGE         PHYSICAL      MAPPING       INDEX CNT FLAGS
  ffffe2bd42000000 2080000000 ffff9ebfc0044100        0  1 97ffffc0000200 slab
  ffffe2bd42000040 2080001000 ffff9ebfc0044400        0  1 97ffffc0000200 slab
  ffffe2bd42000080 2080002000                0        0  1 97ffffc0000000

Signed-off-by: Kazuhito Hagio <k-hagio-ab@nec.com>
2021-06-02 16:33:03 +09:00
Kazuhito Hagio
2a3e546942 crash-7.2.9 -> crash-7.3.0
Signed-off-by: Kazuhito Hagio <k-hagio-ab@nec.com>
2021-04-27 17:01:07 +09:00
Youling Tang
5664c58bd2 MIPS64: Add mips64 architecture support information
Add mips64 architecture support information to the README and help.c files.

Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Youling Tang <tangyouling@loongson.cn>
2021-04-23 10:39:37 +09:00
HATAYAMA Daisuke
7ca9a8e21d Add valgrind support for the crash's custom memory allocator
This adds valgrind support for the crash's custom memory allocator
using the way described in the following valgrind's Memcheck manual:

  https://www.valgrind.org/docs/manual/mc-manual.html#mc-manual.mempools

This helps detecting various memory errors on the crash's custom
memory allocator.

To enable this feature, build crash command as:

  # make valgrind

Then, run crash commnad using valgrind as:

  # valgrind ./crash vmlinux vmcore

Signed-off-by: HATAYAMA Daisuke <d.hatayama@fujitsu.com>
2021-03-05 15:57:15 +09:00
John Pittman
a52f630e40 log: change log level print in older kernels
In older kernels that have the variable-length-record log_buf, the
log level and the log flags/facility are not separated.  Since the
log level is only the last three bits, and the flags/facility and
level are separated in 5.10 and later kernels, only print those last
three bits when using 'log -m'.

[ kh: modified commit message ]

Suggested-by: David Jeffery <djeffery@redhat.com>
Signed-off-by: John Pittman <jpittman@redhat.com>
2021-02-22 09:42:38 +09:00
Yunfeng Ye
33c322e929 mod: Show the base address of module
Currently the "mod" command shows the address of the module struct,
it is inconvenient to know the address range of the module, so extend
to show the base adddress.

[ kh: added help page update ]

Signed-off-by: Yunfeng Ye <yeyunfeng@huawei.com>
Signed-off-by: Kazuhito Hagio <k-hagio-ab@nec.com>
2021-01-26 10:34:50 +09:00
John Pittman
e4c1617e17 set: add ability to un-set scope
Currently there is no way to un-set the scope without having to
exit and re-enter crash.  The ability to un-set can come in very
useful when running automated pykdump scripts and needing scope to
be cleared between script runs.  Add the ability by allowing
vaddr 0 to be passed through gdb_set_crash_scope() and
gdb_command_funnel(), taking advantage of the !req->addr check in
gdb_set_crash_block(), enabling 'set scope 0' as a viable command.

Signed-off-by: John Pittman <jpittman@redhat.com>
2021-01-25 12:55:45 +09:00
Kazuhito Hagio
dad9e1eec0 Append time zone to output of date and time
Currently it's not easy to distinguish which time zone the output of
DATE uses:

  crash> sys | grep DATE
        DATE: Thu Nov 29 06:44:02 2018

Let's introduce ctime_tz() function like ctime() but explicitly appends
the time zone to its result string.

        DATE: Thu Nov 29 06:44:02 JST 2018

Resolves: https://github.com/crash-utility/crash/issues/62
Suggested-by: Jacob Wen <jian.w.wen@oracle.com>
Signed-off-by: Kazuhito Hagio <k-hagio-ab@nec.com>
2020-09-14 16:44:58 +09:00
Masanari Iida
314d8c74ff Fix six spelling typos in help.c 2020-07-09 10:58:15 +09:00
Dave Anderson
0f29a8ac6b Replace people.redhat.com references with github equivalents.
(anderson@redhat.com)
2020-05-08 11:46:04 -04:00
Dave Anderson
c86250bce2 Introduction of the "log -T" option, which translates the leading
timestamp value of each message into human readable format.
(w@laoqinren.net)
2020-04-21 14:37:20 -04:00
Dave Anderson
d379b47f04 Introduce a new ARM64 "--machdep vabits_actual=<value>" command
line option for Linux 5.4 and later dumpfiles, which require the
kernel's dynamically-determined "vabits_actual" value for virtual
address translation.  Without the patch, the crash session fails
during initialization with the error message "crash: cannot determine
VA_BITS_ACTUAL".  This option will become unnecessary when the
proposed TCR_EL1.T1SZ vmcoreinfo entry entry is incorporated into
the kernel.
(anderson@redhat.com)
2020-04-02 15:09:42 -04:00
Dave Anderson
007f844e6d Enhancement to the "bpf -p|-P" options to display the eBPF program
name string.
(k-hagio-ab@nec.com)
2020-03-05 14:25:02 -05:00
Dave Anderson
5dfbc7aa27 Introduction of a new "extend -s" option, which shows all available
shared object extension modules that are located in the directories
that are part of the normal search path that is used when a shared
object is loaded without a fully-qualified pathname.
(w@laoqinren.net)
2020-03-03 09:47:51 -05:00
Dave Anderson
0ab7ac3bea Update copyright to 2020 in crash version output. 2020-01-07 09:34:38 -05:00
Dave Anderson
b259940b22 Fix two typos in the examples section of the "help bt" display, which
mistakenly show "bf -f" and "bf -FF" instead of "bt -f" and "bt -FF".
(austindh.kim@gmail.com)
2019-11-21 09:27:52 -05:00
Dave Anderson
1d2bc0c657 Additional fix for the "kmem -n" option on Linux-5.4-rc1 and later
kernels that contain commit b6c88d3b9d38f9448e0fcf44847a075ea81d5ca2,
titled "drivers/base/memory.c: don't store end_section_nr in memory
blocks".  The initial fix only addressed the x86_64 architecture;
this incremental patch addresses the other architectures.
(msys.mizuma@gmail.com)
2019-10-21 11:46:01 -04:00
Dave Anderson
9937878cce Fix for the "kmem -n" option on Linux-5.4-rc1 and later kernels that
contain commit b6c88d3b9d38f9448e0fcf44847a075ea81d5ca2, titled
"drivers/base/memory.c: don't store end_section_nr in memory blocks".
Without the patch, the command option fails with the error message
"kmem: invalid structure member offset: memory_block_end_section_nr".
(msys.mizuma@gmail.com)
2019-10-17 12:00:23 -04:00
Dave Anderson
e1df72964f Fix for the "kmem -n" option on Linux 5.3-rc1 and later kernels
that contain commit 326e1b8f83a4318b09033ef754f40c785aed5e68,
titled "mm/sparsemem: introduce a SECTION_IS_EARLY flag".  Without
the patch, mem_map addresses containing the flag in bit 3 incorrectly
show it as part of the virtual address; with the patch, the option
displays the new "E" state flag.
(k-hagio@ab.jp.nec.com)
2019-07-26 14:31:33 -04:00
Dave Anderson
e6d8f0d8c7 Implemented a new "error" environment variable that sets the
destination of error messages.  It can be set to either:
  "default": error messages are always displayed on the
     console; if the output of a command is piped to an
     external command or redirected to a file, the error
     messages are also sent to the pipe or file.
  "redirect": if the output of a command is piped to an
     external command or redirected to a file, error messages
     are only sent to the pipe or file; otherwise they are
     displayed on the console.
  "filename": error messages are only sent to the specified
     filename; they are not displayed on the console and
     are not sent to a pipe or file.
(dkwon@redhat.com)
2019-07-15 15:06:37 -04:00
Dave Anderson
6c891b667f Add support for the "count" argument to be used in conjunction with
the "dis -r" and "dis -f" reverse/forward modes of operation.  In
reverse mode, the specified "count" number of instructions leading
up to and including the target address will be displayed.  In forward
mode, the display will be limited to "count" instructions.  Without
the patch, using a count argument in either mode generates a "count
argument ignored" message, and the command proceeds as if it had
not been entered.
(anderson@redhat.com, atomlin@redhat.com)
2019-07-09 15:08:16 -04:00
Dave Anderson
72654f8c62 Introduction of a new "rd -R" option, which will display memory in
reverse order.  Memory will be displayed up to and including the
address argument, which requires that the count argument be greater
than 1 in order to display memory before the specified address.
(anderson@redhat.com)
2019-07-02 15:41:58 -04:00
Dave Anderson
496d503e84 Extend the "timer" command with a new "TTE" column that displays the
remaining time in jiffies until the expiration of a timer entry, and
where a negative value displays the number of jiffies that have
elapsed since a timer has expired.
(oleksandr@redhat.com)
2019-06-26 14:57:49 -04:00
Dave Anderson
a000947e92 Introduction of a new "bt -p" option that generates a backtrace of
the panic task, regardless of the current context.  This option is
only applicable when running against dumpfiles in which the panic
task is known.
(atomlin@redhat.com)
2019-06-19 14:11:01 -04:00
Dave Anderson
3fe4602775 Document the "-N", "-g" and "-z" options in the "help" command's
help page.
(k-hagio@ab.jp.nec.com)
2019-05-07 11:46:22 -04:00
Dave Anderson
a5ed29730a Update the README file to indicate the capability of building an
x86_64 crash binary with "make target=PPC64", which can be used to
analyze ppc64le dumpfiles on an x86_64 host.
(anderson@redhat.com)
2019-04-25 14:30:37 -04:00
Dave Anderson
da8e4c9afc Fix for the "dev" help page to remove the unused -r option letter.
(surendra@chelsio.com)
2019-04-24 09:58:50 -04:00
Dave Anderson
71a4f36767 Linux 4.18 kernels introduced a new CONFIG_PROC_VMCORE_DEVICE_DUMP
configuration in commit 2724273e8fd00b512596a77ee063f49b25f36507,
titled "vmcore: add API to collect hardware dump in second kernel",
in which device drivers may collect a device specific snapshot of the
hardware/firmware state of their underlying devices, and export the
data as a kdump ELF note with type NT_VMCOREDD.  This patch
recognizes the new ELF note(s) in both ELF and compressed kdump
vmcore dumpfiles.  The "help -[nD]" option shows basic information
about each note, and two new "dev" command options have been
introduced.  The "dev -V" option displays an indexed list of each
note, showing the device name, the dumpfile offset, and the size
of each note.  The "dev -v index [file]" option either dumps the
contents of a note to the display screen in a human-readable format,
or copies the note data directly to a specified file.
(surendra@chelsio.com)
2019-04-23 14:36:56 -04:00
Dave Anderson
c4d4717194 Apply initial changes to support kernel address space layout
randomization (KASLR) for s390X.  This is the minimal patch-set
required to process s390x dumps for the kernels configured with
CONFIG_RANDOMIZE_BASE, and to accept the "--kaslr" command line
option.  Only dumpfiles whose headers contain kernel VMCOREINFO
data are supported.
(zaslonko@linux.ibm.com)
2019-04-05 10:31:23 -04:00
Dave Anderson
8618ddd817 First phase of support for ARM64 kernels that are configured with
CONFIG_ARM64_USER_VA_BITS_52, which causes the PTRS_PER_PGD count
to increase from 64 to 1024.  Without the patch, "WARNING: cannot
access vmalloc'd module memory" will be displayed during session
initialization, and the translation of any mapped kernel virtual
address that requires a page table walk will fail, leading to a
myriad of other errors.
(anderson@redhat.com)
2019-02-01 15:01:29 -05:00
Dave Anderson
c63d678798 Fix for Linux 4.20 and later x86_64 kernels which are NOT
configured with CONFIG_RANDOMIZE_BASE.  Linux 4.20 introduced
kernel commit d52888aa2753e3063a9d3a0c9f72f94aa9809c15, titled
"x86/mm: Move LDT remap out of KASLR region on 5-level paging",
which modified the 4-level and 5-level paging PAGE_OFFSET values.
Without this patch, the crash session fails during initialization
with the error message "crash: read error: kernel virtual address:
<address>  type: tss_struct ist array".  For kernels prior to
Linux 4.20.0 which have backports of the kernel commit, the kernel's
PAGE_OFFSET value must be manually specified via the command line
option "--machdep page_offset=ffff888000000000" for kernels with
4-level page tables, or "--machdep page_offset=ff11000000000000"
for kernels with 5-level paging.  (or alternatively the shorter
version "-m page_offset=<address>" may be used).  The command
line option requirement may be revisited in the future.
(anderson@redhat.com)
2019-01-18 14:19:18 -05:00
Dave Anderson
361f050e31 Fix for the "dev -[dD]" options in kernels containing Linux 5.0-rc1
commit 7ff4f8035695984c513598e2d49c8277d5d234ca, titled "block:
remove dead queue members", in which the number of I/Os issued to
a disk driver are no longer stored in the request_queue structure.
Without the patch, the options indicate "dev: -d option not supported
or applicable on this architecture or kernel".  With the patch, the
"DRV" column is not shown.
(m.mizuma@jp.fujitsu.com)
2019-01-07 13:56:15 -05:00
Dave Anderson
1baaafc0a4 Red Hat copyright 2019 2019-01-03 14:57:36 -05:00
Dave Anderson
93d51ee09a Update crash banner copyright year range 2018-11-27 10:02:31 -05:00
Dave Anderson
c88e361635 Added a new "tree -t xarray" option to display of the contents of
an XArray in Linux 4.20 and later kernels.  The implementation is
similar to that of radix tree displays, but in addition, the "-p"
option will also display the index value of each entry in a radix
tree or XArray.
(anderson@redhat.com)
2018-11-16 14:43:43 -05:00
Dave Anderson
e342618cb4 Enhancement to the "kmem -n" option to dump memory block information
if the kernel supports it.  In addition, the memory section data
block has a new "STATE" column added to it.
(m.mizuma@jp.fujitsu.com)
2018-10-04 16:52:22 -04:00
Dave Anderson
e541c5ca27 Introduction of a new "kmem -r" option. With the implementation of
per-cgroup kmem_cache slabs, the number of slab caches displayed by
"kmem -s" can number into the thousands.  Similar to /proc/slabinfo,
this new option displays the accumulated data of the root cache and
its children.  It is limited to Linux 4.11 and later kernels that
contain the "slab_root_caches" list.  Currently the command option
is restricted to kernels configured with CONFIG_SLUB.
(k-hagio@ab.jp.nec.com)
2018-08-24 15:17:12 -04:00
Dave Anderson
e9532aea68 As an addendum to the new "kmem -[sS]" output format, align the slab
cache name string so that it is beneath the "NAME" header column when
the "kmem -I &lt;slab-cache>" option is used to ignore a slab cache,
or if the scan of the metadata of a slab cache enounters corruption.
Also remove a superfluous line from the "help kmem" description of
the "kmem -I" option.
(k-hagio@ab.jp.nec.com, anderson@redhat.com)
2018-08-09 11:20:26 -04:00
Dave Anderson
455da1ae5c Modify the output of the "kmem -[sS]" header and contents such that
the slab cache name string is moved from the second column to the
the last column.  Since the slab cache name strings have become
increasingly longer over time, without the patch, the numerical
column contents may be skewed so far to the right that the output
becomes difficult to read.
(k-hagio@ab.jp.nec.com)
2018-08-08 14:20:21 -04:00
Dave Anderson
a10917ba32 Update for "ps" and "foreach" commands to display and recognize two
new process states, "ID" for the TASK_IDLE macro introduced in
Linux 4.2, and "NE" for the TASK_NEW bit introduced in Linux 4.8.
(k-hagio@ab.jp.nec.com)
2018-07-19 13:43:07 -04:00
Dave Anderson
6596f1121b The existing "list" command uses a hash table to detect duplicate
items as it traverses the list.  The hash table approach has worked
well for many years.  However, with increasing memory sizes and list
sizes, the overhead of the hash table can be substantial, often
leading to commands running for a very long time.  For large lists,
we have found that the existing hash based approach may slow the
system to a crawl and possibly never complete.  You can turn off
the hash with "set hash off" but then there is no loop detection; in
that case, loop detection must be done manually after dumping the
list to disk or some other method.  This patch is an implementation
of the cycle detection algorithm from R. P. Brent as an alternative
algorithm for the "list" command.  The algorithm both avoids the
overhead of the hash table and yet is able to detect a loop.  In
addition, further loop characteristics are printed, such as the
distance to the start of the loop as well as the loop length.
An excellent description of the algorithm can be found here on
the crash-utility mailing list:

https://www.redhat.com/archives/crash-utility/2018-July/msg00019.html

A new "list -B" option has been added to the "list" command to
invoke this new algorithm rather than using the hash table.  In
addition to low memory usage, the output of the list command is
slightly different when a loop is detected.  In addition to printing
the first duplicate entry, the length of the loop, and the distance
to the loop is output.
(dwysocha@redhat.com)
2018-07-11 16:25:59 -04:00