1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 * or http://www.opensolaris.org/os/licensing. 10 * See the License for the specific language governing permissions 11 * and limitations under the License. 12 * 13 * When distributing Covered Code, include this CDDL HEADER in each 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 * If applicable, add the following below this CDDL HEADER, with the 16 * fields enclosed by brackets "[]" replaced with your own identifying 17 * information: Portions Copyright [yyyy] [name of copyright owner] 18 * 19 * CDDL HEADER END 20 * 21 * Portions Copyright 2006-2008 John Birrell jb@freebsd.org 22 *
| 1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 * or http://www.opensolaris.org/os/licensing. 10 * See the License for the specific language governing permissions 11 * and limitations under the License. 12 * 13 * When distributing Covered Code, include this CDDL HEADER in each 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 * If applicable, add the following below this CDDL HEADER, with the 16 * fields enclosed by brackets "[]" replaced with your own identifying 17 * information: Portions Copyright [yyyy] [name of copyright owner] 18 * 19 * CDDL HEADER END 20 * 21 * Portions Copyright 2006-2008 John Birrell jb@freebsd.org 22 *
|
23 * $FreeBSD: head/sys/cddl/dev/systrace/systrace.c 211608 2010-08-22 10:53:32Z rpaulo $
| 23 * $FreeBSD: head/sys/cddl/dev/systrace/systrace.c 219561 2011-03-12 09:09:25Z avg $
|
24 * 25 */ 26 27/* 28 * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 29 * Use is subject to license terms. 30 */ 31 32#include <sys/cdefs.h> 33#include <sys/param.h> 34#include <sys/systm.h> 35#include <sys/conf.h> 36#include <sys/cpuvar.h> 37#include <sys/fcntl.h> 38#include <sys/filio.h> 39#include <sys/kdb.h> 40#include <sys/kernel.h> 41#include <sys/kmem.h> 42#include <sys/kthread.h> 43#include <sys/limits.h> 44#include <sys/linker.h> 45#include <sys/lock.h> 46#include <sys/malloc.h> 47#include <sys/module.h> 48#include <sys/mutex.h> 49#include <sys/poll.h> 50#include <sys/proc.h> 51#include <sys/selinfo.h> 52#include <sys/smp.h> 53#include <sys/sysproto.h> 54#include <sys/sysent.h> 55#include <sys/uio.h> 56#include <sys/unistd.h> 57#include <machine/stdarg.h> 58 59#include <sys/dtrace.h> 60 61#ifdef LINUX_SYSTRACE
| 24 * 25 */ 26 27/* 28 * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 29 * Use is subject to license terms. 30 */ 31 32#include <sys/cdefs.h> 33#include <sys/param.h> 34#include <sys/systm.h> 35#include <sys/conf.h> 36#include <sys/cpuvar.h> 37#include <sys/fcntl.h> 38#include <sys/filio.h> 39#include <sys/kdb.h> 40#include <sys/kernel.h> 41#include <sys/kmem.h> 42#include <sys/kthread.h> 43#include <sys/limits.h> 44#include <sys/linker.h> 45#include <sys/lock.h> 46#include <sys/malloc.h> 47#include <sys/module.h> 48#include <sys/mutex.h> 49#include <sys/poll.h> 50#include <sys/proc.h> 51#include <sys/selinfo.h> 52#include <sys/smp.h> 53#include <sys/sysproto.h> 54#include <sys/sysent.h> 55#include <sys/uio.h> 56#include <sys/unistd.h> 57#include <machine/stdarg.h> 58 59#include <sys/dtrace.h> 60 61#ifdef LINUX_SYSTRACE
|
62#include <linux.h> 63#include <linux_syscall.h> 64#include <linux_proto.h> 65#include <linux_syscallnames.c> 66#include <linux_systrace.c>
| 62#if defined(__amd64__) 63#include <amd64/linux32/linux.h> 64#include <amd64/linux32/linux32_proto.h> 65#include <amd64/linux32/linux32_syscalls.c> 66#include <amd64/linux32/linux32_systrace_args.c> 67#elif defined(__i386__) 68#include <i386/linux/linux.h> 69#include <i386/linux/linux_proto.h> 70#include <i386/linux/linux_syscalls.c> 71#include <i386/linux/linux_systrace_args.c> 72#else 73#error Only i386 and amd64 are supported. 74#endif
|
67extern struct sysent linux_sysent[];
| 75extern struct sysent linux_sysent[];
|
68#define DEVNAME "dtrace/linsystrace" 69#define PROVNAME "linsyscall"
| 76#define MODNAME "linux32"
|
70#define MAXSYSCALL LINUX_SYS_MAXSYSCALL 71#define SYSCALLNAMES linux_syscallnames 72#define SYSENT linux_sysent
| 77#define MAXSYSCALL LINUX_SYS_MAXSYSCALL 78#define SYSCALLNAMES linux_syscallnames 79#define SYSENT linux_sysent
|
| 80#elif defined(FREEBSD32_SYSTRACE) 81/* 82 * The syscall arguments are processed into a DTrace argument array 83 * using a generated function. See sys/kern/makesyscalls.sh. 84 */ 85#include <compat/freebsd32/freebsd32_proto.h> 86#include <compat/freebsd32/freebsd32_util.h> 87#include <compat/freebsd32/freebsd32_syscall.h> 88#include <compat/freebsd32/freebsd32_systrace_args.c> 89extern const char *freebsd32_syscallnames[]; 90#define MODNAME "freebsd32" 91#define MAXSYSCALL FREEBSD32_SYS_MAXSYSCALL 92#define SYSCALLNAMES freebsd32_syscallnames 93#define SYSENT freebsd32_sysent
|
73#else 74/* 75 * The syscall arguments are processed into a DTrace argument array 76 * using a generated function. See sys/kern/makesyscalls.sh. 77 */ 78#include <sys/syscall.h> 79#include <kern/systrace_args.c>
| 94#else 95/* 96 * The syscall arguments are processed into a DTrace argument array 97 * using a generated function. See sys/kern/makesyscalls.sh. 98 */ 99#include <sys/syscall.h> 100#include <kern/systrace_args.c>
|
80#define DEVNAME "dtrace/systrace" 81#define PROVNAME "syscall"
| 101#define MODNAME "freebsd"
|
82#define MAXSYSCALL SYS_MAXSYSCALL 83#define SYSCALLNAMES syscallnames 84#define SYSENT sysent 85#endif 86
| 102#define MAXSYSCALL SYS_MAXSYSCALL 103#define SYSCALLNAMES syscallnames 104#define SYSENT sysent 105#endif 106
|
| 107#define PROVNAME "syscall" 108#define DEVNAME "dtrace/systrace/" MODNAME 109
|
87#define SYSTRACE_ARTIFICIAL_FRAMES 1 88 89#define SYSTRACE_SHIFT 16 90#define SYSTRACE_ISENTRY(x) ((int)(x) >> SYSTRACE_SHIFT) 91#define SYSTRACE_SYSNUM(x) ((int)(x) & ((1 << SYSTRACE_SHIFT) - 1)) 92#define SYSTRACE_ENTRY(id) ((1 << SYSTRACE_SHIFT) | (id)) 93#define SYSTRACE_RETURN(id) (id) 94 95#if ((1 << SYSTRACE_SHIFT) <= MAXSYSCALL) 96#error 1 << SYSTRACE_SHIFT must exceed number of system calls 97#endif 98 99static d_open_t systrace_open; 100static int systrace_unload(void); 101static void systrace_getargdesc(void *, dtrace_id_t, void *, dtrace_argdesc_t *); 102static void systrace_provide(void *, dtrace_probedesc_t *); 103static void systrace_destroy(void *, dtrace_id_t, void *); 104static void systrace_enable(void *, dtrace_id_t, void *); 105static void systrace_disable(void *, dtrace_id_t, void *); 106static void systrace_load(void *); 107 108static struct cdevsw systrace_cdevsw = { 109 .d_version = D_VERSION, 110 .d_open = systrace_open, 111#ifdef LINUX_SYSTRACE 112 .d_name = "linsystrace", 113#else 114 .d_name = "systrace", 115#endif 116}; 117 118static union { 119 const char **p_constnames; 120 char **pp_syscallnames; 121} uglyhack = { SYSCALLNAMES }; 122 123static dtrace_pattr_t systrace_attr = { 124{ DTRACE_STABILITY_EVOLVING, DTRACE_STABILITY_EVOLVING, DTRACE_CLASS_COMMON }, 125{ DTRACE_STABILITY_PRIVATE, DTRACE_STABILITY_PRIVATE, DTRACE_CLASS_UNKNOWN }, 126{ DTRACE_STABILITY_PRIVATE, DTRACE_STABILITY_PRIVATE, DTRACE_CLASS_ISA }, 127{ DTRACE_STABILITY_EVOLVING, DTRACE_STABILITY_EVOLVING, DTRACE_CLASS_COMMON }, 128{ DTRACE_STABILITY_PRIVATE, DTRACE_STABILITY_PRIVATE, DTRACE_CLASS_ISA }, 129}; 130 131static dtrace_pops_t systrace_pops = { 132 systrace_provide, 133 NULL, 134 systrace_enable, 135 systrace_disable, 136 NULL, 137 NULL, 138 systrace_getargdesc, 139 NULL, 140 NULL, 141 systrace_destroy 142}; 143 144static struct cdev *systrace_cdev; 145static dtrace_provider_id_t systrace_id; 146 147#if !defined(LINUX_SYSTRACE) 148/* 149 * Probe callback function. 150 * 151 * Note: This function is called for _all_ syscalls, regardless of which sysent 152 * array the syscall comes from. It could be a standard syscall or a 153 * compat syscall from something like Linux. 154 */ 155static void 156systrace_probe(u_int32_t id, int sysnum, struct sysent *sysent, void *params, 157 int ret) 158{ 159 int n_args = 0; 160 u_int64_t uargs[8]; 161 162 memset(uargs, 0, sizeof(uargs)); 163 /* 164 * Check if this syscall has an argument conversion function 165 * registered. 166 */ 167 if (params && sysent->sy_systrace_args_func != NULL) { 168 /* 169 * Convert the syscall parameters using the registered 170 * function. 171 */ 172 (*sysent->sy_systrace_args_func)(sysnum, params, uargs, &n_args); 173 } else if (params) { 174 /* 175 * Use the built-in system call argument conversion 176 * function to translate the syscall structure fields 177 * into the array of 64-bit values that DTrace 178 * expects. 179 */ 180 systrace_args(sysnum, params, uargs, &n_args); 181 } else { 182 /* 183 * Since params is NULL, this is a 'return' probe. 184 * Set arg0 and arg1 as the return value of this syscall. 185 */ 186 uargs[0] = uargs[1] = ret; 187 } 188 189 /* Process the probe using the converted argments. */ 190 dtrace_probe(id, uargs[0], uargs[1], uargs[2], uargs[3], uargs[4]); 191} 192#endif 193 194static void 195systrace_getargdesc(void *arg, dtrace_id_t id, void *parg, dtrace_argdesc_t *desc) 196{ 197 int sysnum = SYSTRACE_SYSNUM((uintptr_t)parg); 198 199 systrace_setargdesc(sysnum, desc->dtargd_ndx, desc->dtargd_native, 200 sizeof(desc->dtargd_native)); 201 202 if (desc->dtargd_native[0] == '\0') 203 desc->dtargd_ndx = DTRACE_ARGNONE; 204 205 return; 206} 207 208static void 209systrace_provide(void *arg, dtrace_probedesc_t *desc) 210{ 211 int i; 212 213 if (desc != NULL) 214 return; 215 216 for (i = 0; i < MAXSYSCALL; i++) {
| 110#define SYSTRACE_ARTIFICIAL_FRAMES 1 111 112#define SYSTRACE_SHIFT 16 113#define SYSTRACE_ISENTRY(x) ((int)(x) >> SYSTRACE_SHIFT) 114#define SYSTRACE_SYSNUM(x) ((int)(x) & ((1 << SYSTRACE_SHIFT) - 1)) 115#define SYSTRACE_ENTRY(id) ((1 << SYSTRACE_SHIFT) | (id)) 116#define SYSTRACE_RETURN(id) (id) 117 118#if ((1 << SYSTRACE_SHIFT) <= MAXSYSCALL) 119#error 1 << SYSTRACE_SHIFT must exceed number of system calls 120#endif 121 122static d_open_t systrace_open; 123static int systrace_unload(void); 124static void systrace_getargdesc(void *, dtrace_id_t, void *, dtrace_argdesc_t *); 125static void systrace_provide(void *, dtrace_probedesc_t *); 126static void systrace_destroy(void *, dtrace_id_t, void *); 127static void systrace_enable(void *, dtrace_id_t, void *); 128static void systrace_disable(void *, dtrace_id_t, void *); 129static void systrace_load(void *); 130 131static struct cdevsw systrace_cdevsw = { 132 .d_version = D_VERSION, 133 .d_open = systrace_open, 134#ifdef LINUX_SYSTRACE 135 .d_name = "linsystrace", 136#else 137 .d_name = "systrace", 138#endif 139}; 140 141static union { 142 const char **p_constnames; 143 char **pp_syscallnames; 144} uglyhack = { SYSCALLNAMES }; 145 146static dtrace_pattr_t systrace_attr = { 147{ DTRACE_STABILITY_EVOLVING, DTRACE_STABILITY_EVOLVING, DTRACE_CLASS_COMMON }, 148{ DTRACE_STABILITY_PRIVATE, DTRACE_STABILITY_PRIVATE, DTRACE_CLASS_UNKNOWN }, 149{ DTRACE_STABILITY_PRIVATE, DTRACE_STABILITY_PRIVATE, DTRACE_CLASS_ISA }, 150{ DTRACE_STABILITY_EVOLVING, DTRACE_STABILITY_EVOLVING, DTRACE_CLASS_COMMON }, 151{ DTRACE_STABILITY_PRIVATE, DTRACE_STABILITY_PRIVATE, DTRACE_CLASS_ISA }, 152}; 153 154static dtrace_pops_t systrace_pops = { 155 systrace_provide, 156 NULL, 157 systrace_enable, 158 systrace_disable, 159 NULL, 160 NULL, 161 systrace_getargdesc, 162 NULL, 163 NULL, 164 systrace_destroy 165}; 166 167static struct cdev *systrace_cdev; 168static dtrace_provider_id_t systrace_id; 169 170#if !defined(LINUX_SYSTRACE) 171/* 172 * Probe callback function. 173 * 174 * Note: This function is called for _all_ syscalls, regardless of which sysent 175 * array the syscall comes from. It could be a standard syscall or a 176 * compat syscall from something like Linux. 177 */ 178static void 179systrace_probe(u_int32_t id, int sysnum, struct sysent *sysent, void *params, 180 int ret) 181{ 182 int n_args = 0; 183 u_int64_t uargs[8]; 184 185 memset(uargs, 0, sizeof(uargs)); 186 /* 187 * Check if this syscall has an argument conversion function 188 * registered. 189 */ 190 if (params && sysent->sy_systrace_args_func != NULL) { 191 /* 192 * Convert the syscall parameters using the registered 193 * function. 194 */ 195 (*sysent->sy_systrace_args_func)(sysnum, params, uargs, &n_args); 196 } else if (params) { 197 /* 198 * Use the built-in system call argument conversion 199 * function to translate the syscall structure fields 200 * into the array of 64-bit values that DTrace 201 * expects. 202 */ 203 systrace_args(sysnum, params, uargs, &n_args); 204 } else { 205 /* 206 * Since params is NULL, this is a 'return' probe. 207 * Set arg0 and arg1 as the return value of this syscall. 208 */ 209 uargs[0] = uargs[1] = ret; 210 } 211 212 /* Process the probe using the converted argments. */ 213 dtrace_probe(id, uargs[0], uargs[1], uargs[2], uargs[3], uargs[4]); 214} 215#endif 216 217static void 218systrace_getargdesc(void *arg, dtrace_id_t id, void *parg, dtrace_argdesc_t *desc) 219{ 220 int sysnum = SYSTRACE_SYSNUM((uintptr_t)parg); 221 222 systrace_setargdesc(sysnum, desc->dtargd_ndx, desc->dtargd_native, 223 sizeof(desc->dtargd_native)); 224 225 if (desc->dtargd_native[0] == '\0') 226 desc->dtargd_ndx = DTRACE_ARGNONE; 227 228 return; 229} 230 231static void 232systrace_provide(void *arg, dtrace_probedesc_t *desc) 233{ 234 int i; 235 236 if (desc != NULL) 237 return; 238 239 for (i = 0; i < MAXSYSCALL; i++) {
|
217 if (dtrace_probe_lookup(systrace_id, NULL,
| 240 if (dtrace_probe_lookup(systrace_id, MODNAME,
|
218 uglyhack.pp_syscallnames[i], "entry") != 0) 219 continue; 220
| 241 uglyhack.pp_syscallnames[i], "entry") != 0) 242 continue; 243
|
221 (void) dtrace_probe_create(systrace_id, NULL, uglyhack.pp_syscallnames[i],
| 244 (void) dtrace_probe_create(systrace_id, MODNAME, uglyhack.pp_syscallnames[i],
|
222 "entry", SYSTRACE_ARTIFICIAL_FRAMES, 223 (void *)((uintptr_t)SYSTRACE_ENTRY(i)));
| 245 "entry", SYSTRACE_ARTIFICIAL_FRAMES, 246 (void *)((uintptr_t)SYSTRACE_ENTRY(i)));
|
224 (void) dtrace_probe_create(systrace_id, NULL, uglyhack.pp_syscallnames[i],
| 247 (void) dtrace_probe_create(systrace_id, MODNAME, uglyhack.pp_syscallnames[i],
|
225 "return", SYSTRACE_ARTIFICIAL_FRAMES, 226 (void *)((uintptr_t)SYSTRACE_RETURN(i))); 227 } 228} 229 230static void 231systrace_destroy(void *arg, dtrace_id_t id, void *parg) 232{ 233#ifdef DEBUG 234 int sysnum = SYSTRACE_SYSNUM((uintptr_t)parg); 235 236 /* 237 * There's nothing to do here but assert that we have actually been 238 * disabled. 239 */ 240 if (SYSTRACE_ISENTRY((uintptr_t)parg)) { 241 ASSERT(sysent[sysnum].sy_entry == 0); 242 } else { 243 ASSERT(sysent[sysnum].sy_return == 0); 244 } 245#endif 246} 247 248static void 249systrace_enable(void *arg, dtrace_id_t id, void *parg) 250{ 251 int sysnum = SYSTRACE_SYSNUM((uintptr_t)parg); 252 253 if (SYSENT[sysnum].sy_systrace_args_func == NULL) 254 SYSENT[sysnum].sy_systrace_args_func = systrace_args; 255 256 if (SYSTRACE_ISENTRY((uintptr_t)parg)) 257 SYSENT[sysnum].sy_entry = id; 258 else 259 SYSENT[sysnum].sy_return = id; 260} 261 262static void 263systrace_disable(void *arg, dtrace_id_t id, void *parg) 264{ 265 int sysnum = SYSTRACE_SYSNUM((uintptr_t)parg); 266 267 SYSENT[sysnum].sy_entry = 0; 268 SYSENT[sysnum].sy_return = 0; 269} 270 271static void 272systrace_load(void *dummy) 273{ 274 /* Create the /dev/dtrace/systrace entry. */ 275 systrace_cdev = make_dev(&systrace_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, 276 DEVNAME); 277 278 if (dtrace_register(PROVNAME, &systrace_attr, DTRACE_PRIV_USER, 279 NULL, &systrace_pops, NULL, &systrace_id) != 0) 280 return; 281 282#if !defined(LINUX_SYSTRACE) 283 systrace_probe_func = systrace_probe; 284#endif 285} 286 287 288static int 289systrace_unload() 290{ 291 int error = 0; 292 293 if ((error = dtrace_unregister(systrace_id)) != 0) 294 return (error); 295 296#if !defined(LINUX_SYSTRACE) 297 systrace_probe_func = NULL; 298#endif 299 300 destroy_dev(systrace_cdev); 301 302 return (error); 303} 304 305static int 306systrace_modevent(module_t mod __unused, int type, void *data __unused) 307{ 308 int error = 0; 309 310 switch (type) { 311 case MOD_LOAD: 312 break; 313 314 case MOD_UNLOAD: 315 break; 316 317 case MOD_SHUTDOWN: 318 break; 319 320 default: 321 error = EOPNOTSUPP; 322 break; 323 324 } 325 return (error); 326} 327 328static int 329systrace_open(struct cdev *dev __unused, int oflags __unused, int devtype __unused, struct thread *td __unused) 330{ 331 return (0); 332} 333 334SYSINIT(systrace_load, SI_SUB_DTRACE_PROVIDER, SI_ORDER_ANY, systrace_load, NULL); 335SYSUNINIT(systrace_unload, SI_SUB_DTRACE_PROVIDER, SI_ORDER_ANY, systrace_unload, NULL); 336 337#ifdef LINUX_SYSTRACE
| 248 "return", SYSTRACE_ARTIFICIAL_FRAMES, 249 (void *)((uintptr_t)SYSTRACE_RETURN(i))); 250 } 251} 252 253static void 254systrace_destroy(void *arg, dtrace_id_t id, void *parg) 255{ 256#ifdef DEBUG 257 int sysnum = SYSTRACE_SYSNUM((uintptr_t)parg); 258 259 /* 260 * There's nothing to do here but assert that we have actually been 261 * disabled. 262 */ 263 if (SYSTRACE_ISENTRY((uintptr_t)parg)) { 264 ASSERT(sysent[sysnum].sy_entry == 0); 265 } else { 266 ASSERT(sysent[sysnum].sy_return == 0); 267 } 268#endif 269} 270 271static void 272systrace_enable(void *arg, dtrace_id_t id, void *parg) 273{ 274 int sysnum = SYSTRACE_SYSNUM((uintptr_t)parg); 275 276 if (SYSENT[sysnum].sy_systrace_args_func == NULL) 277 SYSENT[sysnum].sy_systrace_args_func = systrace_args; 278 279 if (SYSTRACE_ISENTRY((uintptr_t)parg)) 280 SYSENT[sysnum].sy_entry = id; 281 else 282 SYSENT[sysnum].sy_return = id; 283} 284 285static void 286systrace_disable(void *arg, dtrace_id_t id, void *parg) 287{ 288 int sysnum = SYSTRACE_SYSNUM((uintptr_t)parg); 289 290 SYSENT[sysnum].sy_entry = 0; 291 SYSENT[sysnum].sy_return = 0; 292} 293 294static void 295systrace_load(void *dummy) 296{ 297 /* Create the /dev/dtrace/systrace entry. */ 298 systrace_cdev = make_dev(&systrace_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, 299 DEVNAME); 300 301 if (dtrace_register(PROVNAME, &systrace_attr, DTRACE_PRIV_USER, 302 NULL, &systrace_pops, NULL, &systrace_id) != 0) 303 return; 304 305#if !defined(LINUX_SYSTRACE) 306 systrace_probe_func = systrace_probe; 307#endif 308} 309 310 311static int 312systrace_unload() 313{ 314 int error = 0; 315 316 if ((error = dtrace_unregister(systrace_id)) != 0) 317 return (error); 318 319#if !defined(LINUX_SYSTRACE) 320 systrace_probe_func = NULL; 321#endif 322 323 destroy_dev(systrace_cdev); 324 325 return (error); 326} 327 328static int 329systrace_modevent(module_t mod __unused, int type, void *data __unused) 330{ 331 int error = 0; 332 333 switch (type) { 334 case MOD_LOAD: 335 break; 336 337 case MOD_UNLOAD: 338 break; 339 340 case MOD_SHUTDOWN: 341 break; 342 343 default: 344 error = EOPNOTSUPP; 345 break; 346 347 } 348 return (error); 349} 350 351static int 352systrace_open(struct cdev *dev __unused, int oflags __unused, int devtype __unused, struct thread *td __unused) 353{ 354 return (0); 355} 356 357SYSINIT(systrace_load, SI_SUB_DTRACE_PROVIDER, SI_ORDER_ANY, systrace_load, NULL); 358SYSUNINIT(systrace_unload, SI_SUB_DTRACE_PROVIDER, SI_ORDER_ANY, systrace_unload, NULL); 359 360#ifdef LINUX_SYSTRACE
|
338DEV_MODULE(linsystrace, systrace_modevent, NULL); 339MODULE_VERSION(linsystrace, 1); 340MODULE_DEPEND(linsystrace, linux, 1, 1, 1); 341MODULE_DEPEND(linsystrace, systrace, 1, 1, 1); 342MODULE_DEPEND(linsystrace, dtrace, 1, 1, 1); 343MODULE_DEPEND(linsystrace, opensolaris, 1, 1, 1);
| 361DEV_MODULE(systrace_linux32, systrace_modevent, NULL); 362MODULE_VERSION(systrace_linux32, 1); 363MODULE_DEPEND(systrace_linux32, linux, 1, 1, 1); 364MODULE_DEPEND(systrace_linux32, dtrace, 1, 1, 1); 365MODULE_DEPEND(systrace_linux32, opensolaris, 1, 1, 1); 366#elif defined(FREEBSD32_SYSTRACE) 367DEV_MODULE(systrace_freebsd32, systrace_modevent, NULL); 368MODULE_VERSION(systrace_freebsd32, 1); 369MODULE_DEPEND(systrace_freebsd32, dtrace, 1, 1, 1); 370MODULE_DEPEND(systrace_freebsd32, opensolaris, 1, 1, 1);
|
344#else 345DEV_MODULE(systrace, systrace_modevent, NULL); 346MODULE_VERSION(systrace, 1); 347MODULE_DEPEND(systrace, dtrace, 1, 1, 1); 348MODULE_DEPEND(systrace, opensolaris, 1, 1, 1); 349#endif
| 371#else 372DEV_MODULE(systrace, systrace_modevent, NULL); 373MODULE_VERSION(systrace, 1); 374MODULE_DEPEND(systrace, dtrace, 1, 1, 1); 375MODULE_DEPEND(systrace, opensolaris, 1, 1, 1); 376#endif
|