[Crash-utility] [PATCH] kmem, snap: iomem/ioport display and vmcore snapshot support

HATAYAMA Daisuke d.hatayama at jp.fujitsu.com
Tue Mar 13 10:21:07 UTC 2012


Some days ago I was in a situation that I had to convert vmcore in
kvmdump format into ELF since some extension module we have locally
can be used only on relatively old crash utility, around version 4,
but such old crash utility cannot handle kvmdump format.

To do the conversion in handy, I used snap command with some modifications
so that it tries to use iomem information in vmcore instead of host's
/proc/iomem. This patch is its cleaned-up version.

In this development, I naturally got down to also making an interface
for an access to resource objects, and so together with the snap
command's patch, I also extended kmem command for iomem/ioport
support. Actually:

kmem -r displays /proc/iomem

crash> kmem -r
00000000-0000ffff : reserved
00010000-0009dbff : System RAM
0009dc00-0009ffff : reserved
000c0000-000c7fff : Video ROM
...

and kmem -R displays /proc/ioport

crash> kmem -R
0000-001f : dma1
0020-0021 : pic1
0040-0043 : timer0
0050-0053 : timer1
...

Looking into old version of kernel source code back, resource structure
has been unchanged since linux-2.4.0. I borrowed the way of walking on
resouce tree in this patch from the lastest v3.3-rc series, but I
guess the logic is also applicable to old kernels. I expect Dave's
regression testsuite.

Also, there would be another command more sutable for iomem/ioport.
If necessay, I'll repost the patch.
---

HATAYAMA Daisuke (4):
      Add vmcore snapshot support
      Add kmem -r and -R options
      Add dump iomem/ioport functions; a helper for resource objects
      Add a helper function for iterating resource objects


 defs.h            |    9 ++++
 extensions/snap.c |   54 ++++++++++++++++++++++-
 help.c            |    2 +
 memory.c          |  122 +++++++++++++++++++++++++++++++++++++++++++++++++++--
 4 files changed, 180 insertions(+), 7 deletions(-)

--
Thanks.
HATAYAMA Daisuke
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-a-helper-function-for-iterating-resource-objects.patch
Type: application/octet-stream
Size: 3502 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/crash-utility/attachments/20120313/fc9013d4/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Add-dump-iomem-ioport-functions.patch
Type: application/octet-stream
Size: 1646 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/crash-utility/attachments/20120313/fc9013d4/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-Add-kmem-r-and-R-options.patch
Type: application/octet-stream
Size: 3355 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/crash-utility/attachments/20120313/fc9013d4/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-Add-vmcore-snapshot-support.patch
Type: application/octet-stream
Size: 3056 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/crash-utility/attachments/20120313/fc9013d4/attachment-0003.obj>


More information about the Crash-utility mailing list