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:
Donald Sharp 2024-01-04 14:18:16 -05:00
parent 78690deaf2
commit a57379fa14
3 changed files with 2 additions and 57 deletions

View File

@ -46,11 +46,6 @@
#include "bgpd/rfapi/rfapi_encap_tlv.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
struct ethaddr rfapi_ethaddr0 = {{0}};
@ -2091,24 +2086,7 @@ int rfapi_close(void *handle)
vnc_zlog_debug_verbose("%s: rfd=%p", __func__, rfd);
#ifdef RFAPI_WHO_IS_CALLING_ME
#ifdef HAVE_GLIBC_BACKTRACE
#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
zlog_backtrace(LOG_INFO);
#endif
bgp = rfd->bgp;

View File

@ -44,11 +44,6 @@
#include "bgpd/rfapi/rfapi_encap_tlv.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_RETURNED_NHL
#undef DEBUG_ROUTE_COUNTERS
@ -77,32 +72,6 @@ struct rfapi_withdraw {
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
* Count remote routes and compare with actively-maintained values.
@ -1709,7 +1678,7 @@ struct rfapi_next_hop_entry *rfapiRouteNode2NextHopList(
#ifdef DEBUG_RETURNED_NHL
vnc_zlog_debug_verbose("%s: called with node pfx=%rRN", __func__, rn);
rfapiDebugBacktrace();
zlog_backtrace(LOG_INFO);
#endif
rfapiQprefix2Rprefix(p, &rprefix);

View File

@ -57,8 +57,6 @@ struct rfapi_import_table {
extern uint8_t rfapiRfpCost(struct attr *attr);
extern void rfapiDebugBacktrace(void);
extern void rfapiCheckRouteCount(void);
/*