[ILUG] Processes
Paul Jakma
paul at clubi.ie
Mon Jun 7 22:10:06 IST 1999
On Mon, 7 Jun 1999, Rob Hill wrote:
Hi all,
maybe this is a stupid question -
Is there any program that lists system calls and their PID as they're
made?
rob
There's two options, process accounting or strace.
process accounting will give you global stats on the amount of
resources used by different users, eg number of system calls, amount
of disk i/o, but isn't fine-grained enough to show /which/
system-calls. This was mainly meant for bean-counting on large shared
systems in the old days i think. (the performance wasted for
accountants.. the horror).
see the sa man page.
strace will show you the exact interaction between a given PID and
the kernel. you can narrow down the range of system calls to monitor
if you want, eg:
strace -e open acmeapp
is an excellent way to root out weird permissions problems.
strace can also attach to running processes and trace their activity
and optionally that of children. So if you really really really
wanted a log of *every* system call, put:
strace -f -v -p 1 > /var/log/system 2>&1
at the beginning of rc.sysinit. This will probably slow down your
computer quite noticably and eat insane amounts of disk space.
regards,
--
Paul Jakma
paul at clubi.ie http://hibernia.clubi.ie
PGP5 key: http://www.clubi.ie/jakma/publickey.txt
-------------------------------------------
Fortune:
Things will get better despite our efforts to improve them.
-- Will Rogers
More information about the ILUG
mailing list