Ian
2006-Dec-20 22:26 UTC
[dtrace-discuss] A way to find info about process parent, parent''s parent, and so on?
I am using dtrace on a Mac OS X Leopard beta. Currently I''m tracing read operations. I''d like to get info about the process which is creating the reads, as well as information about parent processes. The least amount of information I need is pid and process name, but more would certainly be a plus! I know that in the probe entry, pid, ppid, and process name are easily accessible. Like so: syscall::open:entry { printf("I know the pid (%d), the parent pid (%d), and the process name!", pid, ppid, execname); } I''d like to know how to find the parent''s process name. I''d also like to be able to go further up the hierarchy, e.g. find the grandparent pid, pname and so on. I''ve thought about tracing process creations and maintaining this information locally. However, I would prefer using this information if it was available through dtrace. Is there a way to do this in dtrace? This message posted from opensolaris.org