Date: Wed, 19 Apr 2006 00:20:42 GMT From: John Birrell <jb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 95565 for review Message-ID: <200604190020.k3J0KgIf096603@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=95565 Change 95565 by jb@jb_freebsd2 on 2006/04/19 00:19:44 Start converting the ioctl definitions to FreeBSD's format. I've started with just declaring them all without data (except _CONF which is the first one called). As a get up to the point in the dtrace(1) execution where the ioctls are actually called, I'll add the direction and type to suit how the ioctl is actually used. This seems to be an area where BSD is much neater than SysV. The last time I wrote kernel code for SysV was on Motorola's Unix back on an MVME68030 with a whopping 16 MB of memory and a 300 MB disk. I think that might have been 15 years ago. Affected files ... .. //depot/projects/dtrace/src/sys/contrib/opensolaris/uts/common/sys/dtrace.h#3 edit Differences ... ==== //depot/projects/dtrace/src/sys/contrib/opensolaris/uts/common/sys/dtrace.h#3 (text) ==== @@ -27,7 +27,9 @@ #ifndef _SYS_DTRACE_H #define _SYS_DTRACE_H +#if defined(sun) #pragma ident "@(#)dtrace.h 1.30 06/03/30 SMI" +#endif #ifdef __cplusplus extern "C" { @@ -53,13 +55,14 @@ #include <sys/systm.h> #else #include <opensolaris/compat/sys/processor.h> +#include <sys/ioccom.h> #endif #include <sys/ctf_api.h> #if defined(sun) #include <sys/cyclic.h> #include <sys/int_limits.h> #else -#include <stdint.h> +#include <sys/stdint.h> #endif /* @@ -1165,6 +1168,7 @@ * pseudodevice driver. These ioctls comprise the user-kernel interface to * DTrace. */ +#if defined(sun) #define DTRACEIOC (('d' << 24) | ('t' << 16) | ('r' << 8)) #define DTRACEIOC_PROVIDER (DTRACEIOC | 1) /* provider query */ #define DTRACEIOC_PROBES (DTRACEIOC | 2) /* probe query */ @@ -1182,6 +1186,25 @@ #define DTRACEIOC_FORMAT (DTRACEIOC | 16) /* get format str */ #define DTRACEIOC_DOFGET (DTRACEIOC | 17) /* get DOF */ #define DTRACEIOC_REPLICATE (DTRACEIOC | 18) /* replicate enab */ +#else +#define DTRACEIOC_PROVIDER _IO('x',1) /* provider query */ +#define DTRACEIOC_PROBES _IO('x',2) /* probe query */ +#define DTRACEIOC_BUFSNAP _IO('x',4) /* snapshot buffer */ +#define DTRACEIOC_PROBEMATCH _IO('x',5) /* match probes */ +#define DTRACEIOC_ENABLE _IO('x',6) /* enable probes */ +#define DTRACEIOC_AGGSNAP _IO('x',7) /* snapshot agg. */ +#define DTRACEIOC_EPROBE _IO('x',8) /* get eprobe desc. */ +#define DTRACEIOC_PROBEARG _IO('x',9) /* get probe arg */ +#define DTRACEIOC_CONF _IOR('x',10,dtrace_conf_t) + /* get config. */ +#define DTRACEIOC_STATUS _IO('x',11) /* get status */ +#define DTRACEIOC_GO _IO('x',12) /* start tracing */ +#define DTRACEIOC_STOP _IO('x',13) /* stop tracing */ +#define DTRACEIOC_AGGDESC _IO('x',15) /* get agg. desc. */ +#define DTRACEIOC_FORMAT _IO('x',16) /* get format str */ +#define DTRACEIOC_DOFGET _IO('x',17) /* get DOF */ +#define DTRACEIOC_REPLICATE _IO('x',18) /* replicate enab */ +#endif /* * DTrace Helpers @@ -1946,7 +1969,9 @@ */ typedef struct dtrace_pops { void (*dtps_provide)(void *arg, const dtrace_probedesc_t *spec); +#ifdef DOODAD void (*dtps_provide_module)(void *arg, struct modctl *mp); +#endif void (*dtps_enable)(void *arg, dtrace_id_t id, void *parg); void (*dtps_disable)(void *arg, dtrace_id_t id, void *parg); void (*dtps_suspend)(void *arg, dtrace_id_t id, void *parg); @@ -1961,8 +1986,10 @@ typedef uintptr_t dtrace_provider_id_t; +#ifdef DOODAD extern int dtrace_register(const char *, const dtrace_pattr_t *, uint32_t, cred_t *, const dtrace_pops_t *, void *, dtrace_provider_id_t *); +#endif extern int dtrace_unregister(dtrace_provider_id_t); extern int dtrace_condense(dtrace_provider_id_t); extern void dtrace_invalidate(dtrace_provider_id_t); @@ -2140,6 +2167,7 @@ DTRACE_VTIME_ACTIVE_TNF /* DTrace virtual time _and_ TNF */ } dtrace_vtime_state_t; +#ifdef DOODAD extern dtrace_vtime_state_t dtrace_vtime_active; extern void dtrace_vtime_switch(kthread_t *next); extern void dtrace_vtime_enable_tnf(void); @@ -2190,10 +2218,13 @@ extern int dtrace_safe_defer_signal(void); extern void dtrace_safe_synchronous_signal(void); +#endif #if defined(__i386) || defined(__amd64) extern int dtrace_instr_size(uchar_t *instr); +#ifdef DOODAD extern int dtrace_instr_size_isa(uchar_t *, model_t, int *); +#endif extern void dtrace_invop_add(int (*)(uintptr_t, uintptr_t *, uintptr_t)); extern void dtrace_invop_remove(int (*)(uintptr_t, uintptr_t *, uintptr_t)); extern void dtrace_invop_callsite(void);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200604190020.k3J0KgIf096603>