summaryrefslogtreecommitdiffstats
path: root/lib/trace.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* *: auto-convert to SPDX License IDsDavid Lamparter2023-02-091-14/+1
| | | | | | Done with a combination of regex'ing and banging my head against a wall. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* lib: add trace.h, frrtrace(), support for USDTQuentin Young2020-10-231-0/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* lib: move trace.h -> libfrr_trace.hQuentin Young2020-10-231-249/+0
| | | | Signed-off-by: Quentin Young <qlyoung@nvidia.com>
* lib: add tracepoint for route table getQuentin Young2020-10-231-0/+13
| | | | Signed-off-by: Quentin Young <qlyoung@nvidia.com>
* lib: add tracepoints for *malloc, list opsQuentin Young2020-10-231-0/+78
| | | | | | | - Add tracepoints for FRR malloc and free - Add tracepoints for basic list operations Signed-off-by: Quentin Young <qlyoung@nvidia.com>
* lib: add tracepoint for hash insertionQuentin Young2020-10-231-0/+15
| | | | | | | hash_get is used for both lookup and insert; add a tracepoint for when we insert something into the hash Signed-off-by: Quentin Young <qlyoung@nvidia.com>
* lib: add tracepoints for pthread run, stopQuentin Young2020-10-231-0/+22
| | | | Signed-off-by: Quentin Young <qlyoung@nvidia.com>
* lib: generate trace events for log messagesQuentin Young2020-10-231-0/+1
| | | | | | | | | | | LTTng supports tracef() and tracelog() macros, which work like printf, and are used to ease transition between logging and tracing. Messages printed using these macros end up as trace events. For our uses we are not interested in dropping logging, but it is nice to get log messages in trace output, so I've added a call to tracelog() in zlog that dumps our zlog messages as trace events. Signed-off-by: Quentin Young <qlyoung@nvidia.com>
* lib: add tracepoints for hash ops, thread eventsQuentin Young2020-10-231-2/+72
| | | | | | | Define some initial tracepoints for hash table operations, thread schedules, and thread cancels Signed-off-by: Quentin Young <qlyoung@nvidia.com>
* lib, configure.ac: initial LTTng supportQuentin Young2020-10-231-0/+50
This commit adds initial support for LTTng. When --enable-lttng=no or is not specified, no tracing code is included. When --enable-lttng=yes, LTTng tracing events are (will be) generated. configure.ac: - add --enable-lttng - define HAVE_LTTNG when enabled - minimum LTTng version: 2.12.0 lib: - add trace.[ch] - update subdir.am Signed-off-by: Quentin Young <qlyoung@nvidia.com>