Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Bluetooth: Provide option to enable/disable debugfs information

The Bluetooth controllers can export extensive information about
internal states via debugfs. This patch provides an option to
choose if these information are provided or not.

For backwards compatibility with existing kernel configuration,
this option defaults to yes.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>

authored by

Marcel Holtmann and committed by
Johan Hedberg
035a07d5 18835dfa

+32 -1
+8
net/bluetooth/Kconfig
··· 91 91 Run test cases for SMP cryptographic functionality, including both 92 92 legacy SMP as well as the Secure Connections features. 93 93 94 + config BT_DEBUGFS 95 + bool "Export Bluetooth internals in debugfs" 96 + depends on BT && DEBUG_FS 97 + default y 98 + help 99 + Provide extensive information about internal Bluetooth states 100 + in debugfs. 101 + 94 102 source "drivers/bluetooth/Kconfig"
+2 -1
net/bluetooth/Makefile
··· 13 13 14 14 bluetooth-y := af_bluetooth.o hci_core.o hci_conn.o hci_event.o mgmt.o \ 15 15 hci_sock.o hci_sysfs.o l2cap_core.o l2cap_sock.o smp.o sco.o lib.o \ 16 - a2mp.o amp.o ecc.o hci_request.o hci_debugfs.o 16 + a2mp.o amp.o ecc.o hci_request.o 17 17 18 + bluetooth-$(CONFIG_BT_DEBUGFS) += hci_debugfs.o 18 19 bluetooth-$(CONFIG_BT_SELFTEST) += selftest.o 19 20 20 21 subdir-ccflags-y += -D__CHECK_ENDIAN__
+22
net/bluetooth/hci_debugfs.h
··· 20 20 SOFTWARE IS DISCLAIMED. 21 21 */ 22 22 23 + #if IS_ENABLED(CONFIG_BT_DEBUGFS) 24 + 23 25 void hci_debugfs_create_common(struct hci_dev *hdev); 24 26 void hci_debugfs_create_bredr(struct hci_dev *hdev); 25 27 void hci_debugfs_create_le(struct hci_dev *hdev); 26 28 void hci_debugfs_create_conn(struct hci_conn *conn); 29 + 30 + #else 31 + 32 + static inline void hci_debugfs_create_common(struct hci_dev *hdev) 33 + { 34 + } 35 + 36 + static inline void hci_debugfs_create_bredr(struct hci_dev *hdev) 37 + { 38 + } 39 + 40 + static inline void hci_debugfs_create_le(struct hci_dev *hdev) 41 + { 42 + } 43 + 44 + static inline void hci_debugfs_create_conn(struct hci_conn *conn) 45 + { 46 + } 47 + 48 + #endif