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.iehttp://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
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!