From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [RFC BlueZ] adapter: Introduce BTD_ADAPTER_DBG
Date: Wed, 23 Mar 2022 13:52:27 -0700 [thread overview]
Message-ID: <20220323205227.3605495-1-luiz.dentz@gmail.com> (raw)
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This introduces BTD_ADAPTER_DBG which includes the controller index
when using DBG_IDX, in addition to it also add similar macro for
devices in the form of BTD_DEVICE_DBG which resolves the adapter and
before calling BTD_ADAPTER_DBG.
---
src/adapter.h | 4 ++++
src/device.h | 4 ++++
2 files changed, 8 insertions(+)
diff --git a/src/adapter.h b/src/adapter.h
index 35deb1d11..515be3210 100644
--- a/src/adapter.h
+++ b/src/adapter.h
@@ -23,6 +23,10 @@
/* Invalid SSP passkey value used to indicate negative replies */
#define INVALID_PASSKEY 0xffffffff
+#define BTD_ADAPTER_DBG(adapter, fmt, arg...) \
+ DBG_IDX(btd_adapter_get_index(adapter), "%s:%s() " fmt, __FILE__, \
+ __func__ , ## arg)
+
struct btd_adapter;
struct btd_device;
struct queue;
diff --git a/src/device.h b/src/device.h
index 071576d6b..4d40d1d22 100644
--- a/src/device.h
+++ b/src/device.h
@@ -11,6 +11,10 @@
#define DEVICE_INTERFACE "org.bluez.Device1"
+#define BTD_DEVICE_DBG(device, fmt, arg...) \
+ BTD_ADAPTER_DBG(device_get_adapter(device), "%s:%s() " fmt, __FILE__, \
+ __func__ , ## arg)
+
struct btd_device;
struct btd_device *device_create(struct btd_adapter *adapter,
--
2.35.1
next reply other threads:[~2022-03-23 20:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-23 20:52 Luiz Augusto von Dentz [this message]
2022-03-23 22:31 ` [RFC,BlueZ] adapter: Introduce BTD_ADAPTER_DBG bluez.test.bot
-- strict thread matches above, loose matches on Subject: below --
2022-03-23 22:39 [RFC BlueZ] " Luiz Augusto von Dentz
2022-03-24 2:49 ` [RFC,BlueZ] " bluez.test.bot
2022-03-24 19:50 ` [RFC BlueZ] " patchwork-bot+bluetooth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220323205227.3605495-1-luiz.dentz@gmail.com \
--to=luiz.dentz@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox