]> git.proxmox.com Git - mirror_frr.git/commit - lib/subdir.am
lib: add trace.h, frrtrace(), support for USDT
authorQuentin Young <qlyoung@nvidia.com>
Mon, 28 Sep 2020 21:22:53 +0000 (17:22 -0400)
committerQuentin Young <qlyoung@nvidia.com>
Fri, 23 Oct 2020 19:13:51 +0000 (15:13 -0400)
commit552e2a306a3b3335ee60965bbcd61c27eecc576d
tree7bc84d1121c84f56b02027cbdedde6ce09ce3c6e
parent912d45a1610dc7ec14017a2d8618ad357e89370e
lib: add trace.h, frrtrace(), support for USDT

Previous commits added LTTng tracepoints. This was primarily for testing
/ trial purposes; in practice we'd like to support arbitrary tracing
methods, and especially USDT probes, which SystemTap and dtrace expect,
and which are supported on at least one flavor of BSD (FreeBSD).

To that end this patch adds an frr-specific tracing macro, frrtrace(),
which proxies into either DTRACE_PROBEn() or tracepoint() macros
depending on whether --enable-usdt or --enable-lttng is passed at
compile time.

At some point this could be tweaked to allow compiling in both types of
probes. Ideally there should be some logic there to use LTTng's optional
support for generating USDT probes when both are requested.

No additional libraries are required to use USDT, since these probes are
a kernel feature and only need the <sys/sdt.h> header.

- add --enable-usdt to toggle use of LTTng tracepoints or USDT probes
- add new trace.h library header for use with tracepoint definition
  headers
- add frrtrace() wrapper macro; this should be used to define
  tracepoints instead of using tracepoint() or DTRACE_PROBEn()

Compilation with USDT does nothing as of this commit; the existing LTTng
tracepoints need to be converted to use the frrtrace*() macros in a
subsequent commit.

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
configure.ac
lib/subdir.am
lib/trace.h [new file with mode: 0644]