Date: Tue, 1 Jan 2008 22:35:42 GMT From: John Birrell <jb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 132265 for review Message-ID: <200801012235.m01MZg9b055113@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=132265 Change 132265 by jb@jb_freebsd1 on 2008/01/01 22:34:48 Revise the profile provider: - Add a SYSUNINIT. - Move code from modevent to load/unload. - Remove memory type M_PROFILE as it isn't used. - Add a dependency on the opensolaris module. Affected files ... .. //depot/projects/dtrace/src/sys/cddl/dev/profile/profile.c#3 edit Differences ... ==== //depot/projects/dtrace/src/sys/cddl/dev/profile/profile.c#3 (text+ko) ==== @@ -18,7 +18,7 @@ * * CDDL HEADER END * - * Portions Copyright 2006 John Birrell jb@freebsd.org + * Portions Copyright 2006-2008 John Birrell jb@freebsd.org * * $FreeBSD$ * @@ -32,7 +32,6 @@ #include <sys/cdefs.h> #include <sys/param.h> #include <sys/systm.h> -#include <sys/bus.h> #include <sys/conf.h> #include <sys/cpuvar.h> #include <sys/fcntl.h> @@ -55,12 +54,9 @@ #include <sys/unistd.h> #include <machine/stdarg.h> -#include <sys/cyclic_impl.h> -#include <sys/dtrace_impl.h> - -MALLOC_DECLARE(M_PROFILE); -MALLOC_DEFINE(M_PROFILE, "profile", "Dynamic Interrupt Tracing"); -#define M_KMEM M_PROFILE +#include <sys/cyclic.h> +#include <sys/dtrace.h> +#include <sys/dtrace_bsd.h> #define PROF_NAMELEN 15 @@ -479,6 +475,10 @@ static void profile_load(void *dummy) { + /* Create the /dev/dtrace/profile entry. */ + profile_cdev = make_dev(&profile_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, + "dtrace/profile"); + if (dtrace_register("profile", &profile_attr, DTRACE_PRIV_USER, NULL, &profile_pops, NULL, &profile_id) != 0) return; @@ -506,13 +506,9 @@ switch (type) { case MOD_LOAD: - /* Create the /dev/dtrace/profile entry. */ - profile_cdev = make_dev(&profile_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, - "dtrace/profile"); break; case MOD_UNLOAD: - error = profile_unload(); break; case MOD_SHUTDOWN: @@ -533,9 +529,11 @@ return (0); } -SYSINIT(profile_load, SI_SUB_DTRACE_PROVIDER, SI_ORDER_ANY, profile_load, NULL) +SYSINIT(profile_load, SI_SUB_DTRACE_PROVIDER, SI_ORDER_ANY, profile_load, NULL); +SYSUNINIT(profile_unload, SI_SUB_DTRACE_PROVIDER, SI_ORDER_ANY, profile_unload, NULL); DEV_MODULE(profile, profile_modevent, NULL); MODULE_VERSION(profile, 1); MODULE_DEPEND(profile, dtrace, 1, 1, 1); MODULE_DEPEND(profile, cyclic, 1, 1, 1); +MODULE_DEPEND(profile, opensolaris, 1, 1, 1);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200801012235.m01MZg9b055113>