mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-14 14:17:20 +00:00
bgpd: rfapi was not using internal zlog_backtrace()
The rfapi code was not using the zlog_backtrace() functionality. Let's just convert over to using the proper functionality that we have built in now. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
parent
78690deaf2
commit
a57379fa14
@ -46,11 +46,6 @@
|
|||||||
#include "bgpd/rfapi/rfapi_encap_tlv.h"
|
#include "bgpd/rfapi/rfapi_encap_tlv.h"
|
||||||
#include "bgpd/rfapi/vnc_debug.h"
|
#include "bgpd/rfapi/vnc_debug.h"
|
||||||
|
|
||||||
#ifdef HAVE_GLIBC_BACKTRACE
|
|
||||||
/* for backtrace and friends */
|
|
||||||
#include <execinfo.h>
|
|
||||||
#endif /* HAVE_GLIBC_BACKTRACE */
|
|
||||||
|
|
||||||
#define DEBUG_CLEANUP 0
|
#define DEBUG_CLEANUP 0
|
||||||
|
|
||||||
struct ethaddr rfapi_ethaddr0 = {{0}};
|
struct ethaddr rfapi_ethaddr0 = {{0}};
|
||||||
@ -2091,24 +2086,7 @@ int rfapi_close(void *handle)
|
|||||||
vnc_zlog_debug_verbose("%s: rfd=%p", __func__, rfd);
|
vnc_zlog_debug_verbose("%s: rfd=%p", __func__, rfd);
|
||||||
|
|
||||||
#ifdef RFAPI_WHO_IS_CALLING_ME
|
#ifdef RFAPI_WHO_IS_CALLING_ME
|
||||||
#ifdef HAVE_GLIBC_BACKTRACE
|
zlog_backtrace(LOG_INFO);
|
||||||
#define RFAPI_DEBUG_BACKTRACE_NENTRIES 5
|
|
||||||
{
|
|
||||||
void *buf[RFAPI_DEBUG_BACKTRACE_NENTRIES];
|
|
||||||
char **syms;
|
|
||||||
int i;
|
|
||||||
size_t size;
|
|
||||||
|
|
||||||
size = backtrace(buf, RFAPI_DEBUG_BACKTRACE_NENTRIES);
|
|
||||||
syms = backtrace_symbols(buf, size);
|
|
||||||
for (i = 0; i < size && i < RFAPI_DEBUG_BACKTRACE_NENTRIES;
|
|
||||||
++i) {
|
|
||||||
vnc_zlog_debug_verbose("backtrace[%2d]: %s", i,
|
|
||||||
syms[i]);
|
|
||||||
}
|
|
||||||
free(syms);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bgp = rfd->bgp;
|
bgp = rfd->bgp;
|
||||||
|
@ -44,11 +44,6 @@
|
|||||||
#include "bgpd/rfapi/rfapi_encap_tlv.h"
|
#include "bgpd/rfapi/rfapi_encap_tlv.h"
|
||||||
#include "bgpd/rfapi/vnc_debug.h"
|
#include "bgpd/rfapi/vnc_debug.h"
|
||||||
|
|
||||||
#ifdef HAVE_GLIBC_BACKTRACE
|
|
||||||
/* for backtrace and friends */
|
|
||||||
#include <execinfo.h>
|
|
||||||
#endif /* HAVE_GLIBC_BACKTRACE */
|
|
||||||
|
|
||||||
#undef DEBUG_MONITOR_MOVE_SHORTER
|
#undef DEBUG_MONITOR_MOVE_SHORTER
|
||||||
#undef DEBUG_RETURNED_NHL
|
#undef DEBUG_RETURNED_NHL
|
||||||
#undef DEBUG_ROUTE_COUNTERS
|
#undef DEBUG_ROUTE_COUNTERS
|
||||||
@ -77,32 +72,6 @@ struct rfapi_withdraw {
|
|||||||
int lockoffset;
|
int lockoffset;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
|
||||||
* DEBUG FUNCTION
|
|
||||||
* It's evil and fiendish. It's compiler-dependent.
|
|
||||||
* ? Might need LDFLAGS -rdynamic to produce all function names
|
|
||||||
*/
|
|
||||||
void rfapiDebugBacktrace(void)
|
|
||||||
{
|
|
||||||
#ifdef HAVE_GLIBC_BACKTRACE
|
|
||||||
#define RFAPI_DEBUG_BACKTRACE_NENTRIES 200
|
|
||||||
void *buf[RFAPI_DEBUG_BACKTRACE_NENTRIES];
|
|
||||||
char **syms;
|
|
||||||
size_t i;
|
|
||||||
size_t size;
|
|
||||||
|
|
||||||
size = backtrace(buf, RFAPI_DEBUG_BACKTRACE_NENTRIES);
|
|
||||||
syms = backtrace_symbols(buf, size);
|
|
||||||
|
|
||||||
for (i = 0; i < size && i < RFAPI_DEBUG_BACKTRACE_NENTRIES; ++i) {
|
|
||||||
vnc_zlog_debug_verbose("backtrace[%2zu]: %s", i, syms[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
free(syms);
|
|
||||||
#else
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* DEBUG FUNCTION
|
* DEBUG FUNCTION
|
||||||
* Count remote routes and compare with actively-maintained values.
|
* Count remote routes and compare with actively-maintained values.
|
||||||
@ -1709,7 +1678,7 @@ struct rfapi_next_hop_entry *rfapiRouteNode2NextHopList(
|
|||||||
|
|
||||||
#ifdef DEBUG_RETURNED_NHL
|
#ifdef DEBUG_RETURNED_NHL
|
||||||
vnc_zlog_debug_verbose("%s: called with node pfx=%rRN", __func__, rn);
|
vnc_zlog_debug_verbose("%s: called with node pfx=%rRN", __func__, rn);
|
||||||
rfapiDebugBacktrace();
|
zlog_backtrace(LOG_INFO);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
rfapiQprefix2Rprefix(p, &rprefix);
|
rfapiQprefix2Rprefix(p, &rprefix);
|
||||||
|
@ -57,8 +57,6 @@ struct rfapi_import_table {
|
|||||||
|
|
||||||
extern uint8_t rfapiRfpCost(struct attr *attr);
|
extern uint8_t rfapiRfpCost(struct attr *attr);
|
||||||
|
|
||||||
extern void rfapiDebugBacktrace(void);
|
|
||||||
|
|
||||||
extern void rfapiCheckRouteCount(void);
|
extern void rfapiCheckRouteCount(void);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user