- Timestamp:
- Jan 2, 2015 12:13:55 PM (10 years ago)
- Location:
- trunk/src/VBox/ExtPacks/VBoxDTrace
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ExtPacks/VBoxDTrace/include/VBoxDTraceTypes.h
r53636 r53640 42 42 typedef uintptr_t pc_t; 43 43 typedef uint32_t zoneid_t; 44 typedef uintptr_tcaddr_t;44 typedef char *caddr_t; 45 45 typedef uint64_t hrtime_t; 46 46 typedef RTCPUID processorid_t; 47 47 typedef RTCCUINTREG greg_t; 48 typedef unsigned int model_t; 48 49 49 50 typedef struct VBoxDtCred … … 60 61 typedef struct VBoxDtVMem vmem_t; 61 62 typedef struct VBoxDtCyclicId *cyclic_id_t; 62 typedef struct VBoxDtThread kthread_t; 63 typedef struct VBoxDtThread proc_t; 63 64 typedef struct VBoxDtThread 65 { 66 hrtime_t t_dtrace_vtime; 67 hrtime_t t_dtrace_start; 68 uint8_t t_dtrace_stop; 69 uintptr_t t_dtrace_scrpc; 70 uintptr_t t_dtrace_astpc; 71 uint32_t t_predcache; 72 } kthread_t; 73 extern kthread_t *VBoxDtGetCurrentThread(void); 74 #define curthread (VBoxDtGetCurrentThread()) 75 76 77 typedef struct VBoxDtProcess 78 { 79 uint32_t p_flag; 80 } proc_t; 81 82 #define SNOCD RT_BIT(0) 83 84 64 85 typedef struct VBoxDtDevInfo dev_info_t; 65 86 typedef struct VBoxDtTaskQueue taskq_t; … … 74 95 { 75 96 RTCPUID cpu_id; 76 void *cpuc_dtrace_illval;97 uintptr_t cpuc_dtrace_illval; 77 98 uint16_t volatile cpuc_dtrace_flags; 78 99 79 100 } cpucore_t; 80 101 81 #define CPU_DTRACE_BADADDR RT_BIT(0) 82 #define CPU_DTRACE_BADALIGN RT_BIT(1) 83 #define CPU_DTRACE_NOFAULT RT_BIT(2) 84 #define CPU_DTRACE_FAULT RT_BIT(3) 85 #define CPU_DTRACE_KPRIV RT_BIT(4) 86 #define CPU_DTRACE_DROP RT_BIT(5) 102 #define CPU_DTRACE_BADADDR RT_BIT(0) 103 #define CPU_DTRACE_BADALIGN RT_BIT(1) 104 #define CPU_DTRACE_BADSTACK RT_BIT(2) 105 #define CPU_DTRACE_KPRIV RT_BIT(3) 106 #define CPU_DTRACE_DIVZERO RT_BIT(4) 107 #define CPU_DTRACE_ILLOP RT_BIT(5) 108 #define CPU_DTRACE_NOSCRATCH RT_BIT(6) 109 #define CPU_DTRACE_UPRIV RT_BIT(7) 110 #define CPU_DTRACE_TUPOFLOW RT_BIT(8) 111 #define CPU_DTRACE_ENTRY RT_BIT(9) 112 #define CPU_DTRACE_FAULT UINT16_C(0x03ff) 113 #define CPU_DTRACE_DROP RT_BIT(12) 114 #define CPU_DTRACE_ERROR UINT16_C(0x13ff) 115 #define CPU_DTRACE_NOFAULT RT_BIT(15) 87 116 88 extern cpucore_t g_aVBoxDtCpuCores[RTCPUSET_MAX_CPUS]; 89 #define cpu_core (g_aVBoxDtCpuCores) 117 extern cpucore_t g_aVBoxDtCpuCores[RTCPUSET_MAX_CPUS]; 118 #define cpu_core (g_aVBoxDtCpuCores) 119 120 cred_t *VBoxDtGetCurrentCreds(void); 121 #define CRED() VBoxDtGetCurrentCreds() 122 123 proc_t *VBoxDtThreadToProc(kthread_t *); 124 125 126 #define ASSERT(a_Expr) Assert(a_Expr) 90 127 91 128 #if 1 /* */ 92 129 93 typedef RTUID uid_t;94 typedef RTPROCESS pid_t;95 typedef RTDEV dev_t;130 typedef RTUID uid_t; 131 typedef RTPROCESS pid_t; 132 typedef RTDEV dev_t; 96 133 #endif 97 134 98 #define NANOSEC RT_NS_1SEC 99 #define MILLISEC RT_MS_1SEC 100 #define NBBY 8 135 #define NANOSEC RT_NS_1SEC 136 #define MILLISEC RT_MS_1SEC 137 #define NBBY 8 138 #define NCPU RTCPUSET_MAX_CPUS 139 #define P2ROUNDUP(uWhat, uAlign) ( ((uWhat) + (uAlign) - 1) & ~(uAlign - 1) ) 140 #define CPU_ON_INTR(a_pCpu) (false) 101 141 142 143 #if defined(RT_ARCH_X86) 144 # ifndef __i386 145 # define __i386 1 146 # endif 147 148 #elif defined(RT_ARCH_AMD64) 149 # ifndef __x86_64 150 # define __x86_64 1 151 # endif 152 153 #else 154 # error "unsupported arch!" 155 #endif 156 157 /** Mark a cast added when porting the code to VBox. 158 * Avoids lots of \#ifdef VBOX otherwise needed to mark up the changes. */ 159 #define VBDTCAST(a_Type) (a_Type) 102 160 103 161 RT_C_DECLS_END -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/uts/common/dtrace/dtrace.c
r53636 r53640 94 94 95 95 #else /* VBOX */ 96 # include <iprt/types.h>97 96 # include <sys/dtrace_impl.h> 97 # include <iprt/assert.h> 98 98 # include <iprt/mp.h> 99 # include <iprt/process.h> 100 # include <iprt/thread.h> 101 102 # undef NULL 103 # define NULL (0) 99 104 #endif /* VBOX */ 100 105 … … 340 345 * signature. 341 346 */ 347 #ifndef VBOX 342 348 #define DTRACE_TLS_THRKEY(where) { \ 343 349 uint_t intr = 0; \ … … 349 355 (((uint64_t)1 << 61) - 1)) | ((uint64_t)intr << 61); \ 350 356 } 357 #else 358 #define DTRACE_TLS_THRKEY(where) do { \ 359 (where) = (((uintptr_t)RTThreadNativeSelf() + DIF_VARIABLE_MAX) & (RT_BIT_64(61) - 1)) \ 360 | (RTThreadIsInInterrupt(NIL_RTTHREAD) ? RT_BIT_64(61) : 0); \ 361 } while (0) 362 #endif 351 363 352 364 #define DT_BSWAP_8(x) ((x) & 0xff) … … 1105 1117 proc_t *proc; 1106 1118 1107 if ((proc = ttoproc(curthread)) != NULL &&1119 if ((proc = VBDT_GET_PROC()) != NULL && 1108 1120 !(proc->p_flag & SNOCD)) 1109 1121 return (1); … … 2235 2247 return; 2236 2248 2237 if (which > state->dts_nspeculations) {2249 if (which > VBDTCAST(unsigned)state->dts_nspeculations) { 2238 2250 cpu_core[cpu].cpuc_dtrace_flags |= CPU_DTRACE_ILLOP; 2239 2251 return; … … 2371 2383 return; 2372 2384 2373 if (which > state->dts_nspeculations) {2385 if (which > VBDTCAST(unsigned)state->dts_nspeculations) { 2374 2386 cpu_core[cpu].cpuc_dtrace_flags |= CPU_DTRACE_ILLOP; 2375 2387 return; … … 2434 2446 } 2435 2447 2436 for (i = 0; i < state->dts_nspeculations; i++) {2448 for (i = 0; i < VBDTCAST(unsigned)state->dts_nspeculations; i++) { 2437 2449 dtrace_speculation_t *spec = &state->dts_speculations[i]; 2438 2450 dtrace_buffer_t *src = &spec->dtsp_buffer[cpu]; … … 2472 2484 dtrace_specid_t i; 2473 2485 2474 for (i = 0; i < state->dts_nspeculations; i++) {2486 for (i = 0; i < VBDTCAST(unsigned)state->dts_nspeculations; i++) { 2475 2487 dtrace_speculation_t *spec = &state->dts_speculations[i]; 2476 2488 … … 2496 2508 * to inactive. 2497 2509 */ 2498 for (i = 0; i < state->dts_nspeculations; i++) {2510 for (i = 0; i < VBDTCAST(unsigned)state->dts_nspeculations; i++) { 2499 2511 dtrace_speculation_t *spec = &state->dts_speculations[i]; 2500 2512 dtrace_speculation_state_t current, new; … … 2533 2545 return (NULL); 2534 2546 2535 if (which > state->dts_nspeculations) {2547 if (which > VBDTCAST(unsigned)state->dts_nspeculations) { 2536 2548 cpu_core[cpuid].cpuc_dtrace_flags |= CPU_DTRACE_ILLOP; 2537 2549 return (NULL); … … 2682 2694 2683 2695 case DIF_VAR_UREGS: { 2696 #ifndef VBOX 2684 2697 klwp_t *lwp; 2685 2698 … … 2694 2707 2695 2708 return (dtrace_getreg(lwp->lwp_regs, ndx)); 2709 #else 2710 cpu_core[VBDT_GET_CPUID()].cpuc_dtrace_flags |= CPU_DTRACE_ILLOP; 2711 return (0); 2712 #endif 2696 2713 } 2697 2714 … … 2699 2716 if (!dtrace_priv_kernel(state)) 2700 2717 return (0); 2718 #ifndef VBOX 2701 2719 return ((uint64_t)(uintptr_t)curthread); 2720 #else 2721 return ((uintptr_t)RTThreadNativeSelf()); 2722 #endif 2702 2723 2703 2724 case DIF_VAR_TIMESTAMP: … … 2854 2875 return (0); 2855 2876 2877 #ifndef VBOX 2856 2878 /* 2857 2879 * Note that we are assuming that an unanchored probe is … … 2871 2893 */ 2872 2894 return ((uint64_t)curthread->t_procp->p_pidp->pid_id); 2895 #else 2896 return (RTProcSelf()); 2897 #endif 2873 2898 2874 2899 case DIF_VAR_PPID: … … 2876 2901 return (0); 2877 2902 2903 #ifndef VBOX 2878 2904 /* 2879 2905 * See comment in DIF_VAR_PID. … … 2889 2915 */ 2890 2916 return ((uint64_t)curthread->t_procp->p_ppid); 2917 #else 2918 cpu_core[VBDT_GET_CPUID()].cpuc_dtrace_flags |= CPU_DTRACE_ILLOP; 2919 return (0); /** @todo parent pid? */ 2920 #endif 2891 2921 2892 2922 case DIF_VAR_TID: 2923 #ifndef VBOX 2893 2924 /* 2894 2925 * See comment in DIF_VAR_PID. … … 2898 2929 2899 2930 return ((uint64_t)curthread->t_tid); 2931 #else 2932 return (RTThreadNativeSelf()); /** @todo proper tid? */ 2933 #endif 2900 2934 2901 2935 case DIF_VAR_EXECNAME: … … 2903 2937 return (0); 2904 2938 2939 #ifndef VBOX 2905 2940 /* 2906 2941 * See comment in DIF_VAR_PID. … … 2918 2953 (uintptr_t)curthread->t_procp->p_user.u_comm, 2919 2954 state, mstate)); 2955 #else 2956 cpu_core[VBDT_GET_CPUID()].cpuc_dtrace_flags |= CPU_DTRACE_ILLOP; 2957 return (0); /** @todo execname */ 2958 #endif 2920 2959 2921 2960 case DIF_VAR_ZONENAME: … … 2923 2962 return (0); 2924 2963 2964 #ifndef VBOX 2925 2965 /* 2926 2966 * See comment in DIF_VAR_PID. … … 2938 2978 (uintptr_t)curthread->t_procp->p_zone->zone_name, 2939 2979 state, mstate)); 2980 #else 2981 cpu_core[VBDT_GET_CPUID()].cpuc_dtrace_flags |= CPU_DTRACE_ILLOP; 2982 return (0); 2983 #endif 2940 2984 2941 2985 case DIF_VAR_UID: … … 2943 2987 return (0); 2944 2988 2989 #ifndef VBOX 2945 2990 /* 2946 2991 * See comment in DIF_VAR_PID. … … 2959 3004 */ 2960 3005 return ((uint64_t)curthread->t_procp->p_cred->cr_uid); 3006 #else 3007 cpu_core[VBDT_GET_CPUID()].cpuc_dtrace_flags |= CPU_DTRACE_ILLOP; 3008 return (0); 3009 #endif 2961 3010 2962 3011 case DIF_VAR_GID: … … 2964 3013 return (0); 2965 3014 3015 #ifndef VBOX 2966 3016 /* 2967 3017 * See comment in DIF_VAR_PID. … … 2980 3030 */ 2981 3031 return ((uint64_t)curthread->t_procp->p_cred->cr_gid); 3032 #else 3033 cpu_core[VBDT_GET_CPUID()].cpuc_dtrace_flags |= CPU_DTRACE_ILLOP; 3034 return (0); 3035 #endif 2982 3036 2983 3037 case DIF_VAR_ERRNO: { 3038 #ifndef VBOX 2984 3039 klwp_t *lwp; 3040 #endif 2985 3041 if (!dtrace_priv_proc(state)) 2986 3042 return (0); 2987 3043 3044 #ifndef VBOX 2988 3045 /* 2989 3046 * See comment in DIF_VAR_PID. … … 3002 3059 3003 3060 return ((uint64_t)lwp->lwp_errno); 3061 #else 3062 cpu_core[VBDT_GET_CPUID()].cpuc_dtrace_flags |= CPU_DTRACE_ILLOP; 3063 return (0); 3064 #endif 3004 3065 } 3005 3066 default: … … 3025 3086 dtrace_vstate_t *vstate = &state->dts_vstate; 3026 3087 3088 #ifndef VBOX 3027 3089 union { 3028 3090 mutex_impl_t mi; … … 3034 3096 uintptr_t rw; 3035 3097 } r; 3098 #endif 3036 3099 3037 3100 switch (subr) { … … 3041 3104 3042 3105 case DIF_SUBR_MUTEX_OWNED: 3106 #ifndef VBOX 3043 3107 if (!dtrace_canload(tupregs[0].dttk_value, sizeof (kmutex_t), 3044 3108 mstate, vstate)) { … … 3052 3116 else 3053 3117 regs[rd] = LOCK_HELD(&m.mi.m_spin.m_spinlock); 3118 #else 3119 regs[rd] = 0; 3120 DTRACE_CPUFLAG_SET(CPU_DTRACE_ILLOP); 3121 #endif 3054 3122 break; 3055 3123 3056 3124 case DIF_SUBR_MUTEX_OWNER: 3125 #ifndef VBOX 3057 3126 if (!dtrace_canload(tupregs[0].dttk_value, sizeof (kmutex_t), 3058 3127 mstate, vstate)) { … … 3067 3136 else 3068 3137 regs[rd] = 0; 3138 #else 3139 regs[rd] = 0; 3140 DTRACE_CPUFLAG_SET(CPU_DTRACE_ILLOP); 3141 #endif 3069 3142 break; 3070 3143 3071 3144 case DIF_SUBR_MUTEX_TYPE_ADAPTIVE: 3145 #ifndef VBOX 3072 3146 if (!dtrace_canload(tupregs[0].dttk_value, sizeof (kmutex_t), 3073 3147 mstate, vstate)) { … … 3078 3152 m.mx = dtrace_load64(tupregs[0].dttk_value); 3079 3153 regs[rd] = MUTEX_TYPE_ADAPTIVE(&m.mi); 3154 #else 3155 regs[rd] = 0; 3156 DTRACE_CPUFLAG_SET(CPU_DTRACE_ILLOP); 3157 #endif 3080 3158 break; 3081 3159 3082 3160 case DIF_SUBR_MUTEX_TYPE_SPIN: 3161 #ifndef VBOX 3083 3162 if (!dtrace_canload(tupregs[0].dttk_value, sizeof (kmutex_t), 3084 3163 mstate, vstate)) { … … 3089 3168 m.mx = dtrace_load64(tupregs[0].dttk_value); 3090 3169 regs[rd] = MUTEX_TYPE_SPIN(&m.mi); 3170 #else 3171 regs[rd] = 0; 3172 DTRACE_CPUFLAG_SET(CPU_DTRACE_ILLOP); 3173 #endif 3091 3174 break; 3092 3175 3093 3176 case DIF_SUBR_RW_READ_HELD: { 3177 #ifndef VBOX 3094 3178 uintptr_t tmp; 3095 3179 … … 3102 3186 r.rw = dtrace_loadptr(tupregs[0].dttk_value); 3103 3187 regs[rd] = _RW_READ_HELD(&r.ri, tmp); 3188 #else 3189 regs[rd] = 0; 3190 DTRACE_CPUFLAG_SET(CPU_DTRACE_ILLOP); 3191 #endif 3104 3192 break; 3105 3193 } 3106 3194 3107 3195 case DIF_SUBR_RW_WRITE_HELD: 3196 #ifndef VBOX 3108 3197 if (!dtrace_canload(tupregs[0].dttk_value, sizeof (krwlock_t), 3109 3198 mstate, vstate)) { … … 3114 3203 r.rw = dtrace_loadptr(tupregs[0].dttk_value); 3115 3204 regs[rd] = _RW_WRITE_HELD(&r.ri); 3205 #else 3206 regs[rd] = 0; 3207 DTRACE_CPUFLAG_SET(CPU_DTRACE_ILLOP); 3208 #endif 3116 3209 break; 3117 3210 3118 3211 case DIF_SUBR_RW_ISWRITER: 3212 #ifndef VBOX 3119 3213 if (!dtrace_canload(tupregs[0].dttk_value, sizeof (krwlock_t), 3120 3214 mstate, vstate)) { … … 3125 3219 r.rw = dtrace_loadptr(tupregs[0].dttk_value); 3126 3220 regs[rd] = _RW_ISWRITER(&r.ri); 3221 #else 3222 regs[rd] = 0; 3223 DTRACE_CPUFLAG_SET(CPU_DTRACE_ILLOP); 3224 #endif 3127 3225 break; 3128 3226 … … 3237 3335 case DIF_SUBR_MSGSIZE: 3238 3336 case DIF_SUBR_MSGDSIZE: { 3337 #ifndef VBOX 3239 3338 uintptr_t baddr = tupregs[0].dttk_value, daddr; 3240 3339 uintptr_t wptr, rptr; … … 3290 3389 regs[rd] = count; 3291 3390 3391 #else 3392 regs[rd] = 0; 3393 DTRACE_CPUFLAG_SET(CPU_DTRACE_ILLOP); 3394 #endif 3292 3395 break; 3293 3396 } 3294 3397 3295 3398 case DIF_SUBR_PROGENYOF: { 3399 #ifndef VBOX 3296 3400 pid_t pid = tupregs[0].dttk_value; 3297 3401 proc_t *p; … … 3310 3414 3311 3415 regs[rd] = rval; 3416 #else 3417 regs[rd] = 0; 3418 DTRACE_CPUFLAG_SET(CPU_DTRACE_ILLOP); 3419 #endif 3312 3420 break; 3313 3421 } … … 3505 3613 } 3506 3614 3507 if ( pos > len)3615 if (VBDTCAST(uint64_t)pos > len) 3508 3616 pos = len; 3509 3617 } else { … … 3511 3619 pos = 0; 3512 3620 3513 if ( pos >= len) {3621 if (VBDTCAST(uint64_t)pos >= len) { 3514 3622 if (sublen == 0) 3515 3623 regs[rd] = len; … … 3689 3797 } 3690 3798 3691 if ( index >= len || index < 0) {3799 if (VBDTCAST(uint64_t)index >= len || index < 0) { 3692 3800 remaining = 0; 3693 3801 } else if (remaining < 0) { 3694 3802 remaining += len - index; 3695 } else if ( index + remaining > size) {3803 } else if (VBDTCAST(uint64_t)index + remaining > size) { 3696 3804 remaining = size - index; 3697 3805 } … … 3710 3818 3711 3819 case DIF_SUBR_GETMAJOR: 3820 #ifndef VBOX 3712 3821 #ifdef _LP64 3713 3822 regs[rd] = (tupregs[0].dttk_value >> NBITSMINOR64) & MAXMAJ64; … … 3715 3824 regs[rd] = (tupregs[0].dttk_value >> NBITSMINOR) & MAXMAJ; 3716 3825 #endif 3826 #else 3827 regs[rd] = 0; 3828 DTRACE_CPUFLAG_SET(CPU_DTRACE_ILLOP); 3829 #endif 3717 3830 break; 3718 3831 3719 3832 case DIF_SUBR_GETMINOR: 3833 #ifndef VBOX 3720 3834 #ifdef _LP64 3721 3835 regs[rd] = tupregs[0].dttk_value & MAXMIN64; … … 3723 3837 regs[rd] = tupregs[0].dttk_value & MAXMIN; 3724 3838 #endif 3839 #else 3840 regs[rd] = 0; 3841 DTRACE_CPUFLAG_SET(CPU_DTRACE_ILLOP); 3842 #endif 3725 3843 break; 3726 3844 3727 3845 case DIF_SUBR_DDI_PATHNAME: { 3846 #ifndef VBOX 3728 3847 /* 3729 3848 * This one is a galactic mess. We are going to roughly … … 3915 4034 } 3916 4035 4036 #else 4037 regs[rd] = 0; 4038 DTRACE_CPUFLAG_SET(CPU_DTRACE_ILLOP); 4039 #endif 3917 4040 break; 3918 4041 } … … 4030 4153 uint64_t size = state->dts_options[DTRACEOPT_STRSIZE]; 4031 4154 uintptr_t src = tupregs[0].dttk_value; 4032 int i, j, len = dtrace_strlen((char *)src, size);4155 int i, j, len = VBDTCAST(int)dtrace_strlen((char *)src, size); 4033 4156 int lastbase = -1, firstbase = -1, lastdir = -1; 4034 4157 int start, end; … … 4267 4390 case DIF_SUBR_INET_NTOA6: 4268 4391 case DIF_SUBR_INET_NTOP: { 4392 #ifndef VBOX 4269 4393 size_t size; 4270 4394 int af, argi, i; … … 4465 4589 inetout: regs[rd] = (uintptr_t)end + 1; 4466 4590 mstate->dtms_scratch_ptr += size; 4591 #else /* VBOX */ 4592 regs[rd] = 0; 4593 DTRACE_CPUFLAG_SET(CPU_DTRACE_ILLOP); 4594 #endif /* VBOX */ 4467 4595 break; 4468 4596 } … … 4869 4997 id -= DIF_VAR_OTHER_UBASE; 4870 4998 4871 ASSERT( id < vstate->dtvs_nlocals);4999 ASSERT(VBDTCAST(int64_t)id < vstate->dtvs_nlocals); 4872 5000 ASSERT(vstate->dtvs_locals != NULL); 4873 5001 … … 4908 5036 ASSERT(id >= DIF_VAR_OTHER_UBASE); 4909 5037 id -= DIF_VAR_OTHER_UBASE; 4910 ASSERT( id < vstate->dtvs_nlocals);5038 ASSERT(VBDTCAST(int64_t)id < vstate->dtvs_nlocals); 4911 5039 4912 5040 ASSERT(vstate->dtvs_locals != NULL); … … 5262 5390 } 5263 5391 5392 #ifndef VBOX /* no destructive stuff */ 5393 5264 5394 static void 5265 5395 dtrace_action_breakpoint(dtrace_ecb_t *ecb) … … 5433 5563 } 5434 5564 5565 #endif /* !VBOX */ 5566 5435 5567 static void 5436 5568 dtrace_action_ustack(dtrace_mstate_t *mstate, dtrace_state_t *state, … … 5443 5575 int size, offs = 0, i, j; 5444 5576 uintptr_t old = mstate->dtms_scratch_ptr, saved; 5577 #ifndef VBOX 5445 5578 uint16_t *flags = &cpu_core[VBDT_GET_CPUID()].cpuc_dtrace_flags; 5579 #else 5580 uint16_t volatile *flags = &cpu_core[VBDT_GET_CPUID()].cpuc_dtrace_flags; 5581 #endif 5446 5582 char *sym; 5447 5583 … … 5839 5975 switch (act->dta_kind) { 5840 5976 case DTRACEACT_STOP: 5977 #ifndef VBOX 5841 5978 if (dtrace_priv_proc_destructive(state)) 5842 5979 dtrace_action_stop(); 5980 #else 5981 DTRACE_CPUFLAG_SET(CPU_DTRACE_ILLOP); 5982 #endif 5843 5983 continue; 5844 5984 5845 5985 case DTRACEACT_BREAKPOINT: 5986 #ifndef VBOX 5846 5987 if (dtrace_priv_kernel_destructive(state)) 5847 5988 dtrace_action_breakpoint(ecb); 5989 #else 5990 DTRACE_CPUFLAG_SET(CPU_DTRACE_ILLOP); 5991 #endif 5848 5992 continue; 5849 5993 5850 5994 case DTRACEACT_PANIC: 5995 #ifndef VBOX 5851 5996 if (dtrace_priv_kernel_destructive(state)) 5852 5997 dtrace_action_panic(ecb); 5998 #endif 5853 5999 continue; 5854 6000 … … 5947 6093 5948 6094 case DTRACEACT_CHILL: 6095 #ifndef VBOX 5949 6096 if (dtrace_priv_kernel_destructive(state)) 5950 6097 dtrace_action_chill(&mstate, val); 6098 #else 6099 DTRACE_CPUFLAG_SET(CPU_DTRACE_ILLOP); 6100 #endif 5951 6101 continue; 5952 6102 5953 6103 case DTRACEACT_RAISE: 6104 #ifndef VBOX 5954 6105 if (dtrace_priv_proc_destructive(state)) 5955 6106 dtrace_action_raise(val); 6107 #else 6108 DTRACE_CPUFLAG_SET(CPU_DTRACE_ILLOP); 6109 #endif 5956 6110 continue; 5957 6111 -
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/uts/common/sys/dtrace.h
r53636 r53640 2236 2236 #ifndef VBOX 2237 2237 # define VBDT_GET_CPUID() (CPU->cpu_id) 2238 # define VBDT_GET_PROC() (ttoproc(curthread)) 2238 2239 #else 2239 2240 # define VBDT_GET_CPUID() (RTMpCpuId()) 2241 # define VBDT_GET_PROC() (VBoxDtGetCurrentProc()) 2242 proc_t *VBoxDtGetCurrentProc(void); 2240 2243 #endif 2241 2242 2244 2243 2245 #define DTRACE_CPUFLAG_ISSET(flag) \
Note:
See TracChangeset
for help on using the changeset viewer.