Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/cddl/osnet/dev/dtrace autoload tracing modules.
details: https://anonhg.NetBSD.org/src/rev/7b647592077e
branches: trunk
changeset: 785207:7b647592077e
user: christos <christos%NetBSD.org@localhost>
date: Sun Mar 03 18:16:35 2013 +0000
description:
autoload tracing modules.
diffstat:
external/cddl/osnet/dev/dtrace/dtrace_ioctl.c | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
diffs (51 lines):
diff -r dda31be42d69 -r 7b647592077e external/cddl/osnet/dev/dtrace/dtrace_ioctl.c
--- a/external/cddl/osnet/dev/dtrace/dtrace_ioctl.c Sun Mar 03 16:56:15 2013 +0000
+++ b/external/cddl/osnet/dev/dtrace/dtrace_ioctl.c Sun Mar 03 18:16:35 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dtrace_ioctl.c,v 1.3 2011/08/31 21:57:16 christos Exp $ */
+/* $NetBSD: dtrace_ioctl.c,v 1.4 2013/03/03 18:16:35 christos Exp $ */
/*
* CDDL HEADER START
@@ -647,6 +647,8 @@
DTRACE_IOCTL_PRINTF("%s(%d): DTRACEIOC_PROVIDER\n",__func__,__LINE__);
pvd->dtvd_name[DTRACE_PROVNAMELEN - 1] = '\0';
+ error = 0;
+again:
mutex_enter(&dtrace_provider_lock);
for (pvp = dtrace_provider; pvp != NULL; pvp = pvp->dtpv_next) {
@@ -656,6 +658,13 @@
mutex_exit(&dtrace_provider_lock);
+ if (pvp == NULL && error == 0) {
+ error = module_autoload(pvd->dtvd_name,
+ MODULE_CLASS_MISC);
+ if (error == 0)
+ goto again;
+ }
+
if (pvp == NULL)
return (ESRCH);
@@ -758,16 +767,15 @@
return (0);
}
case DTRACEIOC_STOP: {
- int rval;
processorid_t *cpuid = (processorid_t *) addr;
DTRACE_IOCTL_PRINTF("%s(%d): DTRACEIOC_STOP\n",__func__,__LINE__);
mutex_enter(&dtrace_lock);
- rval = dtrace_state_stop(state, cpuid);
+ error = dtrace_state_stop(state, cpuid);
mutex_exit(&dtrace_lock);
- return (rval);
+ return (error);
}
default:
error = ENOTTY;
Home |
Main Index |
Thread Index |
Old Index