Robert C. Broeckelmann Jr.
2007-Mar-26 21:08 UTC
[dtrace-discuss] system call count stats broken down by lwp
I''ve seen the dtruss DTrace script that will summarize statistics for the system calls that have been made by a particular process. I need to generate a similar report, but I need the statistics broken down by lwp (for all lwps in the process). Is there an easy way of doing this? I haven''t really used DTrace before. Thanks in advance. This message posted from opensolaris.org
Jim Fiori
2007-Mar-26 22:27 UTC
[dtrace-discuss] system call count stats broken down by lwp
Robert C. Broeckelmann Jr. wrote:> I''ve seen the dtruss DTrace script that will summarize statistics for the system calls that have been made by a particular process. I need to generate a similar report, but I need the statistics broken down by lwp (for all lwps in the process). Is there an easy way of doing this? > > I haven''t really used DTrace before. > > Thanks in advance.Sure, try this: # cat lwpsc.d #!/usr/sbin/dtrace -qs syscall:::entry /pid == $1/ { @[tid,probefunc] = count(); } END { printf ("%10s %15s %6s\n","TID", "Syscall","count"); printa ("%10d %15s %@6d\n",@); } # chmod 755 lwpsc.d ./lwpsc.d 2167 ^C TID Syscall count 1 write 1 7 lwp_park 3 8 lwp_park 3 122 lwp_park 3 132 lwp_park 3 139 lwp_park 3 176 lwp_park 3 178 lwp_park 3 179 lwp_park 3 180 lwp_park 3 1 lwp_park 25 4 write 29 1 pollsys 30 1 ioctl 31 1 read 31 4 lwp_park 54 Jim