Skip to contentSkip to conversation

Bluetooth: Add function name to debug prints

PATCH In review Jukka Rissanen 2 participants 2 messages Oct 22, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Bluetooth: Add function name to debug prints

---
Hi,

the debug prints are quite useless without the function name. Without this patch one sees lot of "hci0" lines which is not very helpful.

Cheers,
Jukka

 include/net/bluetooth/bluetooth.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/net/bluetooth/bluetooth.h +1 -1
index bf2ddff..0b1eacd 100644
@@ -122,7 +122,7 @@ int bt_err(const char *fmt, ...);
 
 #define BT_INFO(fmt, ...)	bt_info(fmt "\n", ##__VA_ARGS__)
 #define BT_ERR(fmt, ...)	bt_err(fmt "\n", ##__VA_ARGS__)
-#define BT_DBG(fmt, ...)	pr_debug(fmt "\n", ##__VA_ARGS__)
+#define BT_DBG(fmt, ...)	pr_debug("%s():" fmt "\n", __FUNCTION__, ##__VA_ARGS__)
 
 /* Connection and socket states */
 enum {
Signature · 1 line
1.7.11.7
#1 lore raw

Hi Jukka,

Quoted 15 lines · Jukka Rissanen

the debug prints are quite useless without the function name. Without this patch one sees lot of "hci0" lines which is not very helpful.

Cheers,
Jukka

 include/net/bluetooth/bluetooth.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/net/bluetooth/bluetooth.h +0 -0
index bf2ddff..0b1eacd 100644

include/net/bluetooth/bluetooth.h int bt_err(const char *fmt, ...); · line 125

Quoted 5 lines
include/net/bluetooth/bluetooth.h +1 -1
@@ -122,7 +122,7 @@ int bt_err(const char *fmt, ...);
 
 #define BT_INFO(fmt, ...)	bt_info(fmt "\n", ##__VA_ARGS__)
 #define BT_ERR(fmt, ...)	bt_err(fmt "\n", ##__VA_ARGS__)
-#define BT_DBG(fmt, ...)	pr_debug(fmt "\n", ##__VA_ARGS__)
+#define BT_DBG(fmt, ...)	pr_debug("%s():" fmt "\n", __FUNCTION__, ##__VA_ARGS__)

This shouldn't be necessary since you can ask the function name to be printed using standard dynamic debug control syntax, e.g:

echo "file hci_event.c +pf" > /sys/kernel/debug/dynamic_debug/control

Johan