[PATCH v2] add option -s and -S for subcommand irq
by zhangyanfei
Re-posting two patch as attachments. I'm sorry for the problems on the
first pass. I have tested the two patches on RHEL 5.8beta (x86, x86_64)
, RHEL 6.2ga (x86, x86_64), and RHEL 6.2ga with kernel 3.2 (x86, x86_64).
--
Hello Dave,
The subcommand irq can dump the most of the irq information. Here I add
some options to make some improvements for irq.
1. option '-s': display the cpu affinity for in-use IRQs.
2. option '-S' and '-c': display the percpu irq stats. -c is used to
specify the cpu for which irq stats should be displayed. Without option
-c, 'irq -S' displays the irq stats for all cpus. The output of this
option is just like 'cat /proc/interrupts' shows.
Two patches attched:
-s: 0001-Add-s-option-for-irq-to-dump-the-cpu-affinity-of-in-.patch
-S and -c: 0002-Add-S-and-c-option-for-irq-to-dump-the-kernel-irq-st.patch
And the second patch is made at the base of the first patch.
Thanks.
Zhang Yanfei
12 years, 10 months
[PATCH] ARM now uses .init.text
by Rabin Vincent
Recent ARM kernels (since
http://git.kernel.org/linus/1604d79d372bcf0cf1aebcbdee251bd0f3d56665),
use .init.text instead of .init for the init text.
The patch below handles this.
Rabin
diff --git a/symbols.c b/symbols.c
index a68b585..f836101 100755
--- a/symbols.c
+++ b/symbols.c
@@ -480,14 +480,14 @@ no_debugging_data(int error_type)
void
get_text_init_space(void)
{
- asection *section;
+ asection *section = NULL;
if (pc->flags & SYSMAP)
return;
if (machine_type("ARM"))
section = get_kernel_section(".init");
- else if ((section = get_kernel_section(".text.init")) == NULL)
+ if (!section && (section = get_kernel_section(".text.init")) == NULL)
section = get_kernel_section(".init.text");
if (!section) {
error(WARNING, "cannot determine text init space\n");
12 years, 10 months
x86 remap allocator in kernel 3.0
by Petr Tesarik
Hi folks,
I've just discovered that the crash utility fails to initialize the vm
subsystem properly on our latest SLES 32-bit kernels. It turns out that our
kernels are compiled with CONFIG_DISCONTIGMEM=y, which causes pgdat structs to
be allocated by the remap allocator (cf. arch/x86/mm/numa_32.c and also the
code in setup_node_data).
If you don't know what the remap allocator is (like I didn't before I hit the
bug), it's a very special early-boot allocator which remaps physical pages
from low memory to high memory, giving them virtual addresses from the
identity mapping. Looks a bit like this:
physical addr
+------------+
| |
+------------+
+--> | KVA RAM |
| +------------+
| | |
| \/\/\/\/\/\/\/
| /\/\/\/\/\/\/\
| | |
virtual addr | | highmem |
+------------+ | |------------|
| | -----> | |
+------------+ | +------------+
| remap va | --+ | KVA PG | (unused)
+------------+ +------------+
| | | |
| | -----> | RAM bottom |
+------------+ +------------+
This breaks a very basic assumption that crash makes about low-memory virtual
addresses.
The attached patch fixes the issue for me, but may not be the cleanest method
to handle these mappings.
Ken'ichi Ohmichi, please note that makedumpfile is also affected by this
deficiency. On my test system, it will fail to produce any output if I set
dump level to anything greater than zero:
makedumpfile -c -d 31 -x vmlinux-3.0.13-0.5-pae.debug vmcore kdump.31
readmem: Can't convert a physical address(34a012b4) to offset.
readmem: type_addr: 0, addr:f4a012b4, size:4
get_mm_discontigmem: Can't get node_start_pfn.
makedumpfile Failed.
However, fixing this for makedumpfile is harder, and it will most likely
require a few more lines in VMCOREINFO, because debug symbols may not be
available at dump time, and I can't see any alternative method to locate the
remapped regions.
Regards,
Petr Tesarik
SUSE Linux
12 years, 10 months
Incorrect HighMem statistics
by Petr Tesarik
Hi all,
it seems crash shows incorrect HighMem stats with recent kernels. E.g.:
crash> kmem -i
[...]
TOTAL HIGH 1821682 6.9 GB 93% of TOTAL MEM
FREE HIGH 0 0 0% of TOTAL HIGH
TOTAL LOW 132983 519.5 MB 6% of TOTAL MEM
FREE LOW 1333474 5.1 GB 1002% of TOTAL LOW
BTW note that total low is smaller than free low, which is obviously
incorrect. I believe that this is somehow related to the Movable zone, because
the code that counts free low pages checks for pages which belong to
ZONE_HIGHMEM, which is initialized as:
vt->ZONE_HIGHMEM = vt->nr_zones - 1;
My system has 4 zones:
ZONE NAME SIZE MEM_MAP START_PADDR START_MAPNR
0 DMA 4080 f4a02200 10000 0
1 Normal 221694 f4a22000 1000000 4080
2 HighMem 790002 f50e5fc0 371fe000 225774
3 Movable 0 0 0 0
And indeed, "help -v" shows:
[...]
dump_free_pages: dump_free_pages_zones_v2()
[...]
ZONE_HIGHMEM: 3
I don't know yet how to fix this, but maybe somebody can push me in the right
direction.
Petr Tesarik
SUSE Linux
12 years, 10 months
Re: [Crash-utility] [PATCH] add option -s and -S for subcommand irq
by zhangyanfei
Hello Dave,
>> Hello Dave,
>>
>> The subcommand irq can dump the most of the irq information. Here I add
>> some options to make some improvements for irq.
>> 1. option '-s': display the cpu affinity for in-use IRQs.
>> 2. option '-S' and '-c': display the percpu irq stats. -c is used to
>> specify the cpu for which irq stats should be displayed. Without option
>> -c, 'irq -S' displays the irq stats for all cpus. The output of this
>> option is just like 'cat /proc/interrupts' shows.
>>
>> Two patches attched:
>> -s: 0001-Add-s-option-for-irq-to-dump-the-cpu-affinity-of-in-.patch
>> -S and -c: 0002-Add-S-and-c-option-for-irq-to-dump-the-kernel-irq-st.patch
>> And the second patch is made at the base of the first patch.
>>
>> Thanks,
>> Zhang Yanfei
>
> Hello Zhang,
>
> While it seems to work with RHEL5 and RHEL6 kernels, when I tried this
> with a relatively recent (3.1.1-2.fc16) Fedora kernel, both options fail:
>
> $ crash vmlinux.gz vmcore
> crash 6.0.3rc8
> Copyright (C) 2002-2012 Red Hat, Inc.
> Copyright (C) 2004, 2005, 2006 IBM Corporation
> Copyright (C) 1999-2006 Hewlett-Packard Co
> Copyright (C) 2005, 2006 Fujitsu Limited
> Copyright (C) 2006, 2007 VA Linux Systems Japan K.K.
> Copyright (C) 2005 NEC Corporation
> Copyright (C) 1999, 2002, 2007 Silicon Graphics, Inc.
> Copyright (C) 1999, 2000, 2001, 2002 Mission Critical Linux, Inc.
> This program is free software, covered by the GNU General Public License,
> and you are welcome to change it and/or distribute copies of it under
> certain conditions. Enter "help copying" to see the conditions.
> This program has absolutely no warranty. Enter "help warranty" for details.
>
> GNU gdb (GDB) 7.3.1
> Copyright (C) 2011 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later<http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law. Type "show copying"
> and "show warranty" for details.
> This GDB was configured as "x86_64-unknown-linux-gnu"...
>
> KERNEL: vmlinux.gz
> DUMPFILE: vmcore
> CPUS: 12
> DATE: Tue Nov 15 16:33:21 2011
> UPTIME: 00:03:33
> LOAD AVERAGE: 0.26, 0.26, 0.12
> TASKS: 185
> NODENAME: amd-pence-01.lab.bos.redhat.com
> RELEASE: 3.1.1-2.fc16.x86_64
> VERSION: #1 SMP Mon Nov 14 15:46:10 UTC 2011
> MACHINE: x86_64 (1895 Mhz)
> MEMORY: 1 GB
> PANIC: ""
> PID: 3917
> COMMAND: "crash"
> TASK: ffff88003c1a5cc0 [THREAD_INFO: ffff88003cc3e000]
> CPU: 6
> STATE: TASK_RUNNING (PANIC)
>
> crash> irq -S
> CPU0 CPU1 CPU2 CPU3 CPU4 CPU5 CPU6 CPU7 CPU8 CPU9 CPU10
> CPU11
> irq: invalid kernel virtual address: 16134 type: "kstat_irqs"
> crash> irq -s
> IRQ NAME AFFINITY
> Segmentation fault
> $
>
> I don't know what the "kstat_irqs" problem is with "irq -S", but here's
> a trace of the "irq -s" attempt:
>
> $ gdb ./crash
> ... [ cut ] ...
> (gdb) run vmlinux vmcore
> ... [cut ] ...
> crash> irq -s
> [Detaching after fork from child process 10843.]
> IRQ NAME AFFINITY
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x00000000004b437a in generic_get_irq_affinity (irq=<value optimized out>) at kernel.c:4961
> 4961 if (NUM_IN_BITMAP(mask, cpu)) {
> (gdb) bt
> #0 0x00000000004b437a in generic_get_irq_affinity (irq=<value optimized out>) at kernel.c:4961
> #1 0x00000000004b63e5 in cmd_irq () at kernel.c:4803
> #2 0x0000000000459e30 in exec_command () at main.c:751
> #3 0x000000000045a0de in main_loop () at main.c:699
> #4 0x0000000000552029 in captured_command_loop (data=0xe) at ./main.c:228
> #5 0x00000000005511fb in catch_errors (func=0x552020<captured_command_loop>, func_args=0x0, errstring=0x8485b7 "",
> mask=<value optimized out>) at exceptions.c:531
> #6 0x0000000000552786 in captured_main (data=<value optimized out>) at ./main.c:958
> #7 0x00000000005511fb in catch_errors (func=0x552060<captured_main>, func_args=0x7fffdda9dc70, errstring=0x8485b7 "",
> mask=<value optimized out>) at exceptions.c:531
> #8 0x0000000000551dc4 in gdb_main (args=0x0) at ./main.c:973
> #9 0x0000000000551e06 in gdb_main_entry (argc=<value optimized out>, argv=0x0) at ./main.c:993
> #10 0x000000000045dd3f in main (argc=3, argv=0x7fffdda9ef68) at main.c:603
> (gdb)
>
I am sorry for not testing the two patches with the relatively recent
kernel, and I will do this immediately.
> Also, the output of "irq -S" gets really unmanageable if the system has
> a lot of cpus. I'm not sure what to suggest there.
>
I also add one option ‘-c’ to specify the cpu of which the irq stats
will be displayed.
crash> irq -c 1-3,7 -S
CPU1 CPU2 CPU3 CPU7
0: 0 0 0 0 IR-IO-APIC-edge
timer
1: 0 0 0 0 IR-IO-APIC-edge
i8042
8: 0 0 0 0 IR-IO-APIC-edge
rtc0
9: 0 0 0 0 IR-IO-APIC-fasteoi
acpi
16: 0 0 0 0 IR-IO-APIC-fasteoi <cut>
/proc/interrupts also outputs the same format as 'irq -S'. The reason
for putting all cpus's per-irq stats in one line is that we can easily
use awk command or other script as one liner. For example, if we want
CPU24 line of the 'irq -S' output only, we can use awk command in crash
as follows:
crash> irq -S | awk '!/CPU/ {printf("%s %s %s\n", $1, $25, $26)}'
0: 0 IR-IO-APIC-edge
1: 0 IR-IO-APIC-edge
8: 0 IR-IO-APIC-edge
9: 0 IR-IO-APIC-fasteoi
16: 0 IR-IO-APIC-fasteoi
17: 0 IR-IO-APIC-fasteoi
18: 0 IR-IO-APIC-fasteoi
<cut>
> Dave
>
> --
> Crash-utility mailing list
> Crash-utility(a)redhat.com
> https://www.redhat.com/mailman/listinfo/crash-utility
>
>
Thanks.
Zhang Yanfei
--
> Regards
> Zhang Yanfei
> --------------------------------------------------
> Development Dept.I
> Nanjing Fujitsu Nanda Software Tech. Co., Ltd.(FNST)
> No. 6 Zhushan Road, Nanjing, 210012, China
> TEL: +86+25-86630566-8529
> FUJITSU INTERNAL: 7998-8529
> EMail: zhangyanfei(a)cn.fujitsu.com
> --------------------------------------------------
12 years, 10 months
[PATCH] add option -s and -S for subcommand irq
by zhangyanfei
Hello Dave,
The subcommand irq can dump the most of the irq information. Here I add
some options to make some improvements for irq.
1. option '-s': display the cpu affinity for in-use IRQs.
2. option '-S' and '-c': display the percpu irq stats. -c is used to
specify the cpu for which irq stats should be displayed. Without option
-c, 'irq -S' displays the irq stats for all cpus. The output of this
option is just like 'cat /proc/interrupts' shows.
Two patches attched:
-s: 0001-Add-s-option-for-irq-to-dump-the-cpu-affinity-of-in-.patch
-S and -c: 0002-Add-S-and-c-option-for-irq-to-dump-the-kernel-irq-st.patch
And the second patch is made at the base of the first patch.
Thanks,
Zhang Yanfei
--
> Regards
> Zhang Yanfei
> --------------------------------------------------
> Development Dept.I
> Nanjing Fujitsu Nanda Software Tech. Co., Ltd.(FNST)
> No. 6 Zhushan Road, Nanjing, 210012, China
> TEL: +86+25-86630566-8529
> FUJITSU INTERNAL: 7998-8529
> EMail: zhangyanfei(a)cn.fujitsu.com
> --------------------------------------------------
12 years, 10 months
kmem -s issue (gdb can't get offest of struct page lru member)
by Michael Holzheu
Hello Dave,
When issuing "kmem -s" with crash 6.0.2 (same with 6.0.0) on a s390x
linux-3.2 kernel dump, I get the following:
...
1ff0a600 signal_cache 1104 112 150 6 32k
1ff0a540 sighand_cache 2088 82 98 7 32k
kmem: invalid structure member offset: page_lru
FILE: memory.c LINE: 15856 FUNCTION: count_partial()
[./crash] error trace: 80099674 => 80097156 => 80083c40 => 801206ba
801206ba: OFFSET_verify+138
80083c40: get_kmem_cache_slub_data+1028
80097156: dump_kmem_cache_slub+902
80099674: cmd_kmem+6636
kmem: invalid structure member offset: page_lru
FILE: memory.c LINE: 15856 FUNCTION: count_partial()
I think the reason is that MEMBER_OFFSET_INIT(page_lru, "page", "lru") fails.
See the following gdb session:
Breakpoint 1, vm_init () at memory.c:375
375 MEMBER_OFFSET_INIT(page_lru, "page", "lru");
(gdb) s
datatype_info (name=0x80415c4a "page", member=0x803ce36c "lru", dm=0x0)
at symbols.c:4919
4919 if (dm == ANON_MEMBER_OFFSET_REQUEST)
(gdb) n
4922 strcpy(buf, name);
(gdb) n
4924 req = (struct gnu_request *)GETBUF(sizeof(struct gnu_request));
(gdb) n
4925 req->command = GNU_GET_DATATYPE;
(gdb) n
4926 req->flags |= GNU_RETURN_ON_ERROR;
(gdb) n
4927 req->name = buf;
(gdb) n
4928 req->member = member;
(gdb) n
4929 req->fp = pc->nullfp;
(gdb) n
4931 gdb_interface(req);
(gdb) n
4932 if (req->flags & GNU_COMMAND_FAILED) {
(gdb) print *req
$1 = {command = 5, buf = 0x0, fp = 0x8060d540, addr = 0, addr2 = 0, count = 0,
flags = 8, name = 0x3ffffffda94 "page", length = 56, typecode = 3,
typename = 0x0, target_typename = 0x0, target_length = 0,
target_typecode = 0, is_typedef = 0, member = 0x803ce36c "lru",
member_offset = -1, member_length = 0, member_typecode = 0, value = 0,
tagname = 0x0, pc = 0, sp = 0, ra = 0, curframe = 0, frame = 0, prevsp = 0,
prevpc = 0, lastsp = 0, task = 0, debug = 0, hookp = 0x0}
---> member_offset = -1
(gdb) n
4937 if (!req->typecode) {
(gdb) n
4942 if (!req->typecode) {
(gdb) n
4947 member_typecode = TYPE_CODE_UNDEF;
(gdb) n
4948 member_size = 0;
(gdb) n
4949 type_found = 0;
(gdb) n
4951 if (CRASHDEBUG(2)) {
(gdb) n
4965 switch (req->typecode)
(gdb) n
4968 type_found = STRUCT_REQUEST;
(gdb) n
4969 size = req->length;
(gdb) n
4970 if (req->member_offset >= 0) {
(gdb) n
4975 offset = -1;
(gdb) n
4976 member_size = 0;
Also crash can't evaluate the offset of the "lru" member:
crash> struct page
struct page {
long unsigned int flags;
struct address_space *mapping;
struct {
union {...};
union {...};
};
union {
struct list_head lru;
struct {...};
};
union {
long unsigned int private;
spinlock_t ptl;
struct kmem_cache *slab;
struct page *first_page;
};
}
SIZE: 56
crash> struct page.mapping
struct page {
[8] struct address_space *mapping;
}
crash> struct page.lru
struct: invalid data structure reference: page.lru
Any idea why we do not get the offset from gdb?
Perhaps a problem with the anonymous union?
Michael
12 years, 10 months
[PATCH v3 0/4] Kdump core analysis support for PPC32
by Suzuki K. Poulose
The following series implements the kdump core analysis support
for PPC32. I have posted the KDUMP kernel support patches for PPC440x
here :
http://lists.ozlabs.org/pipermail/linuxppc-dev/2011-December/094994.html
You need upstream git snapshot of kexec-tools for kdump support on PPC440x.
These patches are based on crash-6.0.2
Changes since V2:
* Fixed Makefile and gdb-7.3.1.patch to not add -m64 to CFLAGS when
building for PPC on PPC64
* Fixed compiler warnings and errors.
TODO:
* Fix vmalloc address translations for BookE. I will send a separate patch
for this one.
---
Suzuki K. Poulose (4):
[ppc] Fix miscellaneous compiler warnings
[ppc] Enable stack trace display for KDUMP cores
[ppc][netdump] Read register set from ELF note for PPC32
[ppc] Support PPC32 Core analysis on PPC64
Makefile | 6 +--
configure.c | 14 ++++++-
gdb-7.3.1.patch | 4 +-
netdump.c | 77 ++++++++++++++++++++++++++++++++++++
ppc.c | 118 +++++++++++++++++++++++++++++++++++++------------------
5 files changed, 174 insertions(+), 45 deletions(-)
--
Suzuki K. Poulose
12 years, 10 months
[PATCH] Add read diagnostics to crash
by David Mair
I have been shown several alleged crash bugs that much effort revealed to be actually just incomplete or corrupt dump files. This set of changes adds a debug level 8 set of messages that allows for an easier optional diagnosis of faulty crash dumps through the runtime read_mem() instance and it's behavior and adds some optional messages for identifiable error cases that currently only use error codes that aren't uniquely found in the source.
This patch is based on crash-6.0.2
Signed-off-by: David Mair <dmair(a)suse.com>
---
diff --git a/a/diskdump.c b/b/diskdump.c
index 5519af7..7cad9dc 100644
--- a/a/diskdump.c
+++ b/b/diskdump.c
@@ -432,6 +432,8 @@ restart:
dd->dumpable_bitmap = calloc(bitmap_len, 1);
+ if (CRASHDEBUG(8))
+ error(INFO, " memory bitmap: %llx\n", offset);
if (FLAT_FORMAT()) {
if (!read_flattened_format(dd->dfd, offset, dd->bitmap, bitmap_len)) {
error(INFO, "%s: cannot read memory bitmap\n",
@@ -829,6 +831,9 @@ read_diskdump(int fd, void *bufptr, int cnt, ulong addr, physaddr_t paddr)
pfn = paddr_to_pfn(paddr);
+ if (CRASHDEBUG(8))
+ error(INFO, "read_diskdump(%d, %llx, %d, %lx, %llx), pfn=%lx\n",
+ fd, (ulonglong)bufptr, cnt, addr, (ulonglong)paddr, pfn);
if (KDUMP_SPLIT()) {
/* Find proper dd */
int i;
@@ -844,27 +849,54 @@ read_diskdump(int fd, void *bufptr, int cnt, ulong addr, physaddr_t paddr)
}
}
- if (i == num_dumpfiles)
+ if (i == num_dumpfiles) {
+ if (CRASHDEBUG(8))
+ error(INFO, "Address is beyond last dumpfile.\n");
return SEEK_ERROR;
+ }
}
curpaddr = paddr & ~((physaddr_t)(dd->block_size-1));
page_offset = paddr & ((physaddr_t)(dd->block_size-1));
- if ((pfn >= dd->header->max_mapnr) || !page_is_ram(pfn))
+ if ((pfn >= dd->header->max_mapnr) || !page_is_ram(pfn)) {
+ if (CRASHDEBUG(8) && (pfn >= dd->header->max_mapnr))
+ error(INFO, "pfn (%lx) is >= maximum map number (%lx)\n",
+ pfn, dd->header->max_mapnr);
+ if (CRASHDEBUG(8) && !page_is_ram(pfn))
+ error(INFO, "pfn (%lx) is not in ram\n", pfn);
return SEEK_ERROR;
+ }
if (!page_is_dumpable(pfn)) {
if ((dd->flags & (ZERO_EXCLUDED|ERROR_EXCLUDED)) ==
- ERROR_EXCLUDED)
+ ERROR_EXCLUDED) {
+ if (CRASHDEBUG(8))
+ error(INFO, "pfn (%lx) is excluded\n", pfn);
return PAGE_EXCLUDED;
+ }
+ if (CRASHDEBUG(8))
+ error(INFO, "Zero-filling page with pfn=%lx\n", pfn);
memset(bufptr, 0, cnt);
return cnt;
}
- if (!page_is_cached(curpaddr))
- if ((ret = cache_page(curpaddr)) < 0)
+ if (!page_is_cached(curpaddr)) {
+ if (CRASHDEBUG(8))
+ error(INFO, "caching page with current physaddr=%llx\n",
+ curpaddr);
+ if ((ret = cache_page(curpaddr)) < 0) {
+ if (CRASHDEBUG(8))
+ error(INFO, "Failed with err=%d to cache page "
+ "with current physaddr=%llx\n",
+ ret, curpaddr);
return ret;
+ }
+ }
+ if (CRASHDEBUG(8))
+ error(INFO, "Buffering page with pfn=%lx and current "
+ "physaddr=%llx\n",
+ pfn, curpaddr);
memcpy(bufptr, dd->curbufptr + page_offset, cnt);
return cnt;
diff --git a/a/filesys.c b/b/filesys.c
index 6994fb0..7a8ec3d 100755
--- a/a/filesys.c
+++ b/b/filesys.c
@@ -163,6 +163,8 @@ memory_source_init(void)
error(INFO, "using /dev/mem\n\n");
pc->flags &= ~MEMMOD;
pc->flags |= DEVMEM;
+ if (CRASHDEBUG(8))
+ error(INFO, "Setting readmem to read_dev_mem\n");
pc->readmem = read_dev_mem;
pc->writemem = write_dev_mem;
pc->live_memsrc = "/dev/mem";
@@ -3382,6 +3384,8 @@ get_live_memory_source(void)
if (use_module) {
pc->flags &= ~DEVMEM;
pc->flags |= MEMMOD;
+ if (CRASHDEBUG(8))
+ error(INFO, "Setting readmem to read_memory_device\n");
pc->readmem = read_memory_device;
pc->writemem = write_memory_device;
pc->live_memsrc = pc->memory_device;
@@ -3390,6 +3394,9 @@ get_live_memory_source(void)
if (crashbuiltin) {
pc->flags &= ~DEVMEM;
pc->flags |= CRASHBUILTIN;
+ if (CRASHDEBUG(8))
+ error(INFO, "Setting readmem to "
+ "read_memory_device/builtin\n");
pc->readmem = read_memory_device;
pc->writemem = write_memory_device;
pc->live_memsrc = pc->memory_device;
diff --git a/a/main.c b/b/main.c
index ae8d933..5440c72 100755
--- a/a/main.c
+++ b/b/main.c
@@ -431,6 +431,9 @@ main(int argc, char **argv)
}
pc->flags |= DEVMEM;
pc->dumpfile = NULL;
+ if (CRASHDEBUG(8))
+ error(INFO, "Setting readmem to "
+ "read_dev_mem\n");
pc->readmem = read_dev_mem;
pc->writemem = write_dev_mem;
pc->live_memsrc = argv[optind];
@@ -443,6 +446,9 @@ main(int argc, char **argv)
}
pc->flags |= PROC_KCORE;
pc->dumpfile = NULL;
+ if (CRASHDEBUG(8))
+ error(INFO, "Setting readmem to "
+ "read_proc_kcore\n");
pc->readmem = read_proc_kcore;
pc->writemem = write_proc_kcore;
pc->live_memsrc = argv[optind];
@@ -457,9 +463,15 @@ main(int argc, char **argv)
pc->dumpfile = argv[optind];
if (is_sadump_xen()) {
+ if (CRASHDEBUG(8))
+ error(INFO, "Setting readmem to "
+ "read_kdump\n");
pc->readmem = read_kdump;
pc->writemem = write_kdump;
} else {
+ if (CRASHDEBUG(8))
+ error(INFO, "Setting readmem to "
+ "read_netdump\n");
pc->readmem = read_netdump;
pc->writemem = write_netdump;
}
@@ -472,6 +484,9 @@ main(int argc, char **argv)
}
pc->flags |= KDUMP;
pc->dumpfile = argv[optind];
+ if (CRASHDEBUG(8))
+ error(INFO, "Setting readmem to "
+ "read_kdump for KDUMP_LOCAL\n");
pc->readmem = read_kdump;
pc->writemem = write_kdump;
@@ -483,6 +498,9 @@ main(int argc, char **argv)
}
pc->flags |= KVMDUMP;
pc->dumpfile = argv[optind];
+ if (CRASHDEBUG(8))
+ error(INFO, "Setting readmem to "
+ "read_kvmdump\n");
pc->readmem = read_kvmdump;
pc->writemem = write_kvmdump;
@@ -502,6 +520,9 @@ main(int argc, char **argv)
}
pc->flags |= XENDUMP;
pc->dumpfile = argv[optind];
+ if (CRASHDEBUG(8))
+ error(INFO, "Setting readmem to "
+ "read_xendump\n");
pc->readmem = read_xendump;
pc->writemem = write_xendump;
@@ -518,6 +539,9 @@ main(int argc, char **argv)
}
pc->flags |= DISKDUMP;
pc->dumpfile = argv[optind];
+ if (CRASHDEBUG(8))
+ error(INFO, "Setting readmem to "
+ "read_diskdump\n");
pc->readmem = read_diskdump;
pc->writemem = write_diskdump;
@@ -529,6 +553,9 @@ main(int argc, char **argv)
}
pc->flags |= LKCD;
pc->dumpfile = argv[optind];
+ if (CRASHDEBUG(8))
+ error(INFO, "Setting readmem to "
+ "read_lkcddump\n");
pc->readmem = read_lkcd_dumpfile;
pc->writemem = write_lkcd_dumpfile;
@@ -540,6 +567,9 @@ main(int argc, char **argv)
}
pc->flags |= MCLXCD;
pc->dumpfile = argv[optind];
+ if (CRASHDEBUG(8))
+ error(INFO, "Setting readmem to "
+ "read_mclxdump\n");
pc->readmem = read_mclx_dumpfile;
pc->writemem = write_mclx_dumpfile;
@@ -551,6 +581,9 @@ main(int argc, char **argv)
}
pc->flags |= S390D;
pc->dumpfile = argv[optind];
+ if (CRASHDEBUG(8))
+ error(INFO, "Setting readmem to "
+ "read_s390_dumpfile\n");
pc->readmem = read_s390_dumpfile;
pc->writemem = write_s390_dumpfile;
@@ -563,6 +596,9 @@ main(int argc, char **argv)
}
pc->flags |= SADUMP;
pc->dumpfile = argv[optind];
+ if (CRASHDEBUG(8))
+ error(INFO, "Setting readmem to "
+ "read_sadump\n");
pc->readmem = read_sadump;
pc->writemem = write_sadump;
@@ -950,6 +986,8 @@ setup_environment(int argc, char **argv)
pc->flags |= DATADEBUG; /* default until unnecessary */
pc->confd = -2;
pc->machine_type = MACHINE_TYPE;
+ if (CRASHDEBUG(8))
+ error(INFO, "Setting readmem to default read_dev_mem\n");
pc->readmem = read_dev_mem; /* defaults until argv[] is parsed */
pc->writemem = write_dev_mem;
pc->memory_module = NULL;
@@ -1600,8 +1638,11 @@ check_xen_hyper(void)
#ifdef XEN_HYPERVISOR_ARCH
pc->cmd_table = xen_hyper_command_table;
- if (pc->flags & XENDUMP)
+ if (pc->flags & XENDUMP) {
+ if (CRASHDEBUG(8))
+ error(INFO, "Setting readmem to read_xendump_hyper\n");
pc->readmem = read_xendump_hyper;
+ }
#else
error(FATAL, XEN_HYPERVISOR_NOT_SUPPORTED);
#endif
diff --git a/a/memory.c b/b/memory.c
index 95eefc9..ac64767 100755
--- a/a/memory.c
+++ b/b/memory.c
@@ -2215,6 +2215,8 @@ switch_to_proc_kcore(void)
pc->flags &= ~DEVMEM;
pc->flags |= PROC_KCORE;
+ if (CRASHDEBUG(8))
+ error(INFO, "Setting readmem to read_proc_kcore for memory.c\n");
pc->readmem = read_proc_kcore;
pc->writemem = write_proc_kcore;
pc->live_memsrc = "/proc/kcore";
diff --git a/a/netdump.c b/b/netdump.c
index 4011f36..28989c9 100644
--- a/a/netdump.c
+++ b/b/netdump.c
@@ -495,6 +495,10 @@ read_netdump(int fd, void *bufptr, int cnt, ulong addr, physaddr_t paddr)
off_t offset;
struct pt_load_segment *pls;
int i;
+
+ if (CRASHDEBUG(8))
+ error(INFO, "read_netdump(%d, %llx, %d, %lx, %llx)\n",
+ fd, (ulonglong)bufptr, cnt, addr, (ulonglong)paddr);
offset = 0;
@@ -509,6 +513,9 @@ read_netdump(int fd, void *bufptr, int cnt, ulong addr, physaddr_t paddr)
{
case NETDUMP_ELF32:
offset = (off_t)paddr + (off_t)nd->header_size;
+ if (CRASHDEBUG(8))
+ error(INFO, "read NETDUMP_ELF32 for offset: %llx\n",
+ (ulonglong)offset);
break;
case NETDUMP_ELF64:
@@ -517,6 +524,10 @@ read_netdump(int fd, void *bufptr, int cnt, ulong addr, physaddr_t paddr)
if (nd->num_pt_load_segments == 1) {
offset = (off_t)paddr + (off_t)nd->header_size -
(off_t)nd->pt_load_segments[0].phys_start;
+ if (CRASHDEBUG(8))
+ error(INFO, "read KDUMP or NETDUMP_ELF64 for "
+ "single segment: %llx\n",
+ (ulonglong)offset);
break;
}
@@ -526,11 +537,18 @@ read_netdump(int fd, void *bufptr, int cnt, ulong addr, physaddr_t paddr)
(paddr < pls->phys_end)) {
offset = (off_t)(paddr - pls->phys_start) +
pls->file_offset;
+ if (CRASHDEBUG(8))
+ error(INFO, "read KDUMP or NETDUMP_ELF64 "
+ "for multi-segment: %llx\n",
+ (ulonglong)offset);
break;
}
if (pls->zero_fill && (paddr >= pls->phys_end) &&
(paddr < pls->zero_fill)) {
memset(bufptr, 0, cnt);
+ if (CRASHDEBUG(8))
+ error(INFO, "read KDUMP or NETDUMP_ELF64 "
+ "for zero-fill\n");
return cnt;
}
}
@@ -542,9 +560,15 @@ read_netdump(int fd, void *bufptr, int cnt, ulong addr, physaddr_t paddr)
}
if (FLAT_FORMAT()) {
+ if (CRASHDEBUG(8))
+ error(INFO, "read flat-format offset: %llx\n",
+ (ulonglong)offset);
if (!read_flattened_format(nd->ndfd, offset, bufptr, cnt))
return READ_ERROR;
} else {
+ if (CRASHDEBUG(8))
+ error(INFO, "seek and read offset: %llx\n",
+ (ulonglong)offset);
if (lseek(nd->ndfd, offset, SEEK_SET) == -1)
return SEEK_ERROR;
if (read(nd->ndfd, bufptr, cnt) != cnt)
@@ -2618,6 +2642,9 @@ get_kdump_panic_task(void)
int
read_kdump(int fd, void *bufptr, int cnt, ulong addr, physaddr_t paddr)
{
+ if (CRASHDEBUG(8))
+ error(INFO, "read_kdump for: virt=%lx phys=%llx\n",
+ addr, (ulonglong)paddr);
if (XEN_CORE_DUMPFILE() && !XEN_HYPER_MODE()) {
if (!(nd->xen_kdump_data->flags & KDUMP_P2M_INIT)) {
if (!machdep->xen_kdump_p2m_create)
@@ -2640,6 +2667,10 @@ read_kdump(int fd, void *bufptr, int cnt, ulong addr, physaddr_t paddr)
return READ_ERROR;
}
+ if (CRASHDEBUG(8))
+ error(INFO, "read_kdump trying read_netdump for: virt=%lx "
+ "phys=%llx\n",
+ addr, (ulonglong)paddr);
return read_netdump(fd, bufptr, cnt, addr, paddr);
}
diff --git a/a/remote.c b/b/remote.c
index a06c14b..d84d556 100755
--- a/a/remote.c
+++ b/b/remote.c
@@ -2244,6 +2244,8 @@ remote_fd_init(void)
* if no remote dumpfile name was entered. If it is /dev/mem,
* then also go get the remote /proc/version.
*/
+ if (CRASHDEBUG(8))
+ error(INFO, "Setting readmem to read_daemon\n");
pc->readmem = read_daemon;
if (!pc->server_memsrc)
diff --git a/a/x86.c b/b/x86.c
index df91110..f166a02 100755
--- a/a/x86.c
+++ b/b/x86.c
@@ -4390,6 +4390,8 @@ x86_xen_kdump_p2m_create(struct xen_kdump_data *xkd)
* Temporarily read physical (machine) addresses from vmcore by
* going directly to read_netdump() instead of via read_kdump().
*/
+ if (CRASHDEBUG(8))
+ error(INFO, "Setting readmem to read_netdump for x86\n");
pc->readmem = read_netdump;
if (xkd->flags & KDUMP_CR3)
@@ -4467,6 +4469,8 @@ x86_xen_kdump_p2m_create(struct xen_kdump_data *xkd)
fprintf(fp, "\n");
}
+ if (CRASHDEBUG(8))
+ error(INFO, "Setting readmem to read_kdump for x86\n");
pc->readmem = read_kdump;
return TRUE;
@@ -4553,6 +4557,9 @@ use_cr3:
machdep->last_ptbl_read = 0;
machdep->last_pmd_read = 0;
+ if (CRASHDEBUG(8))
+ error(INFO, "Setting readmem to read_kdump for x86 and "
+ "use cr3\n");
pc->readmem = read_kdump;
return TRUE;
diff --git a/a/x86_64.c b/b/x86_64.c
index 689317f..26fb397 100755
--- a/a/x86_64.c
+++ b/b/x86_64.c
@@ -5398,6 +5398,8 @@ x86_64_xen_kdump_p2m_create(struct xen_kdump_data *xkd)
* Temporarily read physical (machine) addresses from vmcore by
* going directly to read_netdump() instead of via read_kdump().
*/
+ if (CRASHDEBUG(8))
+ error(INFO, "Setting readmem to read_netdump for x86_64\n");
pc->readmem = read_netdump;
if (xkd->flags & KDUMP_CR3)
@@ -5458,6 +5460,8 @@ x86_64_xen_kdump_p2m_create(struct xen_kdump_data *xkd)
fprintf(fp, "\n");
}
+ if (CRASHDEBUG(8))
+ error(INFO, "Setting readmem to read_kdump for x86_64\n");
pc->readmem = read_kdump;
return TRUE;
@@ -5524,6 +5528,9 @@ use_cr3:
machdep->last_pgd_read = 0;
machdep->last_ptbl_read = 0;
machdep->last_pmd_read = 0;
+ if (CRASHDEBUG(8))
+ error(INFO, "Setting readmem to read_kdump for x86_64 and "
+ "using cr3\n");
pc->readmem = read_kdump;
return TRUE;
12 years, 10 months