Re: [Crash-utility] [RFI] Support Fujitsu's sadump dump format
by tachibana@mxm.nes.nec.co.jp
Hi Hatayama-san,
On 2011/06/29 12:12:18 +0900, HATAYAMA Daisuke <d.hatayama(a)jp.fujitsu.com> wrote:
> From: Dave Anderson <anderson(a)redhat.com>
> Subject: Re: [Crash-utility] [RFI] Support Fujitsu's sadump dump format
> Date: Tue, 28 Jun 2011 08:57:42 -0400 (EDT)
>
> >
> >
> > ----- Original Message -----
> >> Fujitsu has stand-alone dump mechanism based on firmware level
> >> functionality, which we call SADUMP, in short.
> >>
> >> We've maintained utility tools internally but now we're thinking that
> >> the best is crash utility and makedumpfile supports the sadump format
> >> for the viewpoint of both portability and maintainability.
> >>
> >> We'll be of course responsible for its maintainance in a continuous
> >> manner. The sadump dump format is very similar to diskdump format and
> >> so kdump (compressed) format, so we estimate patch set would be a
> >> relatively small size.
> >>
> >> Could you tell me whether crash utility and makedumpfile can support
> >> the sadump format? If OK, we'll start to make patchset.
I think it's not bad to support sadump by makedumpfile. However I have
several questions.
- Do you want to use makedumpfile to make an existing file that sadump has
dumped small?
- It isn't possible to support the same form as kdump-compressed format
now, is it?
- When the information that makedumpfile reads from a note of /proc/vmcore
(or a header of kdump-compressed format) is added by an extension of
makedumpfile, do you need to modify sadump?
Thanks
tachibana
> >
> > Sure, yes, the crash utility can always support another dumpfile format.
> >
>
> Thanks. It helps a lot.
>
> > It's unclear to me how similar SADUMP is to diskdump/compressed-kdump.
> > Does your internal version patch diskdump.c, or do you maintain your
> > own "sadump.c"? I ask because if your patchset is at all intrusive,
> > I'd prefer it be kept in its own file, primarily for maintainability,
> > but also because SADUMP is essentially a black-box to anybody outside
> > Fujitsu.
>
> What I meant when I used ``similar'' is both literally and
> logically. The format consists of diskdump header-like header, two
> kinds of bitmaps used for the same purpose as those in diskump format,
> and memory data. They can be handled in common with the existing data
> structure, diskdump_data, non-intrusively, so I hope they are placed
> in diskdump.c.
>
> On the other hand, there's a code to be placed at such specific
> area. sadump is triggered depending on kdump's progress and so
> register values to be contained in vmcore varies according to the
> progress: If crash_notes has been initialized when sadump is
> triggered, sadump packs the register values in crash_notes; if not
> yet, packs registers gathered by firmware. This is sadump specific
> processing, so I think putting it in specific sadump.c file is a
> natural and reasonable choise.
>
> Anyway, I have not made any patch set for this. I'll post a patch set
> when I complete.
>
> Again, thanks a lot for the positive answer.
>
> Thanks.
> HATAYAMA, Daisuke
>
>
> _______________________________________________
> kexec mailing list
> kexec(a)lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/kexec
1 year
[PATCH] s390: Add restart stack support (version 2)
by Michael Holzheu
Hi Dave,
Sorry, the restart stack patch is missing a check if the restart_stack
symbols exists. Without this check, we get error messages for older
kernels. Here the updated patch.
Sorry for the noise.
Signed-off-by: Michael Holzheu <holzheu(a)linux.vnet.ibm.com>
---
s390x.c | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
--- a/s390x.c
+++ b/s390x.c
@@ -825,9 +825,16 @@ static void get_int_stack(char *stack_na
unsigned long stack_addr;
*start = *end = 0;
- if (!MEMBER_EXISTS("_lowcore", stack_name))
- return;
- stack_addr = ULONG(lc + MEMBER_OFFSET("_lowcore", stack_name));
+ if (strcmp(stack_name, "restart_stack") == 0) {
+ stack_addr = symbol_value("restart_stack");
+ if (!stack_addr)
+ return;
+ stack_addr = readmem_ul(stack_addr);
+ } else {
+ if (!MEMBER_EXISTS("_lowcore", stack_name))
+ return;
+ stack_addr = ULONG(lc + MEMBER_OFFSET("_lowcore", stack_name));
+ }
if (stack_addr == 0)
return;
*start = stack_addr - INT_STACK_SIZE;
@@ -993,6 +1000,10 @@ static void s390x_back_trace_cmd(struct
}
s390x_print_lowcore(lowcore,bt,1);
fprintf(fp,"\n");
+ if (symbol_exists("restart_stack")) {
+ get_int_stack("restart_stack", lowcore, &low, &high);
+ sp = show_trace(bt, cnt, sp, low, high);
+ }
get_int_stack("panic_stack", lowcore, &low, &high);
sp = show_trace(bt, cnt, sp, low, high);
get_int_stack("async_stack", lowcore, &low, &high);
13 years, 3 months
[PATCH] s390: Print pt_regs for interrupt stack frames
by Michael Holzheu
Hi Dave,
With this patch instead of just printing the string " - Interrupt -",
we print the pt_regs for interrupts. The pt_regs contain all the current
registers and PSW of the interrupted CPU. This is very useful information
for debugging.
Old output:
-----------
#4 [00017ea0] do_restart at 111c18
#5 [00017eb8] psw_restart_int_handler at 5c1194
- Interrupt -
#6 [00017f58] vtime_stop_cpu at 5c043e
#0 [00907eb0] cpu_idle at 106026
#1 [00907ef8] start_kernel at 9799e8
New output:
-----------
#4 [00017ea0] do_restart at 111c18
#5 [00017eb8] psw_restart_int_handler at 5c1194
PSW: 0706000180000000 00000000005c043e (vtime_stop_cpu+134)
GPRS: 0000000000000000 00000000005c043e 00000000011e5228 00000000011e5248
0000000000907f08 00000000011e5b40 0000000000979324 0000000000000000
00000000009c0000 00000000009c0010 00000000009ab024 00000000011e5200
00000000011e5238 00000000005c6a00 0000000000106026 0000000000907e68
#0 [00907eb0] cpu_idle at 106026
#1 [00907ef8] start_kernel at 9799e
Signed-off-by: Michael Holzheu <holzheu(a)linux.vnet.ibm.com>
---
s390x.c | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++++++----------
1 file changed, 60 insertions(+), 11 deletions(-)
--- a/s390x.c
+++ b/s390x.c
@@ -878,6 +878,24 @@ static void print_frame_data(unsigned lo
}
/*
+ * Do reference check and set flags
+ */
+static int bt_reference_check(struct bt_info *bt, unsigned long addr)
+{
+ if (!BT_REFERENCE_CHECK(bt))
+ return 0;
+
+ if (bt->ref->cmdflags & BT_REF_HEXVAL) {
+ if (addr == bt->ref->hexval)
+ bt->ref->cmdflags |= BT_REF_FOUND;
+ } else {
+ if (STREQ(closest_symbol(addr), bt->ref->str))
+ bt->ref->cmdflags |= BT_REF_FOUND;
+ }
+ return 1;
+}
+
+/*
* Print stack frame
*/
static void print_frame(struct bt_info *bt, int cnt, unsigned long sp,
@@ -886,16 +904,8 @@ static void print_frame(struct bt_info *
struct load_module *lm;
char *sym;
- if (BT_REFERENCE_CHECK(bt)) {
- if (bt->ref->cmdflags & BT_REF_HEXVAL) {
- if (r14 == bt->ref->hexval)
- bt->ref->cmdflags |= BT_REF_FOUND;
- } else {
- if (STREQ(closest_symbol(r14), bt->ref->str))
- bt->ref->cmdflags |= BT_REF_FOUND;
- }
+ if (bt_reference_check(bt, r14))
return;
- }
fprintf(fp, "%s#%d [%08lx] ", cnt < 10 ? " " : "", cnt, sp);
sym = closest_symbol(r14);
fprintf(fp, "%s at %lx", sym, r14);
@@ -907,6 +917,46 @@ static void print_frame(struct bt_info *
}
/*
+ * Print pt_regs structure
+ */
+static void print_ptregs(struct bt_info *bt, unsigned long sp)
+{
+ unsigned long addr, psw_flags, psw_addr, offs;
+ struct load_module *lm;
+ char *sym;
+ int i;
+
+ addr = sp + MEMBER_OFFSET("pt_regs", "psw");
+ psw_flags = readmem_ul(addr);
+ psw_addr = readmem_ul(addr + sizeof(long));
+ if (bt_reference_check(bt, psw_addr))
+ return;
+
+ fprintf(fp, " PSW: %016lx %016lx ", psw_flags, psw_addr);
+ sym = closest_symbol(psw_addr);
+ offs = psw_addr - closest_symbol_value(psw_addr);
+ if (module_symbol(psw_addr, NULL, &lm, NULL, 0))
+ fprintf(fp, "(%s+%ld [%s])\n", sym, offs, lm->mod_name);
+ else
+ fprintf(fp, "(%s+%ld)\n", sym, offs);
+
+ addr = sp + MEMBER_OFFSET("pt_regs", "gprs");
+ for (i = 0; i < 16; i++) {
+ if (i != 0 && i % 4 == 0)
+ fprintf(fp, "\n");
+ if (i % 4 == 0) {
+ if (i == 0)
+ fprintf(fp, " GPRS: ");
+ else
+ fprintf(fp, " ");
+ }
+ fprintf(fp, "%016lx ", readmem_ul(addr + i * sizeof(long)));
+ }
+ fprintf(fp, "\n");
+}
+
+
+/*
* Print back trace for one stack
*/
static unsigned long show_trace(struct bt_info *bt, int cnt, unsigned long sp,
@@ -955,8 +1005,7 @@ static unsigned long show_trace(struct b
/* Check for loop (kernel_thread_starter) of second zero bc */
if (low == reg || reg == 0)
return reg;
- fprintf(fp, " - Interrupt -\n");
- print_frame(bt, cnt++, sp, psw_addr);
+ print_ptregs(bt, sp);
low = sp;
sp = reg;
cnt = 0;
13 years, 3 months
[PATCH] s390: Add restart stack support
by Michael Holzheu
Hi Dave,
With Linux 3.0.1 on s390 we have a new kernel stack for the PSW restart
interrupt. See kernel git commit 7dd6b3343fdc190712d1620ee8848d25c4c77c33
for details. With this patch the crash "bt" command will find this stack.
Signed-off-by: Michael Holzheu <holzheu(a)linux.vnet.ibm.com>
---
s390x.c | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
--- a/s390x.c
+++ b/s390x.c
@@ -825,9 +825,16 @@ static void get_int_stack(char *stack_na
unsigned long stack_addr;
*start = *end = 0;
- if (!MEMBER_EXISTS("_lowcore", stack_name))
- return;
- stack_addr = ULONG(lc + MEMBER_OFFSET("_lowcore", stack_name));
+ if (strcmp(stack_name, "restart_stack") == 0) {
+ stack_addr = symbol_value("restart_stack");
+ if (!stack_addr)
+ return;
+ stack_addr = readmem_ul(stack_addr);
+ } else {
+ if (!MEMBER_EXISTS("_lowcore", stack_name))
+ return;
+ stack_addr = ULONG(lc + MEMBER_OFFSET("_lowcore", stack_name));
+ }
if (stack_addr == 0)
return;
*start = stack_addr - INT_STACK_SIZE;
@@ -993,6 +1000,8 @@ static void s390x_back_trace_cmd(struct
}
s390x_print_lowcore(lowcore,bt,1);
fprintf(fp,"\n");
+ get_int_stack("restart_stack", lowcore, &low, &high);
+ sp = show_trace(bt, cnt, sp, low, high);
get_int_stack("panic_stack", lowcore, &low, &high);
sp = show_trace(bt, cnt, sp, low, high);
get_int_stack("async_stack", lowcore, &low, &high);
13 years, 3 months