hi: How can I got my own pid$target provider? So that I can trace application like "telnet". Should I recompile the source to link with dtrace ? Like below,I want to use "map.d" to trace "telnet" : ############################################################ D400_11n:/export/testws #cat map.d #!/usr/sbin/dtrace -qs pid$target:::entry { self->depth++; printf("%*.s -> %s`%s\n", self->depth, " ", probemod, probefunc); } pid$target:::return /self->depth/ { printf("%*.s <- %s`%s\n", self->depth, " ", probemod, probefunc); self->depth--; } D400_11n:/export/testws # D400_11n:/export/testws #./map.d -p `pgrep telnet|tail -1` ^C Cheers ????????zheh ????????zheh at 163.com ??????????2006-05-03
Adam Leventhal
2006-May-02 20:35 UTC
[dtrace-discuss] how to get my own pid$target provider ?
You don''t have to recompile the application or even restart it. Using the script below, you just need to specify the -p <pid> or -c <command> option to dtrace(1M). Adam On Wed, May 03, 2006 at 04:03:16AM +0800, zheh wrote:> hi: > How can I got my own pid$target provider? So that I can trace application like "telnet". > Should I recompile the source to link with dtrace ? > > > Like below,I want to use "map.d" to trace "telnet" : > ############################################################ > D400_11n:/export/testws #cat map.d > #!/usr/sbin/dtrace -qs > > pid$target:::entry > { > self->depth++; > printf("%*.s -> %s`%s\n", self->depth, " ", probemod, probefunc); > } > > pid$target:::return > /self->depth/ > { > printf("%*.s <- %s`%s\n", self->depth, " ", probemod, probefunc); > self->depth--; > } > D400_11n:/export/testws # > D400_11n:/export/testws #./map.d -p `pgrep telnet|tail -1` > ^C > > > Cheers > > > ????????????????zheh > ????????????????zheh at 163.com > ????????????????????2006-05-03> _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org-- Adam Leventhal, Solaris Kernel Development http://blogs.sun.com/ahl