Discussion:
USDT probes and fork(2)
Rui Paulo
2010-09-01 12:42:32 UTC
Permalink
Hi,
I'm having a problem with USDT probes on FreeBSD. What probes should the child process have when the parent is the one who installs USDT probes?
I see a problem with postgresql where drti.o installs the USDT probes but then postgresql forks and the new child(s) don't install any new probes. From my understand of the code, this was expected.

Any idea what should be happening here?

Thanks,
--
Rui Paulo
Adam Leventhal
2010-09-07 16:38:05 UTC
Permalink
Post by Rui Paulo
I'm having a problem with USDT probes on FreeBSD. What probes should the child process have when the parent is the one who installs USDT probes?
I see a problem with postgresql where drti.o installs the USDT probes but then postgresql forks and the new child(s) don't install any new probes. From my understand of the code, this was expected.
Any idea what should be happening here?
When a process with registered USDT probes forks, those probes should
be copied into the child process. We do this from cfork() where the
interesting part is here:

http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/uts/common/dtrace/dtrace.c#dtrace_helpers_duplicate

Adam
Rui Paulo
2010-09-08 12:36:41 UTC
Permalink
Post by Adam Leventhal
Post by Rui Paulo
I'm having a problem with USDT probes on FreeBSD. What probes should the child process have when the parent is the one who installs USDT probes?
I see a problem with postgresql where drti.o installs the USDT probes but then postgresql forks and the new child(s) don't install any new probes. From my understand of the code, this was expected.
Any idea what should be happening here?
When a process with registered USDT probes forks, those probes should
be copied into the child process. We do this from cfork() where the
http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/uts/common/dtrace/dtrace.c#dtrace_helpers_duplicate
This makes more sense now. Thanks!

Regards,
--
Rui Paulo

Adam Leventhal
2010-09-07 16:39:14 UTC
Permalink
Post by Rui Paulo
I'm having a problem with USDT probes on FreeBSD. What probes should the child process have when the parent is the one who installs USDT probes?
I see a problem with postgresql where drti.o installs the USDT probes but then postgresql forks and the new child(s) don't install any new probes. From my understand of the code, this was expected.
Any idea what should be happening here?
When a process with registered USDT probes forks, those probes should
be copied into the child process. We do this from cfork() where the
interesting part is here:

http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/uts/common/dtrace/dtrace.c#dtrace_helpers_duplicate

Adam
Loading...