Trace logging project

Nicolas Williams Nicolas.Williams at sun.com
Mon Sep 14 19:15:03 EDT 2009


On Mon, Sep 14, 2009 at 03:32:51PM -0400, Greg Hudson wrote:
> On Mon, 2009-09-14 at 13:13 -0400, Nicolas Williams wrote:
> > Also, I think you should consider a DTrace USDT provider.
> 
> I will have to read up on this.

Ok, so, looking at the docs, it looks like it ought to be possible to
build krb5 trace macros that devolve into DTrace USDT probes when that
is available.

Defining a USDT provider and its probes is easy enough:

 - you need a .d file listing provider attributes and defining the
   probes and their arguments;

 - DTRACE_PROBEn() <PROVIDER>_<PROBE>() and <PROVIDER>_<PROBE>_ENABLED()
   macros (the last two generated by dtrace(1M) from the .d file) must
   be littered in the code to define the actual probe points.  The 'n'
   is the number of arguments.  These macros take a provider name
   argument, a probe name argument, and any arguments to the probe;

 - an extra build step to use dtrace(1M) to generate a header file to
   include (defines the <PROVIDER>_<PROBE>*() macros) and an object to
   link in.

ISTM that you could define macros with the same signatures as the ones
that DTrace would generated for you.  Which means you could have a
single set of trace/probe points to litter through the code.

I think it'd be great if you did define trace points as macros that
could be generated by dtrace(1M).  Someone else could do the work of
writing the .d file, autoconf and makefile code to use DTrace.

Useful links:

http://www.solarisinternals.com/wiki/index.php/DTrace_Topics_USDT (and
links at the bottom of that)
http://wikis.sun.com/display/DTrace/Statically+Defined+Tracing+for+User+Applications
http://www.opensolaris.org/jive/thread.jspa?messageID=31314

Cheers,

Nico
-- 



More information about the krbdev mailing list