Date: Thu, 27 Apr 2006 00:23:04 GMT From: John Birrell <jb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 96177 for review Message-ID: <200604270023.k3R0N44j053587@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=96177 Change 96177 by jb@jb_freebsd2 on 2006/04/27 00:22:31 Process for code in the quest for the holy grail. Lots of stuff still commented out here, but we're moving in the right direction. Example: file hello.d BEGIN { trace("Hello world!\n"); exit(0); } >dtrace -s hello.d CPU ID FUNCTION:NAME 0 1 :BEGIN Hello world! Another significant emotional event. Affected files ... .. //depot/projects/dtrace/src/sys/cddl/dev/dtrace/dtrace_dif.c#3 edit Differences ... ==== //depot/projects/dtrace/src/sys/cddl/dev/dtrace/dtrace_dif.c#3 (text+ko) ==== @@ -1430,8 +1430,6 @@ dtrace_dif_emulate(dtrace_difo_t *difo, dtrace_mstate_t *mstate, dtrace_vstate_t *vstate, dtrace_state_t *state) { -printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__); -#ifdef DOODAD const dif_instr_t *text = difo->dtdo_buf; const uint_t textlen = difo->dtdo_len; const char *strtab = difo->dtdo_strtab; @@ -1439,7 +1437,9 @@ uint64_t rval = 0; dtrace_statvar_t *svar; +#ifdef DOODAD dtrace_dstate_t *dstate = &vstate->dtvs_dynvars; +#endif dtrace_difv_t *v; volatile uint16_t *flags = &cpu_core[CPU->cpu_id].cpuc_dtrace_flags; volatile uintptr_t *illval = &cpu_core[CPU->cpu_id].cpuc_dtrace_illval; @@ -1450,7 +1450,7 @@ uint8_t cc_n = 0, cc_z = 0, cc_v = 0, cc_c = 0; int64_t cc_r; - uint_t pc = 0, id, opc; + uint_t pc = 0, id, opc = 0; uint8_t ttop = 0; dif_instr_t instr; uint_t r1, r2, rd; @@ -1659,32 +1659,53 @@ regs[rd] = dtrace_load64(regs[r1]); break; case DIF_OP_ULDSB: +printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__); +#ifdef DOODAD regs[rd] = (int8_t) dtrace_fuword8((void *)(uintptr_t)regs[r1]); +#endif break; case DIF_OP_ULDSH: +printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__); +#ifdef DOODAD regs[rd] = (int16_t) dtrace_fuword16((void *)(uintptr_t)regs[r1]); +#endif break; case DIF_OP_ULDSW: +printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__); +#ifdef DOODAD regs[rd] = (int32_t) dtrace_fuword32((void *)(uintptr_t)regs[r1]); +#endif break; case DIF_OP_ULDUB: +printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__); +#ifdef DOODAD regs[rd] = dtrace_fuword8((void *)(uintptr_t)regs[r1]); +#endif break; case DIF_OP_ULDUH: +printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__); +#ifdef DOODAD regs[rd] = dtrace_fuword16((void *)(uintptr_t)regs[r1]); +#endif break; case DIF_OP_ULDUW: +printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__); +#ifdef DOODAD regs[rd] = dtrace_fuword32((void *)(uintptr_t)regs[r1]); +#endif break; case DIF_OP_ULDX: +printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__); +#ifdef DOODAD regs[rd] = dtrace_fuword64((void *)(uintptr_t)regs[r1]); +#endif break; case DIF_OP_RET: rval = regs[rd]; @@ -1735,7 +1756,7 @@ * then this is to be treated as a * reference to a NULL variable. */ - regs[rd] = NULL; + regs[rd] = 0; } else { regs[rd] = a + sizeof (uint64_t); } @@ -1759,10 +1780,10 @@ if (v->dtdv_type.dtdt_flags & DIF_TF_BYREF) { uintptr_t a = (uintptr_t)svar->dtsv_data; - ASSERT(a != NULL); + ASSERT(a != 0); ASSERT(svar->dtsv_size != 0); - if (regs[rd] == NULL) { + if (regs[rd] == 0) { *(uint8_t *)a = UINT8_MAX; break; } else { @@ -1821,7 +1842,7 @@ * then this is to be treated as a * reference to a NULL variable. */ - regs[rd] = NULL; + regs[rd] = 0; } else { regs[rd] = a + sizeof (uint64_t); } @@ -1854,7 +1875,7 @@ ASSERT(svar->dtsv_size == NCPU * sz); a += CPU->cpu_id * sz; - if (regs[rd] == NULL) { + if (regs[rd] == 0) { *(uint8_t *)a = UINT8_MAX; break; } else { @@ -1873,6 +1894,8 @@ break; case DIF_OP_LDTS: { +printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__); +#ifdef DOODAD dtrace_dynvar_t *dvar; dtrace_key_t *key; @@ -1900,11 +1923,14 @@ } else { regs[rd] = *((uint64_t *)dvar->dtdv_data); } +#endif break; } case DIF_OP_STTS: { +printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__); +#ifdef DOODAD dtrace_dynvar_t *dvar; dtrace_key_t *key; @@ -1940,6 +1966,7 @@ } else { *((uint64_t *)dvar->dtdv_data) = regs[rd]; } +#endif break; } @@ -2000,6 +2027,8 @@ case DIF_OP_LDGAA: case DIF_OP_LDTAA: { +printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__); +#ifdef DOODAD dtrace_dynvar_t *dvar; dtrace_key_t *key = tupregs; uint_t nkeys = ttop; @@ -2035,11 +2064,14 @@ regs[rd] = *((uint64_t *)dvar->dtdv_data); } +#endif break; } case DIF_OP_STGAA: case DIF_OP_STTAA: { +printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__); +#ifdef DOODAD dtrace_dynvar_t *dvar; dtrace_key_t *key = tupregs; uint_t nkeys = ttop; @@ -2074,6 +2106,7 @@ } else { *((uint64_t *)dvar->dtdv_data) = regs[rd]; } +#endif break; } @@ -2086,7 +2119,7 @@ mstate->dtms_scratch_base + mstate->dtms_scratch_size) { DTRACE_CPUFLAG_SET(CPU_DTRACE_NOSCRATCH); - regs[rd] = NULL; + regs[rd] = 0; } else { dtrace_bzero((void *) mstate->dtms_scratch_ptr, size); @@ -2166,7 +2199,6 @@ mstate->dtms_fltoffs = opc * sizeof (dif_instr_t); mstate->dtms_present |= DTRACE_MSTATE_FLTOFFS; -#endif return (0); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200604270023.k3R0N44j053587>