file open/read/write/close/access by process

Hi

want to know what file (descriptor+filename+socket) is being accessed [open,read,write,seek,lseek,close etc] by particular process on solaris.

Purpose : while running perf. test, needs to find where is the bottleneck.

We are providing concurrnet load for around 1 hr and needs to capture data related to file usage pattern by java(its weblogic on sol 10)

one thing is using truss/strace etc, however any good script/tools already avail ?

Not : lsof is not useful, as lsof will give open file at a time, we needs to capture all file related operation for given time period.

Raxit Sheth

Here is a truss command I often use:

truss -dDaef -t exec,open,stat,chdir,read,write,accept,creat,link,unlink,mknod,chmod,chown,lseek,mount,umount,fstat,access,dup,pipe,chroot,lstat,symlink,fchmod,fchown,pread,pwrite,llseek,kaio,stat64,lstat64,fstat64,pread64,pwrite64,creat64,open64,so_socket,so_socketpair,bind,listen,connect,shutdown,recv,recvfrom,send,sendto,getpeername,fork -p pid >/tmp/truss.out 2>&1

With dtrace, you might start with iosnoop: http://www.brendangregg.com/DTrace/iosnoop