From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ v1] monitor: Print unacked frame when releasing them
Date: Thu, 14 Aug 2025 11:41:56 -0400 [thread overview]
Message-ID: <20250814154156.8221-1-luiz.dentz@gmail.com> (raw)
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This attempts to print the frame number of frames considered unacked
(missing NOCP):
> HCI Event: Disconnect Complete (0x05) plen 4
Status: Success (0x00)
Handle: 2304 Address: XX:XX:XX:XX:XX:XX
Reason: Connection Terminated By Local Host (0x16)
[0]#102132 unacked
[1]#102137 unacked
[2]#102139 unacked
[3]#102141 unacked
[4]#102143 unacked
[5]#102145 unacked
[6]#102147 unacked
[7]#102150 unacked
---
monitor/packet.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/monitor/packet.c b/monitor/packet.c
index d259bf9e9a25..ca7eaea21138 100644
--- a/monitor/packet.c
+++ b/monitor/packet.c
@@ -240,6 +240,14 @@ static struct index_buf_pool *get_pool(uint16_t index, uint8_t type)
return NULL;
}
+static void print_unacked_frame(void *data, void *user_data)
+{
+ struct packet_frame *frame = data;
+ int *i = user_data;
+
+ print_field("[%d]#%zu unacked", (*i)++, frame->num);
+}
+
static struct packet_conn_data *release_handle(uint16_t handle)
{
int i;
@@ -254,8 +262,13 @@ static struct packet_conn_data *release_handle(uint16_t handle)
conn->destroy(conn, conn->data);
pool = get_pool(conn->index, conn->type);
- if (pool)
+ if (pool) {
+ int i = 0;
+
+ queue_foreach(conn->tx_q, print_unacked_frame,
+ &i);
pool->tx -= queue_length(conn->tx_q);
+ }
queue_destroy(conn->tx_q, free);
queue_destroy(conn->chan_q, free);
--
2.50.1
next reply other threads:[~2025-08-14 15:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-14 15:41 Luiz Augusto von Dentz [this message]
2025-08-14 17:10 ` [BlueZ,v1] monitor: Print unacked frame when releasing them bluez.test.bot
2025-08-14 17:20 ` [PATCH BlueZ v1] " 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=20250814154156.8221-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.