1 /* $NetBSD: dtrace_test.c,v 1.2 2010/02/21 01:46:33 darran Exp $ */ 2 3 /*- 4 * Copyright 2008 John Birrell <jb@FreeBSD.org> 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: 9 * 1. Redistributions of source code must retain the above copyright 10 * notice, this list of conditions and the following disclaimer. 11 * 2. Redistributions in binary form must reproduce the above copyright 12 * notice, this list of conditions and the following disclaimer in the 13 * documentation and/or other materials provided with the distribution. 14 * 15 * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND 16 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE 19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 * 27 * $FreeBSD: src/sys/cddl/dev/dtrace/dtrace_test.c,v 1.1.4.1 2009/08/03 08:13:06 kensmith Exp $ 28 * 29 */ 30 31 #include <sys/cdefs.h> 32 #include <sys/types.h> 33 #include <sys/param.h> 34 #include <sys/conf.h> 35 #include <sys/kernel.h> 36 #include <sys/module.h> 37 #include <sys/vnode.h> 38 39 /* 40 * These are variables that the DTrace test suite references in the 41 * Solaris kernel. We define them here so that the tests function 42 * unaltered. 43 */ 44 int kmem_flags; 45 46 typedef struct vnode vnode_t; 47 vnode_t dummy; 48 vnode_t *rootvp = &dummy; 49 50 static int 51 dtrace_test_modevent(module_t mod, int type, void *data) 52 { 53 int error = 0; 54 55 switch (type) { 56 case MOD_LOAD: 57 break; 58 59 case MOD_UNLOAD: 60 break; 61 62 case MOD_SHUTDOWN: 63 break; 64 65 default: 66 error = EOPNOTSUPP; 67 break; 68 69 } 70 return (error); 71 } 72 73 DEV_MODULE(dtrace_test, dtrace_test_modevent, NULL); 74 MODULE_VERSION(dtrace_test, 1); 75 MODULE_DEPEND(dtrace_test, dtraceall, 1, 1, 1); 76