strace
strace is a program which monitors a process's interaction with the kernel via system calls.
You may either monitor a process's entire life with it:
strace ls
or, you can monitor a process already in progress by giving its pid:
strace -p 1234
or, if you don't want to look up the pid:
strace -p `pidof -s foo`