dtrace sdt problem: my fault or a generic problem (SYSINIT not working as expected for modules)?

Alexander Leidinger Alexander at Leidinger.net
Fri Mar 25 13:15:05 UTC 2011


Quoting Andriy Gapon <avg at freebsd.org> (from Fri, 25 Mar 2011 12:56:56 +0200):

> on 25/03/2011 11:52 Alexander Leidinger said the following:
>> As I read it, it looks a little bit like the SYSINIT of the SDT  
>> probes didn't
>> work as expected for my new probes (does this work in modules?  
>> fxr.watson.org
>> AFAICS only lists SDT probes in kernel-code, not in module-code), a  
>> hit with the
>> clue-bat is welcome.
>
> My reading of the code is that all modules with SDT proivders/probes  
> should be
> loaded before sdt module itself.
> SYSINIT in your module(s) works as expect, but dtrace_register() is  
> not called
> on your SDT provider.  See sys/cddl/dev/sdt/sdt.c for details:  
> sdt_modevent ->
> sdt_load -> sdt_provider_listall(sdt_provider_reg_callback) ->  
> dtrace_register.

So if I load linux.ko before sdt.ko, or if I unload sdt.ko and reload  
it, it should work? I'm going to try this after sending this mail.

> I am not saying that this behavior is correct/desired, just that  
> this is what we
> have now.

Is someone working on this? If not, what would be a solution for this?  
Adding a call (which one) to the modevent of the module which is using  
SDT probes?

Can we prevent a kernel panic for this case (maybe detecting a NULL ID  
and skipping... or maybe even registering it)?

Something to add to the ideas list as a GSoC entry, or is this too small/big?

Bye,
Alexander.

-- 
One way to make your old car run better is to look up the price of a
new model.

http://www.Leidinger.net    Alexander @ Leidinger.net: PGP ID = B0063FE7
http://www.FreeBSD.org       netchild @ FreeBSD.org  : PGP ID = 72077137


More information about the freebsd-hackers mailing list