Changeset View
Changeset View
Standalone View
Standalone View
sys/net/route/route_debug.h
Show First 20 Lines • Show All 77 Lines • ▼ Show 20 Lines | |||||
* LOG_DEBUG3 - last debug level. Per-item large debug outputs. | * LOG_DEBUG3 - last debug level. Per-item large debug outputs. | ||||
* This is NOT compiled in by default. All performance bets are off. | * This is NOT compiled in by default. All performance bets are off. | ||||
* | * | ||||
*/ | */ | ||||
#define _output printf | #define _output printf | ||||
#define _DEBUG_PASS_MSG(_l) (DEBUG_VAR_NAME >= (_l)) | #define _DEBUG_PASS_MSG(_l) (DEBUG_VAR_NAME >= (_l)) | ||||
#define IF_DEBUG_LEVEL(_l) if ((DEBUG_MAX_LEVEL >= (_l)) && (__predict_false(DEBUG_VAR_NAME >= (_l)))) | |||||
/* | /* | ||||
* Logging for events specific for particular family and fib | * Logging for events specific for particular family and fib | ||||
* Example: [nhop_neigh] inet.0 find_lle: nhop nh#4/inet/vtnet0/10.0.0.1: mapped to lle NULL | * Example: [nhop_neigh] inet.0 find_lle: nhop nh#4/inet/vtnet0/10.0.0.1: mapped to lle NULL | ||||
*/ | */ | ||||
#define FIB_LOG(_l, _fib, _fam, _fmt, ...) FIB_LOG_##_l(_l, _fib, _fam, _fmt, ## __VA_ARGS__) | #define FIB_LOG(_l, _fib, _fam, _fmt, ...) FIB_LOG_##_l(_l, _fib, _fam, _fmt, ## __VA_ARGS__) | ||||
#define _FIB_LOG(_l, _fib, _fam, _fmt, ...) if (_DEBUG_PASS_MSG(_l)) { \ | #define _FIB_LOG(_l, _fib, _fam, _fmt, ...) if (_DEBUG_PASS_MSG(_l)) { \ | ||||
_output("[" DEBUG_PREFIX_NAME "] %s.%u %s: " _fmt "\n", rib_print_family(_fam), _fib, __func__, ##__VA_ARGS__); \ | _output("[" DEBUG_PREFIX_NAME "] %s.%u %s: " _fmt "\n", rib_print_family(_fam), _fib, __func__, ##__VA_ARGS__); \ | ||||
} | } | ||||
▲ Show 20 Lines • Show All 56 Lines • ▼ Show 20 Lines | |||||
#endif | #endif | ||||
/* Helpers for fancy-printing various objects */ | /* Helpers for fancy-printing various objects */ | ||||
struct nhop_object; | struct nhop_object; | ||||
struct nhgrp_object; | struct nhgrp_object; | ||||
struct llentry; | struct llentry; | ||||
struct nhop_neigh; | struct nhop_neigh; | ||||
struct rtentry; | struct rtentry; | ||||
struct ifnet; | |||||
#define NHOP_PRINT_BUFSIZE 48 | #define NHOP_PRINT_BUFSIZE 48 | ||||
char *nhop_print_buf(const struct nhop_object *nh, char *buf, size_t bufsize); | char *nhop_print_buf(const struct nhop_object *nh, char *buf, size_t bufsize); | ||||
char *nhop_print_buf_any(const struct nhop_object *nh, char *buf, size_t bufsize); | char *nhop_print_buf_any(const struct nhop_object *nh, char *buf, size_t bufsize); | ||||
char *nhgrp_print_buf(const struct nhgrp_object *nhg, char *buf, size_t bufsize); | char *nhgrp_print_buf(const struct nhgrp_object *nhg, char *buf, size_t bufsize); | ||||
char *llentry_print_buf(const struct llentry *lle, struct ifnet *ifp, int family, char *buf, | char *llentry_print_buf(const struct llentry *lle, struct ifnet *ifp, int family, char *buf, | ||||
size_t bufsize); | size_t bufsize); | ||||
char *llentry_print_buf_lltable(const struct llentry *lle, char *buf, size_t bufsize); | char *llentry_print_buf_lltable(const struct llentry *lle, char *buf, size_t bufsize); | ||||
char *neigh_print_buf(const struct nhop_neigh *nn, char *buf, size_t bufsize); | char *neigh_print_buf(const struct nhop_neigh *nn, char *buf, size_t bufsize); | ||||
char *rt_print_buf(const struct rtentry *rt, char *buf, size_t bufsize); | char *rt_print_buf(const struct rtentry *rt, char *buf, size_t bufsize); | ||||
const char *rib_print_cmd(int rib_cmd); | const char *rib_print_cmd(int rib_cmd); | ||||
#endif | #endif |