summaryrefslogtreecommitdiffstats
path: root/lib/linklist.c
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@nvidia.com>2020-09-17 20:57:36 +0200
committerQuentin Young <qlyoung@nvidia.com>2020-10-23 21:13:51 +0200
commitd92658f4f7511c1b2c47a063df51ad3190db7af3 (patch)
treeb86a84ad403d9f35a681d80fb5ac0f5b4bfa2897 /lib/linklist.c
parentlib: add tracepoint for hash insertion (diff)
downloadfrr-d92658f4f7511c1b2c47a063df51ad3190db7af3.tar.xz
frr-d92658f4f7511c1b2c47a063df51ad3190db7af3.zip
lib: add tracepoints for *malloc, list ops
- Add tracepoints for FRR malloc and free - Add tracepoints for basic list operations Signed-off-by: Quentin Young <qlyoung@nvidia.com>
Diffstat (limited to 'lib/linklist.c')
-rw-r--r--lib/linklist.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/linklist.c b/lib/linklist.c
index 84dc6e141..19a8514cd 100644
--- a/lib/linklist.c
+++ b/lib/linklist.c
@@ -23,6 +23,7 @@
#include "linklist.h"
#include "memory.h"
+#include "trace.h"
DEFINE_MTYPE_STATIC(LIB, LINK_LIST, "Link List")
DEFINE_MTYPE_STATIC(LIB, LINK_NODE, "Link Node")
@@ -66,6 +67,8 @@ static void listnode_free(struct list *list, struct listnode *node)
struct listnode *listnode_add(struct list *list, void *val)
{
+ tracepoint(frr_libfrr, list_add, list, val);
+
struct listnode *node;
assert(val != NULL);
@@ -281,6 +284,8 @@ void listnode_move_to_tail(struct list *l, struct listnode *n)
void listnode_delete(struct list *list, const void *val)
{
+ tracepoint(frr_libfrr, list_remove, list, val);
+
struct listnode *node = listnode_lookup(list, val);
if (node)
@@ -360,6 +365,8 @@ struct listnode *listnode_lookup_nocheck(struct list *list, void *data)
void list_delete_node(struct list *list, struct listnode *node)
{
+ tracepoint(frr_libfrr, list_delete_node, list, node);
+
if (node->prev)
node->prev->next = node->next;
else
@@ -374,6 +381,8 @@ void list_delete_node(struct list *list, struct listnode *node)
void list_sort(struct list *list, int (*cmp)(const void **, const void **))
{
+ tracepoint(frr_libfrr, list_sort, list);
+
struct listnode *ln, *nn;
int i = -1;
void *data;