Skip to content

Commit 9eb1433

Browse files
committed
Bluetooth: Add function and line information to bt_dbg
When enabling debug via CONFIG_BT_FEATURE_DEBUG include function and line information by default otherwise it is hard to make any sense of which function the logs comes from. Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
1 parent 79e562a commit 9eb1433

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

include/net/bluetooth/bluetooth.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,8 @@ void bt_err_ratelimited(const char *fmt, ...);
272272
#define BT_ERR(fmt, ...) bt_err(fmt "\n", ##__VA_ARGS__)
273273

274274
#if IS_ENABLED(CONFIG_BT_FEATURE_DEBUG)
275-
#define BT_DBG(fmt, ...) bt_dbg(fmt "\n", ##__VA_ARGS__)
275+
#define BT_DBG(fmt, ...) \
276+
bt_dbg("%s:%d: " fmt "\n", __func__, __LINE__, ##__VA_ARGS__)
276277
#else
277278
#define BT_DBG(fmt, ...) pr_debug(fmt "\n", ##__VA_ARGS__)
278279
#endif

0 commit comments

Comments
 (0)