Restoring crash dump ability for kvm_getswapinfo(3)
Attilio Rao
attilio at freebsd.org
Tue Feb 6 21:13:16 UTC 2007
2007/2/6, John Baldwin <jhb at freebsd.org>:
> The patch below fixes kvm_getswapinfo(3) (and thus pstat -T/pstat -s/swapinfo)
> on crash dumps. The one ugliness in it is that since 'struct swdevt' was
> moved into swap_pager.c, there is no longer a header that I can include to
> get it (used to be in vm/swap_pager.h) so I have a copy of the structure in
> kvm_getswapinfo.c. I'd prefer to move the structures back into
> vm/swap_pager.h.
>
> Index: kvm_getswapinfo.c
> ===================================================================
> RCS file: /usr/cvs/src/lib/libkvm/kvm_getswapinfo.c,v
> retrieving revision 1.26
> diff -u -r1.26 kvm_getswapinfo.c
> --- kvm_getswapinfo.c 31 Jul 2004 18:49:53 -0000 1.26
> +++ kvm_getswapinfo.c 6 Feb 2007 20:31:09 -0000
> @@ -49,18 +49,59 @@
>
> #include "kvm_private.h"
>
> -#define NL_SWAPBLIST 0
> -#define NL_SWDEVT 1
> -#define NL_NSWDEV 2
> -#define NL_DMMAX 3
> +/* Grrr, this is hidden in swap_pager.c now, how annoying. */
> +typedef int32_t swblk_t;
It would not be better exporting swblk_t definition into swap_pager.h,
while you are here?
Attilio
--
Peace can only be achieved by understanding - A. Einstein
More information about the freebsd-arch
mailing list