summaryrefslogtreecommitdiffstats
path: root/lib/table.c
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@nvidia.com>2020-09-18 21:14:09 +0200
committerQuentin Young <qlyoung@nvidia.com>2020-10-23 21:13:51 +0200
commita72255a336c68dcc62d7bd9fcc1d409ee766cf77 (patch)
treee9b45dc7bece4b9a21e33ac15154bd9b748ed495 /lib/table.c
parentlib: add tracepoints for *malloc, list ops (diff)
downloadfrr-a72255a336c68dcc62d7bd9fcc1d409ee766cf77.tar.xz
frr-a72255a336c68dcc62d7bd9fcc1d409ee766cf77.zip
lib: add tracepoint for route table get
Signed-off-by: Quentin Young <qlyoung@nvidia.com>
Diffstat (limited to 'lib/table.c')
-rw-r--r--lib/table.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/table.c b/lib/table.c
index b315637f1..0d1be2bef 100644
--- a/lib/table.c
+++ b/lib/table.c
@@ -27,6 +27,7 @@
#include "table.h"
#include "memory.h"
#include "sockunion.h"
+#include "trace.h"
DEFINE_MTYPE_STATIC(LIB, ROUTE_TABLE, "Route table")
DEFINE_MTYPE(LIB, ROUTE_NODE, "Route node")
@@ -276,6 +277,12 @@ struct route_node *route_node_lookup_maynull(struct route_table *table,
struct route_node *route_node_get(struct route_table *table,
union prefixconstptr pu)
{
+ if (tracepoint_enabled(frr_libfrr, route_node_get)) {
+ char buf[PREFIX2STR_BUFFER];
+ prefix2str(pu, buf, sizeof(buf));
+ tracepoint(frr_libfrr, route_node_get, table, buf);
+ }
+
struct route_node search;
struct prefix *p = &search.p;