szaydel
6/1/2016 - 6:31 PM

BrickstorOS Process Information

BrickstorOS Process Information

#!/bin/sh
# This expects intput to be the name of process in memory, for example,
# assuming name of process as seen by `ps` is foo, first, and only
# argument should be foo.

if [ -z $1 ] ; then exit 1 ; fi

for proc in `pgrep $@ | sort -n`; do
  /usr/bin/pmap -x "${proc}" \
  | awk -v p=$proc '
    /total/ {printf("pid: %d\ pages allocated: %dK actual shared: %dK\n", p,$3,$4)}'
done