Vladimir Kvashin
2008-Dec-19 09:27 UTC
[dtrace-discuss] Is it possible to attach several DTraces to a single process?
Hi, Is it possible to attach dtrace to a single process twice or more times? (with different scripts)? Each time I tried, it fails with the message "failed to grab pid 13407: process is traced" I ended up with two simplest scripts dtrace -n ''END { printf("BYE"); }'' -p 13407 dtrace -n ''BEGIN { printf("Hi there"); }'' -p 13407 but they failed with the same message. Does this mean that it is impossible to attach several scripts to a single process? Or do I misunderstand something? Thank you, Vladimir -- This message posted from opensolaris.org
Adam Leventhal
2008-Dec-19 16:41 UTC
[dtrace-discuss] Is it possible to attach several DTraces to a single process?
Hey Vladimir, You can''t have multiple dtrace(1M) invocations that use the -p option because each one will try to monitor and consume events about the process''s life-cycle such as loading modules and exiting. You can, however, have multiple DTrace scripts that observe a process by using the pid provider with that process''s id or other providers with an appropriate predicate. Adam On Dec 19, 2008, at 1:27 AM, Vladimir Kvashin wrote:> Hi, > > Is it possible to attach dtrace to a single process twice or more > times? (with different scripts)? > > Each time I tried, it fails with the message > "failed to grab pid 13407: process is traced" > > I ended up with two simplest scripts > > dtrace -n ''END { printf("BYE"); }'' -p 13407 > dtrace -n ''BEGIN { printf("Hi there"); }'' -p 13407 > > but they failed with the same message. > > Does this mean that it is impossible to attach several scripts to a > single process? > Or do I misunderstand something? > > Thank you, > Vladimir > -- > This message posted from opensolaris.org > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org-- Adam Leventhal, Fishworks http://blogs.sun.com/ahl