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