Lines Matching defs:mstate
652 dtrace_inscratch(uintptr_t dest, size_t size, dtrace_mstate_t *mstate)
654 if (dest < mstate->dtms_scratch_base)
660 if (dest + size > mstate->dtms_scratch_ptr)
693 dtrace_canstore(uint64_t addr, size_t sz, dtrace_mstate_t *mstate,
702 a = mstate->dtms_scratch_base;
703 s = mstate->dtms_scratch_size;
2449 dtrace_dif_variable(dtrace_mstate_t *mstate, dtrace_state_t *state, uint64_t v,
2463 ASSERT(mstate->dtms_present & DTRACE_MSTATE_ARGS);
2464 if (ndx >= sizeof (mstate->dtms_arg) /
2465 sizeof (mstate->dtms_arg[0])) {
2467 int aframes = mstate->dtms_probe->dtpr_aframes + 2;
2470 int aframes = mstate->dtms_probe->dtpr_aframes + 3;
2475 pv = mstate->dtms_probe->dtpr_provider;
2478 mstate->dtms_probe->dtpr_id,
2479 mstate->dtms_probe->dtpr_arg, ndx, aframes);
2482 else if (mstate->dtms_probe->dtpr_id == dtrace_probeid_error && ndx == 5) {
2483 return ((dtrace_state_t *)(mstate->dtms_arg[0]))->dts_arg_error_illval;
2498 if (mstate->dtms_probe != NULL)
2504 return (mstate->dtms_arg[ndx]);
2552 if (!(mstate->dtms_present & DTRACE_MSTATE_TIMESTAMP)) {
2553 mstate->dtms_timestamp = dtrace_gethrtime();
2554 mstate->dtms_present |= DTRACE_MSTATE_TIMESTAMP;
2556 return (mstate->dtms_timestamp);
2569 if (!(mstate->dtms_present & DTRACE_MSTATE_WALLTIMESTAMP)) {
2570 mstate->dtms_walltimestamp = dtrace_gethrestime();
2571 mstate->dtms_present |= DTRACE_MSTATE_WALLTIMESTAMP;
2573 return (mstate->dtms_walltimestamp);
2578 if (!(mstate->dtms_present & DTRACE_MSTATE_IPL)) {
2579 mstate->dtms_ipl = dtrace_getipl();
2580 mstate->dtms_present |= DTRACE_MSTATE_IPL;
2582 return (mstate->dtms_ipl);
2585 ASSERT(mstate->dtms_present & DTRACE_MSTATE_EPID);
2586 return (mstate->dtms_epid);
2589 ASSERT(mstate->dtms_present & DTRACE_MSTATE_PROBE);
2590 return (mstate->dtms_probe->dtpr_id);
2595 if (!(mstate->dtms_present & DTRACE_MSTATE_STACKDEPTH)) {
2597 int aframes = mstate->dtms_probe->dtpr_aframes + 2;
2600 int aframes = mstate->dtms_probe->dtpr_aframes + 3;
2603 mstate->dtms_stackdepth = dtrace_getstackdepth(aframes);
2604 mstate->dtms_present |= DTRACE_MSTATE_STACKDEPTH;
2606 return (mstate->dtms_stackdepth);
2611 if (!(mstate->dtms_present & DTRACE_MSTATE_USTACKDEPTH)) {
2615 if (DTRACE_ANCHORED(mstate->dtms_probe) &&
2617 mstate->dtms_ustackdepth = 0;
2620 mstate->dtms_ustackdepth =
2624 mstate->dtms_present |= DTRACE_MSTATE_USTACKDEPTH;
2626 return (mstate->dtms_ustackdepth);
2631 if (!(mstate->dtms_present & DTRACE_MSTATE_CALLER)) {
2633 int aframes = mstate->dtms_probe->dtpr_aframes + 2;
2636 int aframes = mstate->dtms_probe->dtpr_aframes + 3;
2639 if (!DTRACE_ANCHORED(mstate->dtms_probe)) {
2649 (uint32_t *)(uintptr_t)mstate->dtms_arg[0]);
2650 mstate->dtms_caller = caller[1];
2651 } else if ((mstate->dtms_caller =
2661 mstate->dtms_caller = caller;
2664 mstate->dtms_present |= DTRACE_MSTATE_CALLER;
2666 return (mstate->dtms_caller);
2672 if (!(mstate->dtms_present & DTRACE_MSTATE_UCALLER)) {
2684 mstate->dtms_ucaller = ustack[2];
2685 mstate->dtms_present |= DTRACE_MSTATE_UCALLER;
2688 return (mstate->dtms_ucaller);
2691 ASSERT(mstate->dtms_present & DTRACE_MSTATE_PROBE);
2693 mstate->dtms_probe->dtpr_provider->dtpv_name);
2696 ASSERT(mstate->dtms_present & DTRACE_MSTATE_PROBE);
2698 mstate->dtms_probe->dtpr_mod);
2701 ASSERT(mstate->dtms_present & DTRACE_MSTATE_PROBE);
2703 mstate->dtms_probe->dtpr_func);
2706 ASSERT(mstate->dtms_present & DTRACE_MSTATE_PROBE);
2708 mstate->dtms_probe->dtpr_name);
2720 if (DTRACE_ANCHORED(mstate->dtms_probe) && CPU_ON_INTR(CPU))
2743 if (DTRACE_ANCHORED(mstate->dtms_probe) && CPU_ON_INTR(CPU))
2758 if (DTRACE_ANCHORED(mstate->dtms_probe) && CPU_ON_INTR(CPU))
2770 if (DTRACE_ANCHORED(mstate->dtms_probe) && CPU_ON_INTR(CPU))
2781 if (DTRACE_ANCHORED(mstate->dtms_probe) && CPU_ON_INTR(CPU))
2790 if (DTRACE_ANCHORED(mstate->dtms_probe) && CPU_ON_INTR(CPU))
2804 if (DTRACE_ANCHORED(mstate->dtms_probe) && CPU_ON_INTR(CPU))
2818 char *xname = (char *)mstate->dtms_scratch_ptr;
2822 if (mstate->dtms_scratch_ptr + scratch_size >
2823 mstate->dtms_scratch_base + mstate->dtms_scratch_size)
2829 mstate->dtms_scratch_ptr += scratch_size;
2843 if (DTRACE_ANCHORED(mstate->dtms_probe) && CPU_ON_INTR(CPU))
2871 if (DTRACE_ANCHORED(mstate->dtms_probe) && CPU_ON_INTR(CPU))
2883 if (DTRACE_ANCHORED(mstate->dtms_probe) && CPU_ON_INTR(CPU))
2900 if (DTRACE_ANCHORED(mstate->dtms_probe) && CPU_ON_INTR(CPU))
2912 if (DTRACE_ANCHORED(mstate->dtms_probe) && CPU_ON_INTR(CPU))
2930 if (DTRACE_ANCHORED(mstate->dtms_probe) && CPU_ON_INTR(CPU))
2947 if (DTRACE_ANCHORED(mstate->dtms_probe) && CPU_ON_INTR(CPU))
2970 dtrace_mstate_t *mstate, dtrace_state_t *state)
3056 if (!dtrace_inscratch(dest, size, mstate)) {
3068 uintptr_t dest = P2ROUNDUP(mstate->dtms_scratch_ptr, 8);
3071 size_t scratch_size = (dest - mstate->dtms_scratch_ptr) + size;
3078 if (mstate->dtms_scratch_ptr + scratch_size >
3079 mstate->dtms_scratch_base + mstate->dtms_scratch_size) {
3096 mstate->dtms_scratch_ptr += scratch_size;
3110 if (!dtrace_inscratch(dest, size, mstate)) {
3128 uintptr_t dest = mstate->dtms_scratch_ptr;
3139 if (mstate->dtms_scratch_ptr + size >
3140 mstate->dtms_scratch_base + mstate->dtms_scratch_size) {
3156 mstate->dtms_scratch_ptr += size;
3517 char *dest = (char *)mstate->dtms_scratch_ptr;
3520 if (mstate->dtms_scratch_ptr + size >
3521 mstate->dtms_scratch_base + mstate->dtms_scratch_size) {
3530 * strtok pointer from the mstate. Note that this
3535 addr = mstate->dtms_strtok;
3574 mstate->dtms_strtok = NULL;
3595 mstate->dtms_scratch_ptr += size;
3596 mstate->dtms_strtok = addr;
3603 char *d = (char *)mstate->dtms_scratch_ptr;
3612 if (mstate->dtms_scratch_ptr + size >
3613 mstate->dtms_scratch_base + mstate->dtms_scratch_size) {
3641 mstate->dtms_scratch_ptr += size;
3684 uintptr_t dest = mstate->dtms_scratch_ptr;
3692 if (size == 0 || mstate->dtms_scratch_ptr + size >
3693 mstate->dtms_scratch_base + mstate->dtms_scratch_size) {
3854 mstate->dtms_scratch_ptr += size;
3868 char *d = (char *)mstate->dtms_scratch_ptr;
3874 if (mstate->dtms_scratch_ptr + size >
3875 mstate->dtms_scratch_base + mstate->dtms_scratch_size) {
3906 mstate->dtms_scratch_ptr += i;
3917 char *end = (char *)mstate->dtms_scratch_ptr + size - 1;
3919 if (mstate->dtms_scratch_ptr + size >
3920 mstate->dtms_scratch_base + mstate->dtms_scratch_size) {
3936 mstate->dtms_scratch_ptr += size;
3942 char *dest = (char *)mstate->dtms_scratch_ptr;
3949 if (mstate->dtms_scratch_ptr + size >
3950 mstate->dtms_scratch_base + mstate->dtms_scratch_size) {
4063 mstate->dtms_scratch_ptr += size;
4068 char *dest = (char *)mstate->dtms_scratch_ptr, c;
4073 if (mstate->dtms_scratch_ptr + size >
4074 mstate->dtms_scratch_base + mstate->dtms_scratch_size) {
4167 mstate->dtms_scratch_ptr += size;
4202 dtrace_dif_emulate(dtrace_difo_t *difo, dtrace_mstate_t *mstate,
4366 if (!dtrace_canstore(regs[r1], 1, mstate, vstate)) {
4376 if (!dtrace_canstore(regs[r1], 2, mstate, vstate)) {
4386 if (!dtrace_canstore(regs[r1], 4, mstate, vstate)) {
4396 if (!dtrace_canstore(regs[r1], 1, mstate, vstate)) {
4406 if (!dtrace_canstore(regs[r1], 2, mstate, vstate)) {
4416 if (!dtrace_canstore(regs[r1], 4, mstate, vstate)) {
4426 if (!dtrace_canstore(regs[r1], 8, mstate, vstate)) {
4485 regs[rd] = dtrace_dif_variable(mstate, state,
4520 regs[rd] = dtrace_dif_variable(mstate, state, id, 0);
4732 regs, tupregs, ttop, mstate, state);
4861 uintptr_t ptr = P2ROUNDUP(mstate->dtms_scratch_ptr, 8);
4862 size_t size = ptr - mstate->dtms_scratch_ptr + regs[r1];
4864 if (mstate->dtms_scratch_ptr + size >
4865 mstate->dtms_scratch_base +
4866 mstate->dtms_scratch_size) {
4871 mstate->dtms_scratch_ptr, size);
4872 mstate->dtms_scratch_ptr += size;
4880 mstate, vstate)) {
4891 if (!dtrace_canstore(regs[rd], 1, mstate, vstate)) {
4900 if (!dtrace_canstore(regs[rd], 2, mstate, vstate)) {
4914 if (!dtrace_canstore(regs[rd], 4, mstate, vstate)) {
4928 if (!dtrace_canstore(regs[rd], 8, mstate, vstate)) {
4950 mstate->dtms_fltoffs = opc * sizeof (dif_instr_t);
4951 mstate->dtms_present |= DTRACE_MSTATE_FLTOFFS;
5106 dtrace_action_chill(dtrace_mstate_t *mstate, hrtime_t val)
5146 mstate->dtms_present &= ~DTRACE_MSTATE_TIMESTAMP;
5151 dtrace_action_ustack(dtrace_mstate_t *mstate, dtrace_state_t *state,
5159 uintptr_t old = mstate->dtms_scratch_ptr, saved;
5172 fps = (uint64_t *)P2ROUNDUP(mstate->dtms_scratch_ptr, 8);
5173 size = (uintptr_t)fps - mstate->dtms_scratch_ptr +
5176 if (mstate->dtms_scratch_ptr + size >
5177 mstate->dtms_scratch_base + mstate->dtms_scratch_size) {
5186 mstate->dtms_scratch_ptr += size;
5187 saved = mstate->dtms_scratch_ptr;
5207 mstate->dtms_scratch_ptr = saved;
5214 mstate, state, pcs[i], fps[i]);
5261 mstate->dtms_scratch_ptr = old;
5282 dtrace_mstate_t mstate;
5382 mstate.dtms_probe = probe;
5383 mstate.dtms_arg[0] = arg0;
5384 mstate.dtms_arg[1] = arg1;
5385 mstate.dtms_arg[2] = arg2;
5386 mstate.dtms_arg[3] = arg3;
5387 mstate.dtms_arg[4] = arg4;
5417 mstate.dtms_present = DTRACE_MSTATE_ARGS | DTRACE_MSTATE_PROBE;
5550 ecb->dte_alignment, state, &mstate)) < 0)
5559 mstate.dtms_epid = ecb->dte_epid;
5560 mstate.dtms_present |= DTRACE_MSTATE_EPID;
5566 rval = dtrace_dif_emulate(dp, &mstate, vstate, state);
5604 &mstate, vstate, state);
5657 if (DTRACE_ANCHORED(mstate.dtms_probe) &&
5678 dtrace_action_ustack(&mstate, state,
5698 val = dtrace_dif_emulate(dp, &mstate, vstate, state);
5733 dtrace_action_chill(&mstate, val);
5953 (mstate.dtms_present & DTRACE_MSTATE_FLTOFFS) ?
5954 mstate.dtms_fltoffs : -1, DTRACE_FLAGS2FLT(*flags),
10057 * in a buffer. If mstate is non-NULL, sets the scratch base and size in the
10058 * mstate. Returns the new offset in the buffer, or a negative value if an
10063 dtrace_state_t *state, dtrace_mstate_t *mstate)
10095 if (mstate == NULL)
10098 mstate->dtms_scratch_base = (uintptr_t)tomax + soffs;
10099 mstate->dtms_scratch_size = buf->dtb_size - soffs;
10100 mstate->dtms_scratch_ptr = mstate->dtms_scratch_base;
10280 if (mstate == NULL)
10287 mstate->dtms_scratch_base = (uintptr_t)buf->dtb_xamot;
10288 mstate->dtms_scratch_size = buf->dtb_size;
10289 mstate->dtms_scratch_ptr = mstate->dtms_scratch_base;
13060 dtrace_mstate_t *mstate, dtrace_vstate_t *vstate, int where)
13102 ent->dtht_fltoffs = (mstate->dtms_present & DTRACE_MSTATE_FLTOFFS) ?
13103 mstate->dtms_fltoffs : -1;
13120 dtrace_helper(int which, dtrace_mstate_t *mstate,
13124 uint64_t sarg0 = mstate->dtms_arg[0];
13125 uint64_t sarg1 = mstate->dtms_arg[1];
13142 mstate->dtms_arg[0] = arg0;
13143 mstate->dtms_arg[1] = arg1;
13157 dtrace_helper_trace(helper, mstate, vstate, 0);
13159 if (!dtrace_dif_emulate(pred, mstate, vstate, state))
13169 mstate, vstate, i + 1);
13172 mstate, vstate, state);
13180 dtrace_helper_trace(helper, mstate, vstate,
13185 dtrace_helper_trace(helper, mstate, vstate,
13191 mstate->dtms_arg[0] = sarg0;
13192 mstate->dtms_arg[1] = sarg1;
13198 dtrace_helper_trace(helper, mstate, vstate,
13204 mstate->dtms_arg[0] = sarg0;
13205 mstate->dtms_arg[1] = sarg1;