forked from Mirror/frr
lib: add tracepoint for route table get
Signed-off-by: Quentin Young <qlyoung@nvidia.com>
This commit is contained in:
parent
d92658f4f7
commit
a72255a336
|
@ -27,6 +27,7 @@
|
||||||
#include "table.h"
|
#include "table.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
#include "sockunion.h"
|
#include "sockunion.h"
|
||||||
|
#include "trace.h"
|
||||||
|
|
||||||
DEFINE_MTYPE_STATIC(LIB, ROUTE_TABLE, "Route table")
|
DEFINE_MTYPE_STATIC(LIB, ROUTE_TABLE, "Route table")
|
||||||
DEFINE_MTYPE(LIB, ROUTE_NODE, "Route node")
|
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,
|
struct route_node *route_node_get(struct route_table *table,
|
||||||
union prefixconstptr pu)
|
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 route_node search;
|
||||||
struct prefix *p = &search.p;
|
struct prefix *p = &search.p;
|
||||||
|
|
||||||
|
|
13
lib/trace.h
13
lib/trace.h
|
@ -39,6 +39,7 @@
|
||||||
#include "thread.h"
|
#include "thread.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
#include "linklist.h"
|
#include "linklist.h"
|
||||||
|
#include "table.h"
|
||||||
|
|
||||||
/* clang-format off */
|
/* clang-format off */
|
||||||
|
|
||||||
|
@ -219,6 +220,18 @@ TRACEPOINT_EVENT(
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
TRACEPOINT_EVENT(
|
||||||
|
frr_libfrr,
|
||||||
|
route_node_get,
|
||||||
|
TP_ARGS(
|
||||||
|
struct route_table *, table, char *, prefix
|
||||||
|
),
|
||||||
|
TP_FIELDS(
|
||||||
|
ctf_integer_hex(intptr_t, table, table)
|
||||||
|
ctf_string(prefix, prefix)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
/* clang-format on */
|
/* clang-format on */
|
||||||
|
|
||||||
#include <lttng/tracepoint-event.h>
|
#include <lttng/tracepoint-event.h>
|
||||||
|
|
Loading…
Reference in a new issue