rem: if (ecb->dte_state == dtrace_anon.dta_state) {  rec->dtrd_uarg = 0; } else { rec->dtrd_uarg = desc->dtad_uarg; }
add: rec->dtrd_uarg = desc->dtad_uarg;
context: dtrace_ecb_action_add(dtrace_ecb_t *ecb, dtrace_actdesc_t *desc){	dtrace_action_t *action, *last;	dtrace_difo_t *dp = desc->dtad_difo;	uint32_t size = 0, align = sizeof (uint8_t), mask;	uint16_t format = 0;	dtrace_recdesc_t *rec;	dtrace_state_t *state = ecb->dte_state;	dtrace_optval_t *opt = state->dts_options, nframes, strsize;	uint64_t arg = desc->dtad_arg;	ASSERT(MUTEX_HELD(&dtrace_lock));	ASSERT(ecb->dte_action == NULL || ecb->dte_action->dta_refcnt == 1);	if (DTRACEACT_ISAGG(desc->dtad_kind)) {		/*		 * If this is an aggregating action, there must be neither		 * a speculate nor a commit on the action chain.		 */		dtrace_action_t *act;		for (act = ecb->dte_action; act != NULL; act = act->dta_next) {			if (act->dta_kind == DTRACEACT_COMMIT)				return (EINVAL);			if (act->dta_kind == DTRACEACT_SPECULATE)				return (EINVAL);		}		action = dtrace_ecb_aggregation_create(ecb, desc);		if (action == NULL)			return (EINVAL);	} else {		if (DTRACEACT_ISDESTRUCTIVE(desc->dtad_kind) ||		    (desc->dtad_kind == DTRACEACT_DIFEXPR &&		    dp != NULL && dp->dtdo_destructive)) {			state->dts_destructive = 1;		}		switch (desc->dtad_kind) {		case DTRACEACT_PRINTF:		case DTRACEACT_PRINTA:		case DTRACEACT_SYSTEM:		case DTRACEACT_FREOPEN:			/*			 * We know that our arg is a string -- turn it into a			 * format.			 */			if (arg == NULL) {				ASSERT(desc->dtad_kind == DTRACEACT_PRINTA);				format = 0;			} else {				ASSERT(arg != NULL);				ASSERT(arg > KERNELBASE);				format = dtrace_format_add(state,				    (char *)(uintptr_t)arg);			}			/*FALLTHROUGH*/		case DTRACEACT_LIBACT:		case DTRACEACT_DIFEXPR:			if (dp == NULL)				return (EINVAL);			if ((size = dp->dtdo_rtype.dtdt_size) != 0)				break;			if (dp->dtdo_rtype.dtdt_kind == DIF_TYPE_STRING) {				if (!(dp->dtdo_rtype.dtdt_flags & DIF_TF_BYREF))					return (EINVAL);				size = opt[DTRACEOPT_STRSIZE];			}			break;		case DTRACEACT_STACK:			if ((nframes = arg) == 0) {				nframes = opt[DTRACEOPT_STACKFRAMES];				ASSERT(nframes > 0);				arg = nframes;			}			size = nframes * sizeof (pc_t);			break;		case DTRACEACT_JSTACK:			if ((strsize = DTRACE_USTACK_STRSIZE(arg)) == 0)				strsize = opt[DTRACEOPT_JSTACKSTRSIZE];			if ((nframes = DTRACE_USTACK_NFRAMES(arg)) == 0)				nframes = opt[DTRACEOPT_JSTACKFRAMES];			arg = DTRACE_USTACK_ARG(nframes, strsize);			/*FALLTHROUGH*/		case DTRACEACT_USTACK:			if (desc->dtad_kind != DTRACEACT_JSTACK &&			    (nframes = DTRACE_USTACK_NFRAMES(arg)) == 0) {				strsize = DTRACE_USTACK_STRSIZE(arg);				nframes = opt[DTRACEOPT_USTACKFRAMES];				ASSERT(nframes > 0);				arg = DTRACE_USTACK_ARG(nframes, strsize);			}			/*			 * Save a slot for the pid.			 */			size = (nframes + 1) * sizeof (uint64_t);			size += DTRACE_USTACK_STRSIZE(arg);			size = P2ROUNDUP(size, (uint32_t)(sizeof (uintptr_t)));			break;		case DTRACEACT_SYM:		case DTRACEACT_MOD:			if (dp == NULL || ((size = dp->dtdo_rtype.dtdt_size) !=			    sizeof (uint64_t)) ||			    (dp->dtdo_rtype.dtdt_flags & DIF_TF_BYREF))				return (EINVAL);			break;		case DTRACEACT_USYM:		case DTRACEACT_UMOD:		case DTRACEACT_UADDR:			if (dp == NULL ||			    (dp->dtdo_rtype.dtdt_size != sizeof (uint64_t)) ||			    (dp->dtdo_rtype.dtdt_flags & DIF_TF_BYREF))				return (EINVAL);			/*			 * We have a slot for the pid, plus a slot for the			 * argument.  To keep things simple (aligned with			 * bitness-neutral sizing), we store each as a 64-bit			 * quantity.			 */			size = 2 * sizeof (uint64_t);			break;		case DTRACEACT_STOP:		case DTRACEACT_BREAKPOINT:		case DTRACEACT_PANIC:			break;		case DTRACEACT_CHILL:		case DTRACEACT_DISCARD:		case DTRACEACT_RAISE:			if (dp == NULL)				return (EINVAL);			break;		case DTRACEACT_EXIT:			if (dp == NULL ||			    (size = dp->dtdo_rtype.dtdt_size) != sizeof (int) ||			    (dp->dtdo_rtype.dtdt_flags & DIF_TF_BYREF))				return (EINVAL);			break;		case DTRACEACT_SPECULATE:			if (ecb->dte_size > sizeof (dtrace_epid_t))				return (EINVAL);			if (dp == NULL)				return (EINVAL);			state->dts_speculates = 1;			break;		case DTRACEACT_COMMIT: {			dtrace_action_t *act = ecb->dte_action;			for (; act != NULL; act = act->dta_next) {				if (act->dta_kind == DTRACEACT_COMMIT)					return (EINVAL);			}			if (dp == NULL)				return (EINVAL);			break;		}		default:			return (EINVAL);		}		if (size != 0 || desc->dtad_kind == DTRACEACT_SPECULATE) {			/*			 * If this is a data-storing action or a speculate,			 * we must be sure that there isn't a commit on the			 * action chain.			 */			dtrace_action_t *act = ecb->dte_action;			for (; act != NULL; act = act->dta_next) {				if (act->dta_kind == DTRACEACT_COMMIT)					return (EINVAL);			}		}		action = kmem_zalloc(sizeof (dtrace_action_t), KM_SLEEP);		action->dta_rec.dtrd_size = size;	}	action->dta_refcnt = 1;	rec = &action->dta_rec;	size = rec->dtrd_size;	for (mask = sizeof (uint64_t) - 1; size != 0 && mask > 0; mask >>= 1) {		if (!(size & mask)) {			align = mask + 1;			break;		}	}	action->dta_kind = desc->dtad_kind;	if ((action->dta_difo = dp) != NULL)		dtrace_difo_hold(dp);	rec->dtrd_action = action->dta_kind;	rec->dtrd_arg = arg;	if (ecb->dte_state == dtrace_anon.dta_state) {		/*		 * If this is an anonymous enabling, explicitly clear the uarg.		 */		rec->dtrd_uarg = 0;	} else {		rec->dtrd_uarg = desc->dtad_uarg;	}	rec->dtrd_alignment = (uint16_t)align;	rec->dtrd_format = format;	if ((last = ecb->dte_action_last) != NULL) {		ASSERT(ecb->dte_action != NULL);		action->dta_prev = last;		last->dta_next = action;	} else {		ASSERT(ecb->dte_action == NULL);		ecb->dte_action = action;	}	ecb->dte_action_last = action;	return (0);}