DTrace probes & klds

Alexander Leidinger Alexander at Leidinger.net
Fri Aug 21 12:42:09 UTC 2009


Quoting Daniel O'Connor <doconnor at gsoft.com.au> (from Thu, 20 Aug 2009  
17:13:07 +0930):

> On Thu, 20 Aug 2009, Alexander Leidinger wrote:
>> Quoting Daniel O'Connor <doconnor at gsoft.com.au> (from Wed, 19 Aug
>> 2009
>>
>> 23:31:33 +0930):
>> > Content-Type: text/plain;
>> >   charset="utf-8"
>> > Content-Transfer-Encoding: quoted-printable
>> > Content-Disposition: inline
>> >
>> > Is it possible? the handbook implies not and I can't get it to
>> > work, but i could be doing it wrong..
>> >
>> > I get fbt traces listed for KLDs (I get new entries for each load
>> > of the KLD which seems like a potential problem) but I can't
>> > specify an SDT_PROBE and have it work.
>>
>> Can you show us some example code?
>
> /* Recycle fbt as SDT_PROVIDER_DEFINE is said not to work */
> SDT_PROBE_DEFINE(fbt, gsio, gsio_intr, test);
> SDT_PROBE_ARGTYPE(fbt, gsio, gsio_intr, test, 0, "int");
> SDT_PROBE_ARGTYPE(fbt, gsio, gsio_intr, test, 1, "int");

I don't think you can define a fbt probe by hand. You can define a  
provider on your own via SDT_PROVIDER_DEFINE (in only one place/file),  
and then use this provider instead of fbt above. Let's assume you  
defined a gsio provider, then the SDT_PROBE_DEFINE could be
   SDT_PROBE_DEFINE(gsio, <unique_part_of_name_of_file>, gsio_intr, test);

If there's only one file, it does not make much sense to add an unique  
part of the name of the file, but if you have multiple files it can be  
helpful. But this is just an example, for example in GEOM it would  
make sense to name the provider "geom", and instead of the file name  
use the module name, e.g. mirror, raid3, core/whatever, ... instead.

Bye,
Alexander.

-- 
  Fry: Where's Captain Bender? Off catastrophizing some other planet?

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