123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- int batadv_debug_log_setup(struct batadv_priv *bat_priv);
- void batadv_debug_log_cleanup(struct batadv_priv *bat_priv);
- static inline int batadv_debug_log_setup(struct batadv_priv *bat_priv)
- {
- return 0;
- }
- static inline void batadv_debug_log_cleanup(struct batadv_priv *bat_priv)
- {
- }
- enum batadv_dbg_level {
- BATADV_DBG_BATMAN = BIT(0),
- BATADV_DBG_ROUTES = BIT(1),
- BATADV_DBG_TT = BIT(2),
- BATADV_DBG_BLA = BIT(3),
- BATADV_DBG_DAT = BIT(4),
- BATADV_DBG_NC = BIT(5),
- BATADV_DBG_MCAST = BIT(6),
- BATADV_DBG_TP_METER = BIT(7),
- BATADV_DBG_ALL = 255,
- };
- int batadv_debug_log(struct batadv_priv *bat_priv, const char *fmt, ...)
- __printf(2, 3);
- do { \
- if (atomic_read(&bat_priv->log_level) & type && \
- (!ratelimited || net_ratelimit())) \
- batadv_debug_log(bat_priv, fmt,
- } \
- while (0)
- __printf(4, 5)
- static inline void _batadv_dbg(int type __always_unused,
- struct batadv_priv *bat_priv __always_unused,
- int ratelimited __always_unused,
- const char *fmt __always_unused, ...)
- {
- }
- _batadv_dbg(type, bat_priv, 0,
- _batadv_dbg(type, bat_priv, 1,
- do { \
- struct net_device *_netdev = (net_dev)
- struct batadv_priv *_batpriv = netdev_priv(_netdev)
- batadv_dbg(BATADV_DBG_ALL, _batpriv, fmt,
- pr_info("%s: " fmt, _netdev->name,
- } while (0)
- do { \
- struct net_device *_netdev = (net_dev)
- struct batadv_priv *_batpriv = netdev_priv(_netdev)
- batadv_dbg(BATADV_DBG_ALL, _batpriv, fmt,
- pr_err("%s: " fmt, _netdev->name,
- } while (0)
|