Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LmD6O-0004BQ-7i for qemu-devel@nongnu.org; Tue, 24 Mar 2009 16:20:00 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LmD6J-00049J-EW for qemu-devel@nongnu.org; Tue, 24 Mar 2009 16:19:59 -0400 Received: from [199.232.76.173] (port=55750 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LmD6J-00049G-8E for qemu-devel@nongnu.org; Tue, 24 Mar 2009 16:19:55 -0400 Received: from g5t0009.atlanta.hp.com ([15.192.0.46]:12514) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LmD6I-0006iI-T1 for qemu-devel@nongnu.org; Tue, 24 Mar 2009 16:19:55 -0400 Date: Tue, 24 Mar 2009 14:19:25 -0600 From: Chris Smith Subject: Re: [Qemu-devel] Kernel core dumps from qemu Message-ID: <20090324201924.GA27406@ldl.fc.hp.com> References: <20090324165401.GA2999@ldl.fc.hp.com> <49C921A6.3070202@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <49C921A6.3070202@redhat.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: anderson@redhat.com On Tue, Mar 24, 2009 at 08:08:38PM +0200, Avi Kivity wrote: > I'd suggest a 'format' argument, so we can extend this later to dump > in non-ELF formats (the Windows native memory dump format would be > useful). No problem. I was thinking of something similar -- (qemu) dump | winfmt > win.dmp or (qemu) dump | /usr/bin/gdbfmt > just.like.vmcore or (qemu) dump > raw.elf [normal case for crash utility] with qemu providing a dump primitive (just the data) to be dressed up by tools distributed with qemu, or contributed, or home grown. The | and > are just to be explicit, it could be prettier. (gdbfmt would just look up PAGE_OFFSET and alter the elf header.) (gdbfmt needs a path to System.map, if so, better it than qemu.) > I suppose the core format handles smp? I think so. kdump dumps out the memory and the registers (for each cpu). memory: kdump dumps out the physical memory and its virtual addresses. It (vmcore.c) is given a list of physical memory addresses and sizes. qemu has cpu_physical_memory_rw() -- I think that's the right one -- and page tables. qemu can dump out the physical memory but without virtual addresses. registers: kdump dumps out the registers, in NT_PRSTATUS notes. crash_save_cpu() does this, it's in /usr/src/linux/kernel/kexec.c. struct prstatus is in /usr/include/linux/elfcore.h. For smp, it's one NT_PRSTATUS note per cpu, in the order 0,1,2,... For qemu's registers in the raw dump, struct prstatus is sort of one endpoint, it matches kdump's vmcore. Free tools. The other endpoint is CPUState. If some dump format wants something, it's there, or else qemu doesn't have it. The dump formatters would be kind of grizzly, knowing way too much about qemu internals and targets. Maybe it should use XML. Well, no. Anyway, the dump should provide everything kdump does, except current->pid for each cpu. There is no indication what that is for.