dt_provider_apple.c [plain text]
#include <dt_impl.h>
#include <dt_provider.h>
#include <ctype.h>
#include <string.h>
#include <mach/machine.h>
#if DTRACE_TARGET_APPLE_EMBEDDED
#include <sys/sysctl.h>
#elif DTRACE_TARGET_APPLE_MAC
#include <sys/csr.h>
#endif
int
dt_probe_noprobe_errno(dtrace_hdl_t *dtp, const dtrace_probedesc_t *pdp)
{
dt_provider_t *pvp;
if (isdigit(pdp->dtpd_provider[strlen(pdp->dtpd_provider) - 1]) &&
((pvp = dt_provider_lookup(dtp, pdp->dtpd_provider)) == NULL ||
pvp->pv_desc.dtvd_priv.dtpp_flags & DTRACE_PRIV_PROC)) {
return EDT_NOPROBE;
}
#if DTRACE_TARGET_APPLE_MAC
if (csr_check(CSR_ALLOW_UNRESTRICTED_DTRACE) != 0) {
return EDT_PROBERESTRICTED;
}
#elif DTRACE_TARGET_APPLE_EMBEDDED
#endif
return EDT_NOPROBE;
}