summaryrefslogtreecommitdiff
path: root/lib/trace.h
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@nvidia.com>2020-09-16 19:29:32 -0400
committerQuentin Young <qlyoung@nvidia.com>2020-10-23 15:13:51 -0400
commit67a485d18f4074dbdd8378279b400137283c3aa5 (patch)
treee619a7bd9ab7379744bf58b11473d7b96e0f3ad6 /lib/trace.h
parent6401252f7fe68123c6dc122958649dfd384c98e6 (diff)
lib: add tracepoint for hash insertion
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>
Diffstat (limited to 'lib/trace.h')
-rw-r--r--lib/trace.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/trace.h b/lib/trace.h
index e6d0f115e4..753a25f4a5 100644
--- a/lib/trace.h
+++ b/lib/trace.h
@@ -56,6 +56,21 @@ TRACEPOINT_LOGLEVEL(frr_libfrr, hash_get, TRACE_INFO)
TRACEPOINT_EVENT(
frr_libfrr,
+ hash_insert,
+ TP_ARGS(struct hash *, hash, void *, data, unsigned int, key),
+ TP_FIELDS(
+ ctf_string(name, hash->name ? hash->name : "(unnamed)")
+ ctf_integer(unsigned int, key, hash->size)
+ ctf_integer(unsigned int, index_size, hash->size)
+ ctf_integer(unsigned long, item_count, hash->count)
+ ctf_integer_hex(intptr_t, data_ptr, data)
+ )
+)
+
+TRACEPOINT_LOGLEVEL(frr_libfrr, hash_insert, TRACE_INFO)
+
+TRACEPOINT_EVENT(
+ frr_libfrr,
hash_release,
TP_ARGS(struct hash *, hash, void *, data, void *, released_item),
TP_FIELDS(