Linux bluetooth development
 help / color / mirror / Atom feed
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ v2 1/9] monitor/analyze: Free the channel latency plots
Date: Fri, 18 Sep 2026 12:14:00 -0400	[thread overview]
Message-ID: <20260918161408.2464981-2-luiz.dentz@gmail.com> (raw)
In-Reply-To: <20260918161408.2464981-1-luiz.dentz@gmail.com>

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

A channel keeps a plot of its latencies for as long as it exists, but
destroying one frees only the channel itself, leaking both plots and
everything queued on them. A connection already frees its own.

Assisted-by: opencode:claude-opus-5
---
 monitor/analyze.c | 2 ++
 monitor/l2cap.c   | 6 ++++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/monitor/analyze.c b/monitor/analyze.c
index 154303eb7330..5a3adedc211c 100644
--- a/monitor/analyze.c
+++ b/monitor/analyze.c
@@ -298,6 +298,8 @@ static void chan_destroy(void *data)
 	print_stats(&chan->tx, "TX");
 
 done:
+	queue_destroy(chan->rx.plot, free);
+	queue_destroy(chan->tx.plot, free);
 	free(chan);
 }
 
diff --git a/monitor/l2cap.c b/monitor/l2cap.c
index a132bcf397f4..3eaca5bc226b 100644
--- a/monitor/l2cap.c
+++ b/monitor/l2cap.c
@@ -2913,9 +2913,11 @@ void l2cap_dequeue_frame(struct timeval *delta, struct packet_conn_data *conn)
 			frame->cid, frame->psm, mode2str(frame->mode),
 			frame->mode, frame->chan);
 
-	print_field("Channel Latency: %lld msec (%lld-%lld msec ~%lld msec)",
+	print_field("Channel Latency: %lld msec (%lld-%lld msec ~%lld msec "
+			"+/- %lld msec)",
 			TV_MSEC(*delta), TV_MSEC(chan->tx_l.min),
-			TV_MSEC(chan->tx_l.max), TV_MSEC(chan->tx_l.med));
+			TV_MSEC(chan->tx_l.max), TV_MSEC(chan->tx_l.med),
+			packet_latency_stddev(&chan->tx_l));
 
 	free(frame);
 }
-- 
2.55.0


  reply	other threads:[~2026-09-18 16:14 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-18 16:13 [PATCH BlueZ v2 0/9] monitor: Search the frames with a pager Luiz Augusto von Dentz
2026-09-18 16:14 ` Luiz Augusto von Dentz [this message]
2026-09-18 18:47   ` bluez.test.bot
2026-09-18 16:14 ` [PATCH BlueZ v2 2/9] monitor/l2cap: Report the channel latency deviation Luiz Augusto von Dentz
2026-09-18 16:14 ` [PATCH BlueZ v2 3/9] monitor/analyze: Drop a trailing space before a newline Luiz Augusto von Dentz
2026-09-18 16:14 ` [PATCH BlueZ v2 4/9] monitor: Route the decoding output through a single function Luiz Augusto von Dentz
2026-09-18 16:14 ` [PATCH BlueZ v2 5/9] monitor: Separate the frames for a pager reading records Luiz Augusto von Dentz
2026-09-18 16:14 ` [PATCH BlueZ v2 6/9] monitor: Hand the captured frames to the pager on Ctrl-R Luiz Augusto von Dentz
2026-09-18 16:14 ` [PATCH BlueZ v2 7/9] doc/btmon: Document searching the frames Luiz Augusto von Dentz
2026-09-18 16:14 ` [PATCH BlueZ v2 8/9] monitor: Prefer fzf as the pager when one is not set Luiz Augusto von Dentz
2026-09-18 16:14 ` [PATCH BlueZ v2 9/9] doc/btmon: Document the pager choice Luiz Augusto von Dentz
2026-09-21 14:40 ` [PATCH BlueZ v2 0/9] monitor: Search the frames with a pager 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=20260918161408.2464981-2-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