On a live system, you can check the status of swap space through commands such as vmstat and, if you have a Solaris 2 system, the swap command. Unfortunately, neither command can be run against postmortem files. Task:On a Solaris 2 system, find the kernel structure that maintains swap space status and write an adb macro(s) that prints out some of this data. Hints:Each swap file will have its own swapinfo structure. Each swapinfo instruction points to a vnode structure. An example of output to aim for:This example shows both the output of swap -l and our adb macro on a live system. # swap -l swapfile dev swaplo blocks free /dev/dsk/c0t3d0s1 32,25 8 197560 164264 /work/littleswap - 8 32760 32592 # # adb -k -I /mymacros /dev/ksyms /dev/mem physmem 1e03 $<swapinfo zs_softintr_id+0xffc: Swap file: /dev/dsk/c0t3d0s1 cn_dip+0x4ed0: Type: 3 Major: 32 Minor: 25 Blocks: 197560 Free: 164264 0xfc52c540: Swap file: /work/littleswap 0xfc3b1c2c: Type: 1 Major: 0 Minor: 0 Blocks: 32760 Free: 32592 $q # Try to match the output from swap -l instead of swap -s. swap -s reports on physical (anonymous) memory, as well as disk-resident swap space, and therefore involves a lot more work. If you do want to tackle anonymous memory, read the anon.h header file in /usr/include/vm . |