[clug] Counting/watching which executables/scripts are called.

Peter Barker pbarker at barker.dropbear.id.au
Thu Nov 27 00:22:04 GMT 2008


On Thu, 27 Nov 2008, Andrew Janke wrote:

> Anyone happen to know fo a handy-dandy tool to do this?
>
> SystemTap seems to be able to do it (I am guessing I watch an OPEN
> function or something)
>
> I want to turn this thing on, then run a bunch of stuff and have a
> nice table returned showing me which commands were run and how many
> times.

bootchart *may* be able to help you (or the bits that make it up, anyway). 
I really must play with bootchart soon.

strace won't give you a nice table without a bit of post-processing. 
*Very* roughly:

pbarker at milligan:~$ strace -f  -o strace.out -s 8000 bin/log_printing.sh 1 
bw "test page for lenny upgrade"
pbarker at milligan:~$ cat strace.out | grep 'execve' | cut -f 2 -d '"' | sort | uniq -c
       1 /bin/date
       1 bin/log_printing.sh
pbarker at milligan:~$

> Andrew Janke

Yours,
-- 
Peter Barker                          |   Programmer,Sysadmin,Geek.
pbarker at barker.dropbear.id.au	      |   You need a bigger hammer.
:: It's a hack! Expect underscores! - Nigel Williams


More information about the linux mailing list