Caruana, Damien
2006-Jun-08 18:20 UTC
[dtrace-discuss] no more traces when process stop and restart
Hi, I defined some probes inside a user program and I use a very simple dtrace script to enable them: dtrace -qn '':::myProbe {printf("\n %s, arg value: %s, ", probename, copyinstr(arg0) }'' The problem is that my script do not ''reconnect'' if my process is killed and restart, my Dtrace script is still running but do not generate output anymore. Is there a way to trace my defined probes without having to restart my script? Moreover, having my script stopped with my process could be helpful, I know that I can use the -c command to run a process and have the dtrace script exiting when the process complete. But is there a Dtrace option to do the same when I trace a process that is already running? I don''t think an option like -c is provided by Dtrace to do this, but perhaps there is a way to use Dtrace to detect that there is no more probes to trace and so exit. Any help for me? Thank''s Damien -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/dtrace-discuss/attachments/20060608/5bb9f6f6/attachment.html>
Adam Leventhal
2006-Jun-08 18:25 UTC
[dtrace-discuss] no more traces when process stop and restart
Hi Damien, What version of Solaris are you using? There have been some relatively recent changes that may impact what you''re trying to do. Also, does your program fork when it''s starting up? Adam On Thu, Jun 08, 2006 at 08:20:58PM +0200, Caruana, Damien wrote:> > Hi, > > I defined some probes inside a user program and I use a very simple dtrace script to enable them: > > dtrace -qn '':::myProbe {printf("\n %s, arg value: %s, ", probename, copyinstr(arg0) }'' > > The problem is that my script do not ''reconnect'' if my process is killed and restart, my Dtrace script is still running but do not generate output anymore. Is there a way to trace my defined probes without having to restart my script? > > Moreover, having my script stopped with my process could be helpful, I know that I can use the -c command to run a process and have the dtrace script exiting when the process complete. But is there a Dtrace option to do the same when I trace a process that is already running? I don''t think an option like -c is provided by Dtrace to do this, but perhaps there is a way to use Dtrace to detect that there is no more probes to trace and so exit. > > Any help for me? > Thank''s > > Damien >> _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org-- Adam Leventhal, Solaris Kernel Development http://blogs.sun.com/ahl