Changeset View
Changeset View
Standalone View
Standalone View
cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c
Show First 20 Lines • Show All 1,732 Lines • ▼ Show 20 Lines | |||||
dt_setcontext(dtrace_hdl_t *dtp, dtrace_probedesc_t *pdp) | dt_setcontext(dtrace_hdl_t *dtp, dtrace_probedesc_t *pdp) | ||||
{ | { | ||||
const dtrace_pattr_t *pap; | const dtrace_pattr_t *pap; | ||||
dt_probe_t *prp; | dt_probe_t *prp; | ||||
dt_provider_t *pvp; | dt_provider_t *pvp; | ||||
dt_ident_t *idp; | dt_ident_t *idp; | ||||
char attrstr[8]; | char attrstr[8]; | ||||
int err; | int err; | ||||
size_t prov_len; | |||||
/* | /* | ||||
* Both kernel and pid based providers are allowed to have names | * Both kernel and pid based providers are allowed to have names | ||||
* ending with what could be interpreted as a number. We assume it's | * ending with what could be interpreted as a number. We assume it's | ||||
* a pid and that we may need to dynamically create probes for | * a pid and that we may need to dynamically create probes for | ||||
* that process if: | * that process if: | ||||
* | * | ||||
* (1) The provider doesn't exist, or, | * (1) The provider doesn't exist, or, | ||||
* (2) The provider exists and has DTRACE_PRIV_PROC privilege. | * (2) The provider exists and has DTRACE_PRIV_PROC privilege. | ||||
* | * | ||||
* On an error, dt_pid_create_probes() will set the error message | * On an error, dt_pid_create_probes() will set the error message | ||||
* and tag -- we just have to longjmp() out of here. | * and tag -- we just have to longjmp() out of here. | ||||
*/ | */ | ||||
if (isdigit(pdp->dtpd_provider[strlen(pdp->dtpd_provider) - 1]) && | |||||
prov_len = strlen(pdp->dtpd_provider); | |||||
if ((prov_len > 0 && isdigit(pdp->dtpd_provider[prov_len - 1])) && | |||||
((pvp = dt_provider_lookup(dtp, pdp->dtpd_provider)) == NULL || | ((pvp = dt_provider_lookup(dtp, pdp->dtpd_provider)) == NULL || | ||||
pvp->pv_desc.dtvd_priv.dtpp_flags & DTRACE_PRIV_PROC) && | pvp->pv_desc.dtvd_priv.dtpp_flags & DTRACE_PRIV_PROC) && | ||||
dt_pid_create_probes(pdp, dtp, yypcb) != 0) { | dt_pid_create_probes(pdp, dtp, yypcb) != 0) { | ||||
longjmp(yypcb->pcb_jmpbuf, EDT_COMPILER); | longjmp(yypcb->pcb_jmpbuf, EDT_COMPILER); | ||||
} | } | ||||
/* | /* | ||||
* Call dt_probe_info() to get the probe arguments and attributes. If | * Call dt_probe_info() to get the probe arguments and attributes. If | ||||
▲ Show 20 Lines • Show All 899 Lines • Show Last 20 Lines |