crash version 4.0-3.8 is available
by Dave Anderson
- Tentatively scheduled as base version for RHEL4-U5.
- Fix for the "irq" command when run on 2.6.17 and later kernels, which
replaced the hw_interrupt_type structure with the irq_chip structure.
Without the patch, the command would fail with the error message
"irq: invalid structure member offset: irq_desc_t_handler".
(rachita(a)in.ibm.com)
- Phased in the first stage of support for the use of dwarf CFI data to
produce accurate x86_64 back traces, and to eventually improve the
reliability of x86 back traces. The code is very much still under
development, and is not turned on as of yet; for x86_64 only, its
usage can be toggled on and off with the set command, by entering
"set unwind on" or "set unwind off". It will only work if dwarf CFI
information exists in the kernel memory, or if the vmlinux file
contains an .eh_frame section. Expect multiple iterations before
this feature is ready for prime-time.
(rachita(a)in.ibm.com, anderson(a)redhat.com)
- Prevents stream of invalid "WARNING: possibly bogus exception frame"
messages during initialization when run agains x86_64 xen dumpfiles
created with the new "xm dump-core" facility. (anderson(a)redhat.com)
- For for "struct -o" option to print structure member offsets if the
member type is a function pointer. (anderson(a)redhat.com)
Download from: http://people.redhat.com/anderson
18 years, 2 months
struct structname.member1,member2,...
by Olivier Daudel
Hi Dave,
This patch try to extend your technologie in list to struct.
cmd_struct() is modified.
cmd_union() and cmd_pointer() should also be modified.
Do we really have to clone cmd_struct() in these alternatives ?
Why not make so that cmd_struct(), cmd_union() and cmd_pointer() do call a
common function accepting some flags?
Olivier
struct struct_name address | symbol <- unchanged
struct struct_name <-unchanged
struct struct_name -o <- unchanged
New and the main goal
crash> struct task_struct.pid,tgid f6044560
pid = 3533,
tgid = 3533,
Also new and in the main goal
crash> ps 1
PID PPID CPU TASK ST %MEM VSZ RSS COMM
1 0 0 f7e8caa0 IN 0.0 1744 644 init
crash> task_struct.children f7e8caa0
children = {
next = 0xf7e8c0d0,
prev = 0xc1f060d0
},
crash> struct task_struct.pid,tgid -l task_struct.sibling 0xf7e8c0d0
pid = 2,
tgid = 2,
New (acceptable side effect)
crash> struct task_struct.pid,tgid
struct task_struct {
[152] pid_t pid;
}
struct task_struct {
[156] pid_t tgid;
}
struct struc_name array counter <- unchanged
New (acceptable side effect)
crash> struct task_struct.pid,tgid f6044560 3
pid = 3533,
pid = 2850,
pid = -167489336,
tgid = 3533,
tgid = 2850,
tgid = -167489412,
18 years, 2 months
[RFC] Patch to fix irq command in crash
by Rachita Kothiyal
Hi Dave
In kernels after 2.6.17, the hw_interrupt_type structure has been replaced
by irq_chip, among other changes to the irq_desc kernel struct. This has
broken the 'irq' command in crash. The following patch fixes this.
Thanks
Rachita
Signed-off-by: Rachita Kothiyal <rachita(a)in.ibm.com>
---
defs.h | 16 +++
kernel.c | 298 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--------
symbols.c | 33 ++++++
3 files changed, 310 insertions(+), 37 deletions(-)
diff -puN kernel.c~crash-fix-irq-command kernel.c
--- crash-4.0-3.5/kernel.c~crash-fix-irq-command 2006-10-18 18:50:40.765651800 +0530
+++ crash-4.0-3.5-rachita/kernel.c 2006-10-18 20:16:03.233918256 +0530
@@ -262,27 +262,66 @@ kernel_init()
STRUCT_SIZE_INIT(hlist_node, "hlist_node");
MEMBER_OFFSET_INIT(irq_desc_t_status, "irq_desc_t", "status");
- MEMBER_OFFSET_INIT(irq_desc_t_handler, "irq_desc_t", "handler");
+ if (MEMBER_EXISTS("irq_desc_t", "handler"))
+ MEMBER_OFFSET_INIT(irq_desc_t_handler, "irq_desc_t", "handler");
+ else
+ MEMBER_OFFSET_INIT(irq_desc_t_chip, "irq_desc_t", "chip");
MEMBER_OFFSET_INIT(irq_desc_t_action, "irq_desc_t", "action");
MEMBER_OFFSET_INIT(irq_desc_t_depth, "irq_desc_t", "depth");
- MEMBER_OFFSET_INIT(hw_interrupt_type_typename,
- "hw_interrupt_type", "typename");
- MEMBER_OFFSET_INIT(hw_interrupt_type_startup,
- "hw_interrupt_type", "startup");
- MEMBER_OFFSET_INIT(hw_interrupt_type_shutdown,
- "hw_interrupt_type", "shutdown");
- MEMBER_OFFSET_INIT(hw_interrupt_type_handle,
- "hw_interrupt_type", "handle");
- MEMBER_OFFSET_INIT(hw_interrupt_type_enable,
- "hw_interrupt_type", "enable");
- MEMBER_OFFSET_INIT(hw_interrupt_type_disable,
- "hw_interrupt_type", "disable");
- MEMBER_OFFSET_INIT(hw_interrupt_type_ack,
- "hw_interrupt_type", "ack");
- MEMBER_OFFSET_INIT(hw_interrupt_type_end,
- "hw_interrupt_type", "end");
- MEMBER_OFFSET_INIT(hw_interrupt_type_set_affinity,
- "hw_interrupt_type", "set_affinity");
+ if (STRUCT_EXISTS("hw_interrupt_type")) {
+ MEMBER_OFFSET_INIT(hw_interrupt_type_typename,
+ "hw_interrupt_type", "typename");
+ MEMBER_OFFSET_INIT(hw_interrupt_type_startup,
+ "hw_interrupt_type", "startup");
+ MEMBER_OFFSET_INIT(hw_interrupt_type_shutdown,
+ "hw_interrupt_type", "shutdown");
+ MEMBER_OFFSET_INIT(hw_interrupt_type_handle,
+ "hw_interrupt_type", "handle");
+ MEMBER_OFFSET_INIT(hw_interrupt_type_enable,
+ "hw_interrupt_type", "enable");
+ MEMBER_OFFSET_INIT(hw_interrupt_type_disable,
+ "hw_interrupt_type", "disable");
+ MEMBER_OFFSET_INIT(hw_interrupt_type_ack,
+ "hw_interrupt_type", "ack");
+ MEMBER_OFFSET_INIT(hw_interrupt_type_end,
+ "hw_interrupt_type", "end");
+ MEMBER_OFFSET_INIT(hw_interrupt_type_set_affinity,
+ "hw_interrupt_type", "set_affinity");
+ } else { /*
+ * On later kernels where hw_interrupt_type was replaced
+ * by irq_chip
+ */
+ MEMBER_OFFSET_INIT(irq_chip_typename,
+ "irq_chip", "name");
+ MEMBER_OFFSET_INIT(irq_chip_startup,
+ "irq_chip", "startup");
+ MEMBER_OFFSET_INIT(irq_chip_shutdown,
+ "irq_chip", "shutdown");
+ MEMBER_OFFSET_INIT(irq_chip_enable,
+ "irq_chip", "enable");
+ MEMBER_OFFSET_INIT(irq_chip_disable,
+ "irq_chip", "disable");
+ MEMBER_OFFSET_INIT(irq_chip_ack,
+ "irq_chip", "ack");
+ MEMBER_OFFSET_INIT(irq_chip_mask,
+ "irq_chip", "mask");
+ MEMBER_OFFSET_INIT(irq_chip_mask_ack,
+ "irq_chip", "mask_ack");
+ MEMBER_OFFSET_INIT(irq_chip_unmask,
+ "irq_chip", "unmask");
+ MEMBER_OFFSET_INIT(irq_chip_eoi,
+ "irq_chip", "eoi");
+ MEMBER_OFFSET_INIT(irq_chip_end,
+ "irq_chip", "end");
+ MEMBER_OFFSET_INIT(irq_chip_set_affinity,
+ "irq_chip", "set_affinity");
+ MEMBER_OFFSET_INIT(irq_chip_retrigger,
+ "irq_chip", "retrigger");
+ MEMBER_OFFSET_INIT(irq_chip_set_type,
+ "irq_chip", "set_type");
+ MEMBER_OFFSET_INIT(irq_chip_set_wake,
+ "irq_chip", "set_wake");
+ }
MEMBER_OFFSET_INIT(irqaction_handler, "irqaction", "handler");
MEMBER_OFFSET_INIT(irqaction_flags, "irqaction", "flags");
MEMBER_OFFSET_INIT(irqaction_mask, "irqaction", "mask");
@@ -3588,8 +3627,14 @@ generic_dump_irq(int irq)
readmem(irq_desc_addr + OFFSET(irq_desc_t_status), KVADDR, &status,
sizeof(int), "irq_desc entry", FAULT_ON_ERROR);
- readmem(irq_desc_addr + OFFSET(irq_desc_t_handler), KVADDR, &handler,
- sizeof(long), "irq_desc entry", FAULT_ON_ERROR);
+ if (VALID_MEMBER(irq_desc_t_handler))
+ readmem(irq_desc_addr + OFFSET(irq_desc_t_handler), KVADDR,
+ &handler, sizeof(long), "irq_desc entry",
+ FAULT_ON_ERROR);
+ else if (VALID_MEMBER(irq_desc_t_chip))
+ readmem(irq_desc_addr + OFFSET(irq_desc_t_chip), KVADDR,
+ &handler, sizeof(long), "irq_desc entry",
+ FAULT_ON_ERROR);
readmem(irq_desc_addr + OFFSET(irq_desc_t_action), KVADDR, &action,
sizeof(long), "irq_desc entry", FAULT_ON_ERROR);
readmem(irq_desc_addr + OFFSET(irq_desc_t_depth), KVADDR, &depth,
@@ -3627,19 +3672,30 @@ generic_dump_irq(int irq)
} else
fprintf(fp, "%lx\n", handler);
- if (handler) {
- readmem(handler+OFFSET(hw_interrupt_type_typename), KVADDR,
- &tmp1, sizeof(void *),
- "hw_interrupt_type typename", FAULT_ON_ERROR);
+ if (handler) {
+ if (VALID_MEMBER(hw_interrupt_type_typename))
+ readmem(handler+OFFSET(hw_interrupt_type_typename),
+ KVADDR, &tmp1, sizeof(void *),
+ "hw_interrupt_type typename", FAULT_ON_ERROR);
+ else if (VALID_MEMBER(irq_chip_typename))
+ readmem(handler+OFFSET(irq_chip_typename),
+ KVADDR, &tmp1, sizeof(void *),
+ "hw_interrupt_type typename", FAULT_ON_ERROR);
+
fprintf(fp, " typename: %lx ", tmp1);
BZERO(buf, BUFSIZE);
if (read_string(tmp1, buf, BUFSIZE-1))
fprintf(fp, "\"%s\"", buf);
fprintf(fp, "\n");
- readmem(handler+OFFSET(hw_interrupt_type_startup), KVADDR,
- &tmp1, sizeof(void *),
- "hw_interrupt_type startup", FAULT_ON_ERROR);
+ if (VALID_MEMBER(hw_interrupt_type_startup))
+ readmem(handler+OFFSET(hw_interrupt_type_startup),
+ KVADDR, &tmp1, sizeof(void *),
+ "hw_interrupt_type startup", FAULT_ON_ERROR);
+ else if (VALID_MEMBER(irq_chip_startup))
+ readmem(handler+OFFSET(irq_chip_startup),
+ KVADDR, &tmp1, sizeof(void *),
+ "hw_interrupt_type startup", FAULT_ON_ERROR);
fprintf(fp, " startup: %lx ", tmp1);
if (is_kernel_text(tmp1))
fprintf(fp, "<%s>", value_to_symstr(tmp1, buf, 0));
@@ -3650,9 +3706,15 @@ generic_dump_irq(int irq)
value_to_symstr(tmp2, buf, 0));
fprintf(fp, "\n");
- readmem(handler+OFFSET(hw_interrupt_type_shutdown), KVADDR,
- &tmp1, sizeof(void *),
- "hw_interrupt_type shutdown", FAULT_ON_ERROR);
+ if (VALID_MEMBER(hw_interrupt_type_shutdown))
+ readmem(handler+OFFSET(hw_interrupt_type_shutdown),
+ KVADDR, &tmp1, sizeof(void *),
+ "hw_interrupt_type shutdown", FAULT_ON_ERROR);
+ else if (VALID_MEMBER(irq_chip_shutdown))
+ readmem(handler+OFFSET(irq_chip_shutdown),
+ KVADDR, &tmp1, sizeof(void *),
+ "hw_interrupt_type shutdown", FAULT_ON_ERROR);
+
fprintf(fp, " shutdown: %lx ", tmp1);
if (is_kernel_text(tmp1))
fprintf(fp, "<%s>", value_to_symstr(tmp1, buf, 0));
@@ -3680,9 +3742,14 @@ generic_dump_irq(int irq)
fprintf(fp, "\n");
}
- readmem(handler+OFFSET(hw_interrupt_type_enable), KVADDR,
- &tmp1, sizeof(void *),
- "hw_interrupt_type enable", FAULT_ON_ERROR);
+ if (VALID_MEMBER(hw_interrupt_type_enable))
+ readmem(handler+OFFSET(hw_interrupt_type_enable),
+ KVADDR, &tmp1, sizeof(void *),
+ "hw_interrupt_type enable", FAULT_ON_ERROR);
+ else if (VALID_MEMBER(irq_chip_enable))
+ readmem(handler+OFFSET(irq_chip_enable),
+ KVADDR, &tmp1, sizeof(void *),
+ "hw_interrupt_type enable", FAULT_ON_ERROR);
fprintf(fp, " enable: %lx ", tmp1);
if (is_kernel_text(tmp1))
fprintf(fp, "<%s>", value_to_symstr(tmp1, buf, 0));
@@ -3693,9 +3760,14 @@ generic_dump_irq(int irq)
value_to_symstr(tmp2, buf, 0));
fprintf(fp, "\n");
- readmem(handler+OFFSET(hw_interrupt_type_disable), KVADDR,
- &tmp1, sizeof(void *),
- "hw_interrupt_type disable", FAULT_ON_ERROR);
+ if (VALID_MEMBER(hw_interrupt_type_disable))
+ readmem(handler+OFFSET(hw_interrupt_type_disable),
+ KVADDR, &tmp1, sizeof(void *),
+ "hw_interrupt_type disable", FAULT_ON_ERROR);
+ else if (VALID_MEMBER(irq_chip_disable))
+ readmem(handler+OFFSET(irq_chip_disable),
+ KVADDR, &tmp1, sizeof(void *),
+ "hw_interrupt_type disable", FAULT_ON_ERROR);
fprintf(fp, " disable: %lx ", tmp1);
if (is_kernel_text(tmp1))
fprintf(fp, "<%s>", value_to_symstr(tmp1, buf, 0));
@@ -3720,6 +3792,84 @@ generic_dump_irq(int irq)
fprintf(fp, "<%s>",
value_to_symstr(tmp2, buf, 0));
fprintf(fp, "\n");
+ } else if (VALID_MEMBER(irq_chip_ack)) {
+ readmem(handler+OFFSET(irq_chip_ack), KVADDR,
+ &tmp1, sizeof(void *),
+ "irq_chip ack", FAULT_ON_ERROR);
+ fprintf(fp, " ack: %lx ", tmp1);
+ if (is_kernel_text(tmp1))
+ fprintf(fp, "<%s>",
+ value_to_symstr(tmp1, buf, 0));
+ else if (readmem(tmp1, KVADDR, &tmp2,
+ sizeof(ulong), "ack indirection",
+ RETURN_ON_ERROR|QUIET) && is_kernel_text(tmp2))
+ fprintf(fp, "<%s>",
+ value_to_symstr(tmp2, buf, 0));
+ fprintf(fp, "\n");
+ }
+
+ if (VALID_MEMBER(irq_chip_mask)) {
+ readmem(handler+OFFSET(irq_chip_mask), KVADDR,
+ &tmp1, sizeof(void *),
+ "irq_chip mask", FAULT_ON_ERROR);
+ fprintf(fp, " mask: %lx ", tmp1);
+ if (is_kernel_text(tmp1))
+ fprintf(fp, "<%s>",
+ value_to_symstr(tmp1, buf, 0));
+ else if (readmem(tmp1, KVADDR, &tmp2,
+ sizeof(ulong), "mask indirection",
+ RETURN_ON_ERROR|QUIET) && is_kernel_text(tmp2))
+ fprintf(fp, "<%s>",
+ value_to_symstr(tmp2, buf, 0));
+ fprintf(fp, "\n");
+ }
+
+ if (VALID_MEMBER(irq_chip_mask_ack)) {
+ readmem(handler+OFFSET(irq_chip_mask_ack), KVADDR,
+ &tmp1, sizeof(void *),
+ "irq_chip mask_ack", FAULT_ON_ERROR);
+ fprintf(fp, " mask_ack: %lx ", tmp1);
+ if (is_kernel_text(tmp1))
+ fprintf(fp, "<%s>",
+ value_to_symstr(tmp1, buf, 0));
+ else if (readmem(tmp1, KVADDR, &tmp2,
+ sizeof(ulong), "mask_ack indirection",
+ RETURN_ON_ERROR|QUIET) && is_kernel_text(tmp2))
+ fprintf(fp, "<%s>",
+ value_to_symstr(tmp2, buf, 0));
+ fprintf(fp, "\n");
+ }
+
+ if (VALID_MEMBER(irq_chip_unmask)) {
+ readmem(handler+OFFSET(irq_chip_unmask), KVADDR,
+ &tmp1, sizeof(void *),
+ "irq_chip unmask", FAULT_ON_ERROR);
+ fprintf(fp, " unmask: %lx ", tmp1);
+ if (is_kernel_text(tmp1))
+ fprintf(fp, "<%s>",
+ value_to_symstr(tmp1, buf, 0));
+ else if (readmem(tmp1, KVADDR, &tmp2,
+ sizeof(ulong), "unmask indirection",
+ RETURN_ON_ERROR|QUIET) && is_kernel_text(tmp2))
+ fprintf(fp, "<%s>",
+ value_to_symstr(tmp2, buf, 0));
+ fprintf(fp, "\n");
+ }
+
+ if (VALID_MEMBER(irq_chip_eoi)) {
+ readmem(handler+OFFSET(irq_chip_eoi), KVADDR,
+ &tmp1, sizeof(void *),
+ "irq_chip eoi", FAULT_ON_ERROR);
+ fprintf(fp, " eoi: %lx ", tmp1);
+ if (is_kernel_text(tmp1))
+ fprintf(fp, "<%s>",
+ value_to_symstr(tmp1, buf, 0));
+ else if (readmem(tmp1, KVADDR, &tmp2,
+ sizeof(ulong), "eoi indirection",
+ RETURN_ON_ERROR|QUIET) && is_kernel_text(tmp2))
+ fprintf(fp, "<%s>",
+ value_to_symstr(tmp2, buf, 0));
+ fprintf(fp, "\n");
}
if (VALID_MEMBER(hw_interrupt_type_end)) {
@@ -3736,6 +3886,20 @@ generic_dump_irq(int irq)
fprintf(fp, "<%s>",
value_to_symstr(tmp2, buf, 0));
fprintf(fp, "\n");
+ } else if (VALID_MEMBER(irq_chip_end)) {
+ readmem(handler+OFFSET(irq_chip_end), KVADDR,
+ &tmp1, sizeof(void *),
+ "irq_chip end", FAULT_ON_ERROR);
+ fprintf(fp, " end: %lx ", tmp1);
+ if (is_kernel_text(tmp1))
+ fprintf(fp, "<%s>",
+ value_to_symstr(tmp1, buf, 0));
+ else if (readmem(tmp1, KVADDR, &tmp2,
+ sizeof(ulong), "end indirection",
+ RETURN_ON_ERROR|QUIET) && is_kernel_text(tmp2))
+ fprintf(fp, "<%s>",
+ value_to_symstr(tmp2, buf, 0));
+ fprintf(fp, "\n");
}
if (VALID_MEMBER(hw_interrupt_type_set_affinity)) {
@@ -3753,6 +3917,66 @@ generic_dump_irq(int irq)
fprintf(fp, "<%s>",
value_to_symstr(tmp2, buf, 0));
fprintf(fp, "\n");
+ } else if (VALID_MEMBER(irq_chip_set_affinity)) {
+ readmem(handler+OFFSET(irq_chip_set_affinity),
+ KVADDR, &tmp1, sizeof(void *),
+ "irq_chip set_affinity",
+ FAULT_ON_ERROR);
+ fprintf(fp, " set_affinity: %lx ", tmp1);
+ if (is_kernel_text(tmp1))
+ fprintf(fp, "<%s>",
+ value_to_symstr(tmp1, buf, 0));
+ else if (readmem(tmp1, KVADDR, &tmp2,
+ sizeof(ulong), "set_affinity indirection",
+ RETURN_ON_ERROR|QUIET) && is_kernel_text(tmp2))
+ fprintf(fp, "<%s>",
+ value_to_symstr(tmp2, buf, 0));
+ fprintf(fp, "\n");
+ }
+ if (VALID_MEMBER(irq_chip_retrigger)) {
+ readmem(handler+OFFSET(irq_chip_retrigger), KVADDR,
+ &tmp1, sizeof(void *),
+ "irq_chip retrigger", FAULT_ON_ERROR);
+ fprintf(fp, " retrigger: %lx ", tmp1);
+ if (is_kernel_text(tmp1))
+ fprintf(fp, "<%s>",
+ value_to_symstr(tmp1, buf, 0));
+ else if (readmem(tmp1, KVADDR, &tmp2,
+ sizeof(ulong), "retrigger indirection",
+ RETURN_ON_ERROR|QUIET) && is_kernel_text(tmp2))
+ fprintf(fp, "<%s>",
+ value_to_symstr(tmp2, buf, 0));
+ fprintf(fp, "\n");
+ }
+ if (VALID_MEMBER(irq_chip_set_type)) {
+ readmem(handler+OFFSET(irq_chip_set_type), KVADDR,
+ &tmp1, sizeof(void *),
+ "irq_chip set_type", FAULT_ON_ERROR);
+ fprintf(fp, " set_type: %lx ", tmp1);
+ if (is_kernel_text(tmp1))
+ fprintf(fp, "<%s>",
+ value_to_symstr(tmp1, buf, 0));
+ else if (readmem(tmp1, KVADDR, &tmp2,
+ sizeof(ulong), "set_type indirection",
+ RETURN_ON_ERROR|QUIET) && is_kernel_text(tmp2))
+ fprintf(fp, "<%s>",
+ value_to_symstr(tmp2, buf, 0));
+ fprintf(fp, "\n");
+ }
+ if (VALID_MEMBER(irq_chip_set_wake)) {
+ readmem(handler+OFFSET(irq_chip_set_wake), KVADDR,
+ &tmp1, sizeof(void *),
+ "irq_chip set wake", FAULT_ON_ERROR);
+ fprintf(fp, " set_wake: %lx ", tmp1);
+ if (is_kernel_text(tmp1))
+ fprintf(fp, "<%s>",
+ value_to_symstr(tmp1, buf, 0));
+ else if (readmem(tmp1, KVADDR, &tmp2,
+ sizeof(ulong), "set_wake indirection",
+ RETURN_ON_ERROR|QUIET) && is_kernel_text(tmp2))
+ fprintf(fp, "<%s>",
+ value_to_symstr(tmp2, buf, 0));
+ fprintf(fp, "\n");
}
}
diff -puN defs.h~crash-fix-irq-command defs.h
--- crash-4.0-3.5/defs.h~crash-fix-irq-command 2006-10-18 19:08:46.917531616 +0530
+++ crash-4.0-3.5-rachita/defs.h 2006-10-18 19:09:03.169061008 +0530
@@ -1039,6 +1039,7 @@ struct offset_table {
long block_device_bd_disk;
long irq_desc_t_status;
long irq_desc_t_handler;
+ long irq_desc_t_chip;
long irq_desc_t_action;
long irq_desc_t_depth;
long irqdesc_action;
@@ -1059,6 +1060,21 @@ struct offset_table {
long hw_interrupt_type_ack;
long hw_interrupt_type_end;
long hw_interrupt_type_set_affinity;
+ long irq_chip_typename;
+ long irq_chip_startup;
+ long irq_chip_shutdown;
+ long irq_chip_enable;
+ long irq_chip_disable;
+ long irq_chip_ack;
+ long irq_chip_end;
+ long irq_chip_set_affinity;
+ long irq_chip_mask;
+ long irq_chip_mask_ack;
+ long irq_chip_unmask;
+ long irq_chip_eoi;
+ long irq_chip_retrigger;
+ long irq_chip_set_type;
+ long irq_chip_set_wake;
long irq_cpustat_t___softirq_active;
long irq_cpustat_t___softirq_mask;
long fdtable_max_fds;
diff -puN symbols.c~crash-fix-irq-command symbols.c
--- crash-4.0-3.5/symbols.c~crash-fix-irq-command 2006-10-18 19:11:29.829765192 +0530
+++ crash-4.0-3.5-rachita/symbols.c 2006-10-18 19:47:15.249611800 +0530
@@ -5961,6 +5961,8 @@ dump_offset_table(char *spec, ulong make
OFFSET(irq_desc_t_status));
fprintf(fp, " irq_desc_t_handler: %ld\n",
OFFSET(irq_desc_t_handler));
+ fprintf(fp, " irq_desc_t_chip: %ld\n",
+ OFFSET(irq_desc_t_chip));
fprintf(fp, " irq_desc_t_action: %ld\n",
OFFSET(irq_desc_t_action));
fprintf(fp, " irq_desc_t_depth: %ld\n",
@@ -6006,6 +6008,37 @@ dump_offset_table(char *spec, ulong make
fprintf(fp, "hw_interrupt_type_set_affinity: %ld\n",
OFFSET(hw_interrupt_type_set_affinity));
+ fprintf(fp, " irq_chip_typename: %ld\n",
+ OFFSET(irq_chip_typename));
+ fprintf(fp, " irq_chip_startup: %ld\n",
+ OFFSET(irq_chip_startup));
+ fprintf(fp, " irq_chip_shutdown: %ld\n",
+ OFFSET(irq_chip_shutdown));
+ fprintf(fp, " irq_chip_enable: %ld\n",
+ OFFSET(irq_chip_enable));
+ fprintf(fp, " irq_chip_disable: %ld\n",
+ OFFSET(irq_chip_disable));
+ fprintf(fp, " irq_chip_ack: %ld\n",
+ OFFSET(irq_chip_ack));
+ fprintf(fp, " irq_chip_mask: %ld\n",
+ OFFSET(irq_chip_mask));
+ fprintf(fp, " irq_chip_mask_ack: %ld\n",
+ OFFSET(irq_chip_mask_ack));
+ fprintf(fp, " irq_chip_unmask: %ld\n",
+ OFFSET(irq_chip_unmask));
+ fprintf(fp, " irq_chip_eoi: %ld\n",
+ OFFSET(irq_chip_eoi));
+ fprintf(fp, " irq_chip_end: %ld\n",
+ OFFSET(irq_chip_end));
+ fprintf(fp, " irq_chip_set_affinity: %ld\n",
+ OFFSET(irq_chip_set_affinity));
+ fprintf(fp, " irq_chip_retrigger: %ld\n",
+ OFFSET(irq_chip_retrigger));
+ fprintf(fp, " irq_chip_set_type: %ld\n",
+ OFFSET(irq_chip_set_type));
+ fprintf(fp, " irq_chip_set_wake: %ld\n",
+ OFFSET(irq_chip_set_wake));
+
fprintf(fp, "irq_cpustat_t___softirq_active: %ld\n",
OFFSET(irq_cpustat_t___softirq_active));
fprintf(fp, " irq_cpustat_t___softirq_mask: %ld\n",
_
18 years, 2 months
Re:[RFC] Crash patch for DWARF CFI based unwind support
by Dave Anderson
> On Tue, Oct 17, 2006 at 03:37:16PM -0400, Dave Anderson wrote:
> >
> > This patch below looks to only be necessary in dumpfiles, but it seems
> > like, given that the x86_64 user_regs_struct is unavailable in 2.6
> > vmlinux files, that the initializations in get_netdump_regs_x86_64()
> > would never get done -- because VALID_STRUCT(user_regs_struct) would
> > fail, right?
> >
> > @@ -1562,8 +1566,10 @@ get_netdump_regs_x86_64(struct bt_info *
> > if (is_task_active(bt->task))
> > bt->flags |= BT_DUMPFILE_SEARCH;
> >
> > - if ((NETDUMP_DUMPFILE() || KDUMP_DUMPFILE()) &&
> > - VALID_STRUCT(user_regs_struct) && (bt->task == tt->panic_task)) {
> > + if (((NETDUMP_DUMPFILE() || KDUMP_DUMPFILE()) &&
> > + VALID_STRUCT(user_regs_struct) && (bt->task == tt->panic_task)) ||
> > + (KDUMP_DUMPFILE() && has_unwind_info && (bt->flags &
> > + BT_DUMPFILE_SEARCH))) {
>
> I add this last check to workaround the user_regs_struct not getting
> initialized problem. Thats why I omit the VALID_STRUCT() check, and let it
> pass if we have the unwind_info.
> This should be a temporary arrangement till we fix the user_regs_struct
> problem. The idea here is to read the register states for all the active
> tasks from the NT_PRSTATUS section of the dumpfile for kdump(in the case
> where we have the has_unwind_info set). The other case for kdump where we
> do not have the unwind_info stays as it is.
>
My mistake -- I got lost in the "if" statement and missed the || logic.
Sorry for the confusion...
> But again, this is temporary till we fix the user_regs_struct issue :)
But again, since it's not a crash issue, we can't "fix" it. Anyway,
this is fine, given that it's very unlikely these offsets will
ever change. If they do, we deal with it at that time.
>
> >
> > There does seem to be some unnecessary "kernel-port" left-overs that
> > should be pruned. Like the __get_user_nocheck(), __get_user_size()
> > and __get_user_asm() definitions are superfluous, since they're only
> > needed by __get_user(), which is not used.
>
> Actually __get_user is a TBD.
OK, but __get_user(), if we ever need it, appears to be used to
read either the dwarf CFI data, or the kernel stack contents?
So it can be substituted with the GET_STACK_DATA() macro to
pull stuff from the local copy of the kernel stack -- or just a
direct access if it's reading the copy of the dwarf data.
In any case, it shouldn't be a problem crafting a __get_user()
implementation, and all the other __get_xxx functions can be
removed since there's no way they could ever apply when
operating in user (crash) space.
Thanks,
Dave
18 years, 2 months
Re: [Crash-utility] Xen Dumping - Expectations
by Dave Anderson
Hi Josh,
I've fixed this one, and queued it for the next release.
The warning messages themselves were bogus because they were
referring to non-existent user-mode-to-kernel-mode exception
frames for each of the kernel threads.
Thanks for the bug report,
Dave
Joshua Giles wrote:
> Not quite sure if this or the kdump list is appropriate for this
> discussion, but I will start here...
>
> I've been playing with xen dumping on x86_64 and x86 (RHEL5 20061006.2);
> The following is a simple crash session on x86_64 (using "xm dump-core
> -L"):
>
> `crash /usr/lib/debug/lib/modules/2.6.18-1.2714.el5xen/vmlinux /xen/dump/Live_Dump`
>
> "WARNING: possibly bogus exception frame
> WARNING: possibly bogus exception frame
> WARNING: possibly bogus exception frame
> WARNING: possibly bogus exception frame
> WARNING: possibly bogus exception frame
> WARNING: possibly bogus exception frame
> WARNING: possibly bogus exception frame
> WARNING: possibly bogus exception frame
> WARNING: possibly bogus exception frame
> WARNING: possibly bogus exception frame
> WARNING: possibly bogus exception frame
> WARNING: possibly bogus exception frame
> WARNING: possibly bogus exception frame
> WARNING: possibly bogus exception frame
> WARNING: possibly bogus exception frame
> WARNING: possibly bogus exception frame
> WARNING: possibly bogus exception frame
> WARNING: possibly bogus exception frame
> WARNING: possibly bogus exception frame
> WARNING: possibly bogus exception frame
> WARNING: possibly bogus exception frame
>
>
>
18 years, 2 months
Re: [Crash-utility] Any comment on this output ?
by Dave Anderson
Hi Olivier,
I've fixed this one, and queued it for the next release.
Thanks for the bug report.
Dave
crash> struct security_operations -o
struct security_operations {
[0] int (*ptrace)(struct task_struct *, struct task_struct *);
[8] int (*capget)(struct task_struct *, kernel_cap_t *, kernel_cap_t *, kernel_cap_t *);
[16] int (*capset_check)(struct task_struct *, kernel_cap_t *, kernel_cap_t *, kernel_cap_t *);
[24] void (*capset_set)(struct task_struct *, kernel_cap_t *, kernel_cap_t *, kernel_cap_t *);
[32] int (*acct)(struct file *);
[40] int (*sysctl)(ctl_table *, int);
[48] int (*capable)(struct task_struct *, int);
[56] int (*quotactl)(int, int, int, struct super_block *);
[64] int (*quota_on)(struct file *);
[72] int (*syslog)(int);
[80] int (*vm_enough_memory)(long int);
[88] int (*bprm_alloc_security)(struct linux_binprm *);
[96] void (*bprm_free_security)(struct linux_binprm *);
[104] void (*bprm_apply_creds)(struct linux_binprm *, int);
[112] int (*bprm_set_security)(struct linux_binprm *);
[120] int (*bprm_check_security)(struct linux_binprm *);
[128] int (*bprm_secureexec)(struct linux_binprm *);
[136] int (*sb_alloc_security)(struct super_block *);
[144] void (*sb_free_security)(struct super_block *);
[152] int (*sb_copy_data)(struct file_system_type *, void *, void *);
[160] int (*sb_kern_mount)(struct super_block *, void *);
[168] int (*sb_statfs)(struct super_block *);
[176] int (*sb_mount)(char *, struct nameidata *, char *, long unsigned int, void *);
[184] int (*sb_check_sb)(struct vfsmount *, struct nameidata *);
[192] int (*sb_umount)(struct vfsmount *, int);
[200] void (*sb_umount_close)(struct vfsmount *);
[208] void (*sb_umount_busy)(struct vfsmount *);
[216] void (*sb_post_remount)(struct vfsmount *, long unsigned int, void *);
[224] void (*sb_post_mountroot)(void);
[232] void (*sb_post_addmount)(struct vfsmount *, struct nameidata *);
[240] int (*sb_pivotroot)(struct nameidata *, struct nameidata *);
[248] void (*sb_post_pivotroot)(struct nameidata *, struct nameidata *);
[256] int (*inode_alloc_security)(struct inode *);
[264] void (*inode_free_security)(struct inode *);
[272] int (*inode_create)(struct inode *, struct dentry *, int);
[280] void (*inode_post_create)(struct inode *, struct dentry *, int);
[288] int (*inode_link)(struct dentry *, struct inode *, struct dentry *);
[296] void (*inode_post_link)(struct dentry *, struct inode *, struct dentry *);
[304] int (*inode_unlink)(struct inode *, struct dentry *);
[312] int (*inode_symlink)(struct inode *, struct dentry *, const char *);
[320] void (*inode_post_symlink)(struct inode *, struct dentry *, const char *);
[328] int (*inode_mkdir)(struct inode *, struct dentry *, int);
[336] void (*inode_post_mkdir)(struct inode *, struct dentry *, int);
[344] int (*inode_rmdir)(struct inode *, struct dentry *);
[352] int (*inode_mknod)(struct inode *, struct dentry *, int, dev_t);
[360] void (*inode_post_mknod)(struct inode *, struct dentry *, int, dev_t);
[368] int (*inode_rename)(struct inode *, struct dentry *, struct inode *, struct dentry *);
[376] void (*inode_post_rename)(struct inode *, struct dentry *, struct inode *, struct dentry *);
[384] int (*inode_readlink)(struct dentry *);
[392] int (*inode_follow_link)(struct dentry *, struct nameidata *);
[400] int (*inode_permission)(struct inode *, int, struct nameidata *);
[408] int (*inode_setattr)(struct dentry *, struct iattr *);
[416] int (*inode_getattr)(struct vfsmount *, struct dentry *);
[424] void (*inode_delete)(struct inode *);
[432] int (*inode_setxattr)(struct dentry *, char *, void *, size_t, int);
[440] void (*inode_post_setxattr)(struct dentry *, char *, void *, size_t, int);
[448] int (*inode_getxattr)(struct dentry *, char *);
[456] int (*inode_listxattr)(struct dentry *);
[464] int (*inode_removexattr)(struct dentry *, char *);
[472] int (*inode_getsecurity)(struct inode *, const char *, void *, size_t);
[480] int (*inode_setsecurity)(struct inode *, const char *, const void *, size_t, int);
[488] int (*inode_listsecurity)(struct inode *, char *, size_t);
[496] int (*file_permission)(struct file *, int);
[504] int (*file_alloc_security)(struct file *);
[512] void (*file_free_security)(struct file *);
[520] int (*file_ioctl)(struct file *, unsigned int, long unsigned int);
[528] int (*file_mmap)(struct file *, long unsigned int, long unsigned int);
[536] int (*file_mprotect)(struct vm_area_struct *, long unsigned int);
[544] int (*file_lock)(struct file *, unsigned int);
[552] int (*file_fcntl)(struct file *, unsigned int, long unsigned int);
[560] int (*file_set_fowner)(struct file *);
[568] int (*file_send_sigiotask)(struct task_struct *, struct fown_struct *, int);
[576] int (*file_receive)(struct file *);
[584] int (*task_create)(long unsigned int);
[592] int (*task_alloc_security)(struct task_struct *);
[600] void (*task_free_security)(struct task_struct *);
[608] int (*task_setuid)(uid_t, uid_t, uid_t, int);
[616] int (*task_post_setuid)(uid_t, uid_t, uid_t, int);
[624] int (*task_setgid)(gid_t, gid_t, gid_t, int);
[632] int (*task_setpgid)(struct task_struct *, pid_t);
[640] int (*task_getpgid)(struct task_struct *);
[648] int (*task_getsid)(struct task_struct *);
[656] int (*task_setgroups)(struct group_info *);
[664] int (*task_setnice)(struct task_struct *, int);
[672] int (*task_setrlimit)(unsigned int, struct rlimit *);
[680] int (*task_setscheduler)(struct task_struct *, int, struct sched_param *);
[688] int (*task_getscheduler)(struct task_struct *);
[696] int (*task_kill)(struct task_struct *, struct siginfo *, int);
[704] int (*task_wait)(struct task_struct *);
[712] int (*task_prctl)(int, long unsigned int, long unsigned int, long unsigned int, long unsigned int);
[720] void (*task_reparent_to_init)(struct task_struct *);
[728] void (*task_to_inode)(struct task_struct *, struct inode *);
[736] int (*ipc_permission)(struct kern_ipc_perm *, short int);
[744] int (*msg_msg_alloc_security)(struct msg_msg *);
[752] void (*msg_msg_free_security)(struct msg_msg *);
[760] int (*msg_queue_alloc_security)(struct msg_queue *);
[768] void (*msg_queue_free_security)(struct msg_queue *);
[776] int (*msg_queue_associate)(struct msg_queue *, int);
[784] int (*msg_queue_msgctl)(struct msg_queue *, int);
[792] int (*msg_queue_msgsnd)(struct msg_queue *, struct msg_msg *, int);
[800] int (*msg_queue_msgrcv)(struct msg_queue *, struct msg_msg *, struct task_struct *, long int, int);
[808] int (*shm_alloc_security)(struct shmid_kernel *);
[816] void (*shm_free_security)(struct shmid_kernel *);
[824] int (*shm_associate)(struct shmid_kernel *, int);
[832] int (*shm_shmctl)(struct shmid_kernel *, int);
[840] int (*shm_shmat)(struct shmid_kernel *, char *, int);
[848] int (*sem_alloc_security)(struct sem_array *);
[856] void (*sem_free_security)(struct sem_array *);
[864] int (*sem_associate)(struct sem_array *, int);
[872] int (*sem_semctl)(struct sem_array *, int);
[880] int (*sem_semop)(struct sem_array *, struct sembuf *, unsigned int, int);
[888] int (*netlink_send)(struct sock *, struct sk_buff *);
[896] int (*netlink_recv)(struct sk_buff *);
[904] int (*register_security)(const char *, struct security_operations *);
[912] int (*unregister_security)(const char *, struct security_operations *);
[920] void (*d_instantiate)(struct dentry *, struct inode *);
[928] int (*getprocattr)(struct task_struct *, char *, void *, size_t);
[936] int (*setprocattr)(struct task_struct *, char *, void *, size_t);
[944] int (*unix_stream_connect)(struct socket *, struct socket *, struct sock *);
[952] int (*unix_may_send)(struct socket *, struct socket *);
[960] int (*socket_create)(int, int, int, int);
[968] void (*socket_post_create)(struct socket *, int, int, int, int);
[976] int (*socket_bind)(struct socket *, struct sockaddr *, int);
[984] int (*socket_connect)(struct socket *, struct sockaddr *, int);
[992] int (*socket_listen)(struct socket *, int);
[1000] int (*socket_accept)(struct socket *, struct socket *);
[1008] void (*socket_post_accept)(struct socket *, struct socket *);
[1016] int (*socket_sendmsg)(struct socket *, struct msghdr *, int);
[1024] int (*socket_recvmsg)(struct socket *, struct msghdr *, int, int);
[1032] int (*socket_getsockname)(struct socket *);
[1040] int (*socket_getpeername)(struct socket *);
[1048] int (*socket_getsockopt)(struct socket *, int, int);
[1056] int (*socket_setsockopt)(struct socket *, int, int);
[1064] int (*socket_shutdown)(struct socket *, int);
[1072] int (*socket_sock_rcv_skb)(struct sock *, struct sk_buff *);
[1080] int (*socket_getpeersec)(struct socket *, char *, int *, unsigned int);
[1088] int (*sk_alloc_security)(struct sock *, int, int);
[1096] void (*sk_free_security)(struct sock *);
}
SIZE: 1104
crash>
18 years, 2 months
Re: [Crash-utility] Any comment on this output ?
by Dave Anderson
Added to the crash.TODO list -- along with a related "struct"
command output failure if one of the suspect members is passed
to the command in the "struct.member" format.
Dave
18 years, 2 months
Any comment on this output ?
by Olivier Daudel
Hi Dave,
[36] and [120] are volontary ?
Olivier
crash> struct -o security_operations
struct security_operations {
int (*ptrace)(struct task_struct *, struct task_struct *);
int (*capget)(struct task_struct *, kernel_cap_t *, kernel_cap_t *,
kernel_cap_t *);
int (*capset_check)(struct task_struct *, kernel_cap_t *,
kernel_cap_t *,
kernel_cap_t *);
void (*capset_set)(struct task_struct *, kernel_cap_t *,
kernel_cap_t *,
kernel_cap_t *);
int (*acct)(struct file *);
int (*sysctl)(struct ctl_table *, int);
int (*capable)(struct task_struct *, int);
int (*quotactl)(int, int, int, struct super_block *);
int (*quota_on)(struct dentry *);
[36] int (*syslog)(int);
int (*settime)(struct timespec *, struct timezone *);
int (*vm_enough_memory)(long int);
int (*bprm_alloc_security)(struct linux_binprm *);
void (*bprm_free_security)(struct linux_binprm *);
void (*bprm_apply_creds)(struct linux_binprm *, int);
void (*bprm_post_apply_creds)(struct linux_binprm *);
int (*bprm_set_security)(struct linux_binprm *);
int (*bprm_check_security)(struct linux_binprm *);
int (*bprm_secureexec)(struct linux_binprm *);
int (*sb_alloc_security)(struct super_block *);
void (*sb_free_security)(struct super_block *);
int (*sb_copy_data)(struct file_system_type *, void *, void *);
int (*sb_kern_mount)(struct super_block *, void *);
int (*sb_statfs)(struct super_block *);
int (*sb_mount)(char *, struct nameidata *, char *, long unsigned
int,
void *);
int (*sb_check_sb)(struct vfsmount *, struct nameidata *);
int (*sb_umount)(struct vfsmount *, int);
void (*sb_umount_close)(struct vfsmount *);
void (*sb_umount_busy)(struct vfsmount *);
void (*sb_post_remount)(struct vfsmount *, long unsigned int, void
*);
[120] void (*sb_post_mountroot)(void);
void (*sb_post_addmount)(struct vfsmount *, struct nameidata *);
[...]
}
SIZE: 560
18 years, 2 months
Re: kdump/kexec/crash on vmcore file
by Vivek Goyal
On Thu, Oct 12, 2006 at 02:50:33PM -0700, Steven Truong wrote:
> Hi, all. This is my first attempt to troubleshoot a kernel panic so I
> am quite newbie in this area. I have been able to obtain a kdump when
> my box had kernel panic.
>
> I set up Kdump and Kexec and then the captured/crash kernel to boot
> into Level 1 and then copy /proc/vmcore file to the disk for later
> analysis. However, after the server booted back to Level 3 and I
> utilized the crash command to analyzed the vmcore file. I got error
> message:
>
> ./crash /boot/vmlinux ../vmcore.test
>
>
> crash: read error: kernel virtual address: ffffffff8123d1e0 type:
> "kernel_config_data"
> WARNING: cannot read kernel_config_data
> crash: read error: kernel virtual address: ffffffff813b5180 type: "xtime"
>
Hi Steven,
which vmlinux are you using for analysis? First kernel's vmlinux or
second kernel's vmlinux. You should be using first kernel's vmlinux.
crash is trying to read some symbols from the core file and crash thinks
that virtual address for kernel_config_data is ffffffff8123d1e0. I think
this is too high a address. I guess this will be the address if you
compile your kernel for physical address 16MB. So my first guess is that
you are using second kernel's vmlinux for analysis.
Which kernel version and kexec-tools version are you using?
I am also copying the mail to crash-utility mailing list where folks
keep a watch on crash related issues.
Thanks
Vivek
18 years, 2 months
crash version 4.0-3.7 is available
by Dave Anderson
- Tentatively scheduled as base version for RHEL4-U5 and RHEL5-B2.
- Support for paravirtualized x86_64 RHEL4 xen kernels, which require
the use of unique hardwired kernel VM addresses, as well as a new
user vtop function. Without the patch, crash would report several
read errors during invocation, and then eventually die with this
message: "crash: cannot access phys_to_machine_mapping page".
(anderson(a)redhat.com)
- Fix for accessing user space stack addresses in ia64 kernels with
3-level page tables. This was a reqression introduced in 4.0-3.1,
and would cause the new "ps -a" option to fail with an error message
such as: "ps: cannot access user stack address: 60000fffffffbe28".
Also, if the user stack address was given an the argumennt to the
"vtop" command, it would indicate "(not mapped)".
(anderson(a)redhat.com)
- Implemented a new "sig -g" option, which breaks down the signal
information into a common per-thread group section, followed by
the signal information relevant to each task in the thread group.
Added the capability of using the option via "foreach sig -g".
(olivier.daudel(a)u-paris10.fr, anderson(a)redhat.com)
- Update to allow the entry of multiple "list -s struct.member"
arguments, in order to display multiple members from each structure.
Added the capability of entering a single "-s" option with multiple
members entered in a comma-separated list, i.e., using the option
format "-s struct.member1,member2,member3".
(olivier.daudel(a)u-paris10.fr, anderson(a)redhat.com)
- The refresh_hlist_task_table() and refresh_hlist_task_table_v2()
functions now recognize when the number of running tasks exceeds their
internal table size, and realloc's task space as required. Without
the patch it would be possible to not access all tasks in a live
system if the number of tasks increased (rather dramatically) from the
time that the crash session started. (anderson(a)redhat.com)
- Added a new hash queue tool called hq_entry_exists(). The function
may be helpful in an extension, or future patch, to query for the
existence of an entry in the current hash queue. (jmoyer(a)redhat.com)
Download from: http://people.redhat.com/anderson
18 years, 2 months