diff options
author | markj <markj@FreeBSD.org> | 2013-08-24 21:13:38 +0000 |
---|---|---|
committer | markj <markj@FreeBSD.org> | 2013-08-24 21:13:38 +0000 |
commit | 3541d8b1434b233c6420ff91d742fe8b8c53a2e1 (patch) | |
tree | ef10dca68a0c1d91a3cc018d4f95de74d267c03f /sys/cddl/dev/dtrace | |
parent | 6ad648e223be6153dd1674649bfc08d9733aa04a (diff) | |
download | FreeBSD-src-3541d8b1434b233c6420ff91d742fe8b8c53a2e1.zip FreeBSD-src-3541d8b1434b233c6420ff91d742fe8b8c53a2e1.tar.gz |
Rename the kld_unload event handler to kld_unload_try, and add a new
kld_unload event handler which gets invoked after a linker file has been
successfully unloaded. The kld_unload and kld_load event handlers are now
invoked with the shared linker lock held, while kld_unload_try is invoked
with the lock exclusively held.
Convert hwpmc(4) to use these event handlers instead of having
kern_kldload() and kern_kldunload() invoke hwpmc(4) hooks whenever files are
loaded or unloaded. This has no functional effect, but simplifes the linker
code somewhat.
Reviewed by: jhb
Diffstat (limited to 'sys/cddl/dev/dtrace')
-rw-r--r-- | sys/cddl/dev/dtrace/dtrace_load.c | 4 | ||||
-rw-r--r-- | sys/cddl/dev/dtrace/dtrace_unload.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/sys/cddl/dev/dtrace/dtrace_load.c b/sys/cddl/dev/dtrace/dtrace_load.c index f37d593..05436fe 100644 --- a/sys/cddl/dev/dtrace/dtrace_load.c +++ b/sys/cddl/dev/dtrace/dtrace_load.c @@ -59,8 +59,8 @@ dtrace_load(void *dummy) /* Register callbacks for linker file load and unload events. */ dtrace_kld_load_tag = EVENTHANDLER_REGISTER(kld_load, dtrace_kld_load, NULL, EVENTHANDLER_PRI_ANY); - dtrace_kld_unload_tag = EVENTHANDLER_REGISTER(kld_unload, - dtrace_kld_unload, NULL, EVENTHANDLER_PRI_ANY); + dtrace_kld_unload_try_tag = EVENTHANDLER_REGISTER(kld_unload_try, + dtrace_kld_unload_try, NULL, EVENTHANDLER_PRI_ANY); /* * Initialise the mutexes without 'witness' because the dtrace diff --git a/sys/cddl/dev/dtrace/dtrace_unload.c b/sys/cddl/dev/dtrace/dtrace_unload.c index 9e37114..e9bd53c 100644 --- a/sys/cddl/dev/dtrace/dtrace_unload.c +++ b/sys/cddl/dev/dtrace/dtrace_unload.c @@ -68,7 +68,7 @@ dtrace_unload() dtrace_provider = NULL; EVENTHANDLER_DEREGISTER(kld_load, dtrace_kld_load_tag); - EVENTHANDLER_DEREGISTER(kld_unload, dtrace_kld_unload_tag); + EVENTHANDLER_DEREGISTER(kld_unload_try, dtrace_kld_unload_try_tag); if ((state = dtrace_anon_grab()) != NULL) { /* |