Date: Wed, 26 Apr 2006 04:28:00 GMT From: John Birrell <jb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 96128 for review Message-ID: <200604260428.k3Q4S00P033222@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=96128 Change 96128 by jb@jb_freebsd2 on 2006/04/26 04:27:13 Update my hacks. *HELP* This is an area that I will definitely need help with. The function being executed here needs to be called with pre-emption disabled. This is being used in the simple case of "dtrace -n BEGIN" (which is the simplest DTrace you can do), to swap buffers without being interrupted when it is time to gather up a buffer full and return it via an ioctl. The buffer change can't be interrupted because that might allow another probe to add to the buffer that is being uploaded, causing it to get mis-reported. Affected files ... .. //depot/projects/dtrace/src/sys/cddl/dev/dtrace/dtrace_hacks.c#7 edit Differences ... ==== //depot/projects/dtrace/src/sys/cddl/dev/dtrace/dtrace_hacks.c#7 (text+ko) ==== @@ -133,10 +133,12 @@ void dtrace_vtime_enable(void) { + printf("%s:\n",__FUNCTION__); } void dtrace_vtime_disable(void) { + printf("%s:\n",__FUNCTION__); } void dtrace_vpanic(const char *fmt, __va_list args) @@ -147,47 +149,57 @@ uint32_t dtrace_cas32(uint32_t *a, uint32_t b, uint32_t c) { + printf("%s:\n",__FUNCTION__); return 0; } void *dtrace_casptr(void *a, void *b, void *c) { + printf("%s:\n",__FUNCTION__); return NULL; } dtrace_icookie_t dtrace_interrupt_disable(void) { + printf("%s:\n",__FUNCTION__); return 0; } void dtrace_interrupt_enable(dtrace_icookie_t a) { + printf("%s:\n",__FUNCTION__); } void dtrace_getpcstack(pc_t *a, int b, int c, uint32_t *d) { + printf("%s:\n",__FUNCTION__); } void dtrace_getupcstack(uint64_t *a, int b) { + printf("%s:\n",__FUNCTION__); } int dtrace_getstackdepth(int a) { + printf("%s:\n",__FUNCTION__); return 0; } uint64_t dtrace_getarg(int a, int b) { + printf("%s:\n",__FUNCTION__); return 0; } int dtrace_getipl(void) { + printf("%s:\n",__FUNCTION__); return 0; } uintptr_t dtrace_caller(int a) { + printf("%s:\n",__FUNCTION__); return 0; } boolean_t @@ -195,13 +207,42 @@ { return 0; } +#ifdef DOODAD +static int +dtrace_xcall_func(dtrace_xcall_t func, void *arg) +{ + (*func)(arg); + + return (0); +} +#endif void -dtrace_xcall(processorid_t a, dtrace_xcall_t b, void *c) +dtrace_xcall(processorid_t cpu, dtrace_xcall_t func, void *arg) { + printf("%s:\n",__FUNCTION__); +#ifdef DOODAD + cpuset_t set; + + CPUSET_ZERO(set); + + if (cpu == DTRACE_CPUALL) { + CPUSET_ALL(set); + } else { + CPUSET_ADD(set, cpu); + } + + kpreempt_disable(); + xc_sync((xc_arg_t)func, (xc_arg_t)arg, 0, X_CALL_HIPRI, set, + (xc_func_t)dtrace_xcall_func); + kpreempt_enable(); +#else + (*func)(arg); +#endif } taskqid_t taskq_dispatch(taskq_t *a, task_func_t b, void *c, uint_t d) { + printf("%s:\n",__FUNCTION__); return 0; } int
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200604260428.k3Q4S00P033222>