for p in $(grep Swap /proc/*/status|grep -v ' 0 kB$'|awk -F"/" '{print $3}')
do
  (awk -F'[ \t-]+' '/^[a-f0-9]*-[a-f0-9]* /{recent="0x"$1" 0x"$2}/Swap:/&&$2>0{print recent}' /proc/${p}/smaps | while read astart aend; do gdb --batch --pid ${p} -ex "dump memory /dev/null $astart $aend" &>/dev/null; done)&
done
