libdtrace: Don't use a read-only handle for enumerating pid probes.
authormarkj <markj@FreeBSD.org>
Tue, 6 Dec 2016 04:28:56 +0000 (04:28 +0000)
committermarkj <markj@FreeBSD.org>
Tue, 6 Dec 2016 04:28:56 +0000 (04:28 +0000)
commita1166f590b00ba7d2ac7ec580e66e03f98c894d4
treefdee3c77fe7307e72ffa7f8e45b2f7015bac5cc3
parent20f0b6187545498b43b8864e7f0acc05404c430f
libdtrace: Don't use a read-only handle for enumerating pid probes.

Enumeration of return probes involves disassembling subroutines in the
target process, and ptrace(2) is currently used to read from the target
process. libproc could read from the backing file instead to avoid this
problem, but in the common case libdtrace will have a writeable handle
on the process anyway. In particular, a writeable handle is needed to list
USDT probes, and libdtrace will cache such a handle for processes that it
controls via dtrace -c and -p.
cddl/contrib/opensolaris/lib/libdtrace/common/dt_pid.c