----- "Sharyathi Nagesh" <[email protected]> wrote:
> Description
> Sub-command "swap" in crash command doesn't show any info about swap
> partition in kernel versions 2.6.28 and above
>
> crash> swap
> FILENAME TYPE SIZE USED PCT PRIORITY
> crash> q
> feastlp4:~ #
Yes, I was already aware of that issue (big-endian only), and have a
patch queued for 5.0.3:
- Fix for "swap" and "kmem -i" commands on 2.6.29 or later, big-endian,
ppc64 kernels, where the swap_info_struct.flags member was changed
from an int to a long. Without the patch, the "swap" command does
not display any swap data, and the "kmem -i" command indicates that
there is no swap memory used or available.
([email protected])
Thanks,
Dave
Index: memory.c
===================================================================
RCS file: /nfs/projects/cvs/crash/memory.c,v
retrieving revision 1.213
retrieving revision 1.214
diff -u -r1.213 -r1.214
--- memory.c 26 Mar 2010 19:14:17 -0000 1.213
+++ memory.c 30 Mar 2010 17:26:02 -0000 1.214
@@ -11553,8 +11553,8 @@
dump_swap_info(ulong swapflags, ulong *totalswap_pages, ulong *totalused_pages)
{
int i, j;
- int flags, swap_device, pages, prio, usedswap;
- ulong swap_file, max, swap_map, pct;
+ int swap_device, pages, prio, usedswap;
+ ulong flags, swap_file, max, swap_map, pct;
ulong vfsmnt;
ulong swap_info, swap_info_ptr;
ushort *smap;
@@ -11590,8 +11590,12 @@
} else
fill_swap_info(swap_info);
- flags = INT(vt->swap_info_struct +
- OFFSET(swap_info_struct_flags));
+ if (MEMBER_SIZE("swap_info_struct", "flags") == sizeof(uint))
+ flags = UINT(vt->swap_info_struct +
+ OFFSET(swap_info_struct_flags));
+ else
+ flags = ULONG(vt->swap_info_struct +
+ OFFSET(swap_info_struct_flags));
if (!(flags & SWP_USED))
continue;
--
Crash-utility mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/crash-utility