tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Revisiting DTrace syscall provider



On Wed, Feb 25, 2015 at 12:35 PM, Ryota Ozaki <ozaki-r%netbsd.org@localhost> wrote:
> On Wed, Feb 25, 2015 at 4:10 AM, bch <brad.harder%gmail.com@localhost> wrote:
>> w/ latest -current:
>>
>> % dtrace -l
>> BEGIN
>> END
>> ERROR
>> % dtrace -n BEGIN
>> <fault/reboot>
>>
>>
>> This is w/o loading any kernel modules, but the probes are still
>> listed as available, but then fault.
>
> Autoloading modules is a feature of NetBSD. You can see solaris.kmod
> and dtrace.kmod are loaded after dtrace -l. Note that BEGIN, END,
> ERROR are 'dtrace' provider that is included in dtrace.kmod.
>
> OTOH, the fault should be a bug. I'm investigating it.

Got it. NetBSD has also auto-unloading feature and it unloads
dtarce.kmod after kern.module.autotime sec since auto-loading.
Currently dtrace.kmod allows being unloaded without caring of users.

A quick fix is:

diff --git a/external/cddl/osnet/dev/dtrace/dtrace_modevent.c
b/external/cddl/osnet/dev/dtrace/dtrace_modevent.c
index 9df0cd1..40c8e7f 100644
--- a/external/cddl/osnet/dev/dtrace/dtrace_modevent.c
+++ b/external/cddl/osnet/dev/dtrace/dtrace_modevent.c
@@ -38,6 +38,8 @@ dtrace_modcmd(modcmd_t cmd, void *data)
        case MODULE_CMD_FINI:
                dtrace_unload();
                return devsw_detach(NULL, &dtrace_cdevsw);
+       case MODULE_CMD_AUTOUNLOAD:
+               return EBUSY;
        default:
                return ENOTTY;
        }

It prevents auto-unloading. It should fix the problem.

Thanks,
  ozaki-r


Home | Main Index | Thread Index | Old Index