瀏覽代碼

Bluetooth: debug: Print refcnt for hci_dev

Add debug output for HCI kref.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Andrei Emeltchenko 13 年之前
父節點
當前提交
376261ae36
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      include/net/bluetooth/hci_core.h

+ 6 - 0
include/net/bluetooth/hci_core.h

@@ -603,11 +603,17 @@ static inline void hci_conn_put(struct hci_conn *conn)
 /* ----- HCI Devices ----- */
 /* ----- HCI Devices ----- */
 static inline void hci_dev_put(struct hci_dev *d)
 static inline void hci_dev_put(struct hci_dev *d)
 {
 {
+	BT_DBG("%s orig refcnt %d", d->name,
+	       atomic_read(&d->dev.kobj.kref.refcount));
+
 	put_device(&d->dev);
 	put_device(&d->dev);
 }
 }
 
 
 static inline struct hci_dev *hci_dev_hold(struct hci_dev *d)
 static inline struct hci_dev *hci_dev_hold(struct hci_dev *d)
 {
 {
+	BT_DBG("%s orig refcnt %d", d->name,
+	       atomic_read(&d->dev.kobj.kref.refcount));
+
 	get_device(&d->dev);
 	get_device(&d->dev);
 	return d;
 	return d;
 }
 }