strace allows you to monitor the activity of a particular program. How can I monitor the activity of all programs (expect for sshd/bash/strace_itself)?
Currently I'm using a hack like this:
function ppid() { cat /proc/"$1"/status | grep PPid: | grep -o "[0-9]*"; };
function pidtree() { P=$1; while [ "$P" != "1" ]; do echo $P; P=`ppid $P`; done; echo 1; };
strace -fe execve `( pgrep ''; pidtree $$ ) | sort | uniq -u | sed 's/^/-p /'`
Note: using this can freeze your system.
Is there a better way to do it?