Performance probes

Alan DeKok aland at
Tue Oct 15 14:03:18 CEST 2013

Phil Mayers wrote:

  Looking at the page some more, here's my $0.02.

- ignore the configure checks for sys/std.h, unless you're a masochist.
Arran or I will get that going.  For testing, you can just manually add
#define entries to src/include/autoconf.h

- I'd put the changes into src/include/log.c:

 *  Catch brokenness
#ifndef HAVE_SYS_STD_H


// typical pattern
#include <sys/sdt.h>

// create empty defines if they don't exist
#define DTRACE_PROBE(_x, _y)
#define ...

// anything else here to avoid #ifdef's in the code


  For the actual probes, use:

	DTRACE_PROBE(progname, ...)

  Because "progname" is a global which is the base name of the binary.
e.g. /usr/sbin/radiusd -> radiusd.

  That lets it automatically change the probe names if we want to run
the server as "radrelay", for example.

  And then sprinkle the probes everywhere.  I'd suggest
src/main/modcall.c for the various modules.  And src/main/threads.c for
the queue / dequeue work.  And src/main/process.c for the various state
machine handling.

  I can then use dtrace on my Mac to debug performance issues.  Nice!

  Alan DeKok.

More information about the Freeradius-Devel mailing list