Hi, How I do check how many times a user defined function is called, by using dtrace. I did from the command line by passing library and system call as arguments to dtrace: $ dtrace -n PID:libc:malloc for example, I defined a function called fun1() and I ''d like to debug fun1() with dtrace to know how many times fun1() is called, total time taken for execution, how many system calls fun1() called. could anyone pls suggest me... -- This message posted from opensolaris.org
michael schuster
2007-Aug-03 14:02 UTC
[dtrace-discuss] User defined functions call from Dtrace...!
rps wrote:> Hi, > How I do check how many times a user defined function is called, by using dtrace. I did from the command line by passing library and system call as arguments to dtrace: > $ dtrace -n PID:libc:malloc > > for example, I defined a function called fun1() and I ''d like to > debug fun1() with dtrace to know how many times fun1() is called, > total time taken for execution, how many system calls fun1() called. > could anyone pls suggest me...hints: - how often: use count() - time taken: use timestamp() creatively in :entry and :return probes - how many syscalls called from fun1: set a flag, and then use count in syscall:::entry/flag/ you can find all the details in the Dtrace guide which you can in turn find on the opensolaris page. HTH Michael -- Michael Schuster Sun Microsystems, Inc. recursion, n: see ''recursion''