Date: Wed, 26 Apr 2006 00:21:54 GMT From: John Birrell <jb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 96120 for review Message-ID: <200604260021.k3Q0Ls5Z083357@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=96120 Change 96120 by jb@jb_freebsd2 on 2006/04/26 00:21:12 SysV -> BSD ioctl for STATUS. We're getting closer and closer to a significant emotional event (as EDS used to say)... Affected files ... .. //depot/projects/dtrace/src/sys/cddl/dev/dtrace/dtrace_ioctl.c#8 edit .. //depot/projects/dtrace/src/sys/contrib/opensolaris/uts/common/sys/dtrace.h#10 edit Differences ... ==== //depot/projects/dtrace/src/sys/cddl/dev/dtrace/dtrace_ioctl.c#8 (text+ko) ==== @@ -681,12 +681,8 @@ } #endif break; - case DTRACEIOC_STATUS: -printf("DTRACEIOC_STATUS:\n"); -error = EINVAL; -#ifdef DOODAD - { - dtrace_status_t stat; + case DTRACEIOC_STATUS: { + dtrace_status_t *stat = (dtrace_status_t *) addr; dtrace_dstate_t *dstate; int i, j; uint64_t nerrs; @@ -700,7 +696,7 @@ dtrace_membar_producer(); state->dts_laststatus = dtrace_gethrtime(); - bzero(&stat, sizeof (stat)); + bzero(stat, sizeof (stat)); mutex_enter(&dtrace_lock); @@ -710,7 +706,7 @@ } if (state->dts_activity == DTRACE_ACTIVITY_DRAINING) - stat.dtst_exiting = 1; + stat->dtst_exiting = 1; nerrs = state->dts_errors; dstate = &state->dts_vstate.dtvs_dynvars; @@ -718,12 +714,12 @@ for (i = 0; i < NCPU; i++) { dtrace_dstate_percpu_t *dcpu = &dstate->dtds_percpu[i]; - stat.dtst_dyndrops += dcpu->dtdsc_drops; - stat.dtst_dyndrops_dirty += dcpu->dtdsc_dirty_drops; - stat.dtst_dyndrops_rinsing += dcpu->dtdsc_rinsing_drops; + stat->dtst_dyndrops += dcpu->dtdsc_drops; + stat->dtst_dyndrops_dirty += dcpu->dtdsc_dirty_drops; + stat->dtst_dyndrops_rinsing += dcpu->dtdsc_rinsing_drops; if (state->dts_buffer[i].dtb_flags & DTRACEBUF_FULL) - stat.dtst_filled++; + stat->dtst_filled++; nerrs += state->dts_buffer[i].dtb_errors; @@ -733,27 +729,22 @@ spec = &state->dts_speculations[j]; buf = &spec->dtsp_buffer[i]; - stat.dtst_specdrops += buf->dtb_xamot_drops; + stat->dtst_specdrops += buf->dtb_xamot_drops; } } - stat.dtst_specdrops_busy = state->dts_speculations_busy; - stat.dtst_specdrops_unavail = state->dts_speculations_unavail; - stat.dtst_stkstroverflows = state->dts_stkstroverflows; - stat.dtst_dblerrors = state->dts_dblerrors; - stat.dtst_killed = + stat->dtst_specdrops_busy = state->dts_speculations_busy; + stat->dtst_specdrops_unavail = state->dts_speculations_unavail; + stat->dtst_stkstroverflows = state->dts_stkstroverflows; + stat->dtst_dblerrors = state->dts_dblerrors; + stat->dtst_killed = (state->dts_activity == DTRACE_ACTIVITY_KILLED); - stat.dtst_errors = nerrs; + stat->dtst_errors = nerrs; mutex_exit(&dtrace_lock); - if (copyout(&stat, (void *)arg, sizeof (stat)) != 0) - return (EFAULT); - return (0); } -#endif - break; case DTRACEIOC_STOP: printf("DTRACEIOC_STOP:\n"); error = EINVAL; ==== //depot/projects/dtrace/src/sys/contrib/opensolaris/uts/common/sys/dtrace.h#10 (text) ==== @@ -1215,7 +1215,8 @@ /* get probe arg */ #define DTRACEIOC_CONF _IOR('x',10,dtrace_conf_t) /* get config. */ -#define DTRACEIOC_STATUS _IO('x',11) /* get status */ +#define DTRACEIOC_STATUS _IOR('x',11,dtrace_status_t) + /* get status */ #define DTRACEIOC_GO _IOR('x',12,processorid_t) /* start tracing */ #define DTRACEIOC_STOP _IO('x',13) /* stop tracing */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200604260021.k3Q0Ls5Z083357>