diff options
| author | Quentin Young <qlyoung@qlyoung.net> | 2021-02-11 19:21:30 -0500 | 
|---|---|---|
| committer | Quentin Young <qlyoung@qlyoung.net> | 2021-02-11 19:55:05 -0500 | 
| commit | e0302d7eab76d7f86a8b8584ef2928c431a932bb (patch) | |
| tree | ec817ffa480c1f123132cd872ad1ce1ec5a3d9d5 /bgpd/bgp_bmp.c | |
| parent | 169afe9dfcbf378d8fd9b3c16217a0e025297135 (diff) | |
bgpd: add tracepoints for BMP
Adds the following tracepoints:
- frr_bgp:bmp_mirror_packet
- frr_bgp:bmp_update_saved_open
- frr_bgp:bmp_status_changed
- frr_bgp:bmp_peer_backward_transition
- frr_bgp:bmp_eor
- frr_bgp:bmp_process
Signed-off-by: Quentin Young <qlyoung@qlyoung.net>
Diffstat (limited to 'bgpd/bgp_bmp.c')
| -rw-r--r-- | bgpd/bgp_bmp.c | 19 | 
1 files changed, 19 insertions, 0 deletions
diff --git a/bgpd/bgp_bmp.c b/bgpd/bgp_bmp.c index 82e27884cf..8deec65426 100644 --- a/bgpd/bgp_bmp.c +++ b/bgpd/bgp_bmp.c @@ -49,6 +49,7 @@  #include "bgpd/bgp_fsm.h"  #include "bgpd/bgp_updgrp.h"  #include "bgpd/bgp_vty.h" +#include "bgpd/bgp_trace.h"  static void bmp_close(struct bmp *bmp);  static struct bmp_bgp *bmp_bgp_find(struct bgp *bgp); @@ -545,6 +546,8 @@ static int bmp_mirror_packet(struct peer *peer, uint8_t type, bgp_size_t size,  	struct bmp_targets *bt;  	struct bmp *bmp; +	frrtrace(3, frr_bgp, bmp_mirror_packet, peer, type, packet); +  	gettimeofday(&tv, NULL);  	if (type == BGP_MSG_OPEN) { @@ -662,6 +665,8 @@ static int bmp_outgoing_packet(struct peer *peer, uint8_t type, bgp_size_t size,  		struct stream *packet)  {  	if (type == BGP_MSG_OPEN) { +		frrtrace(2, frr_bgp, bmp_update_saved_open, peer, packet); +  		struct bmp_bgp_peer *bbpeer = bmp_bgp_peer_get(peer);  		XFREE(MTYPE_BMP_OPEN, bbpeer->open_tx); @@ -677,6 +682,8 @@ static int bmp_peer_established(struct peer *peer)  {  	struct bmp_bgp *bmpbgp = bmp_bgp_find(peer->bgp); +	frrtrace(1, frr_bgp, bmp_peer_status_changed, peer); +  	if (!bmpbgp)  		return 0; @@ -712,6 +719,8 @@ static int bmp_peer_backward(struct peer *peer)  	struct bmp_bgp *bmpbgp = bmp_bgp_find(peer->bgp);  	struct bmp_bgp_peer *bbpeer; +	frrtrace(1, frr_bgp, bmp_peer_backward_transition, peer); +  	if (!bmpbgp)  		return 0; @@ -735,6 +744,8 @@ static void bmp_eor(struct bmp *bmp, afi_t afi, safi_t safi, uint8_t flags)  	iana_afi_t pkt_afi;  	iana_safi_t pkt_safi; +	frrtrace(3, frr_bgp, bmp_eor, afi, safi, flags); +  	s = stream_new(BGP_MAX_PACKET_SIZE);  	/* Make BGP update packet. */ @@ -1251,6 +1262,14 @@ static int bmp_process(struct bgp *bgp, afi_t afi, safi_t safi,  	struct bmp_targets *bt;  	struct bmp *bmp; +	if (frrtrace_enabled(frr_bgp, bmp_process)) { +		char pfxprint[PREFIX2STR_BUFFER]; + +		prefix2str(&bn->p, pfxprint, sizeof(pfxprint)); +		frrtrace(5, frr_bgp, bmp_process, peer, pfxprint, afi, safi, +			 withdraw); +	} +  	if (!bmpbgp)  		return 0;  | 
