public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ v1 3/3] doc: Add throughput estimation section to btmon-l2cap.rst
Date: Wed, 15 Apr 2026 16:58:18 -0400	[thread overview]
Message-ID: <20260415205818.594024-3-luiz.dentz@gmail.com> (raw)
In-Reply-To: <20260415205818.594024-1-luiz.dentz@gmail.com>

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

Document the throughput statistics reported by btmon analyze mode,
including speed calculation methodology, channel details (PSM, mode,
MTU, MPS), and caveats about inter-packet latency vs wall-clock time.
Also document the windowed throughput approach used by btsnoop-analyzer.
---
 doc/btmon-l2cap.rst | 56 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 56 insertions(+)

diff --git a/doc/btmon-l2cap.rst b/doc/btmon-l2cap.rst
index e8c52c5e6c5c..6543f31db95c 100644
--- a/doc/btmon-l2cap.rst
+++ b/doc/btmon-l2cap.rst
@@ -190,3 +190,59 @@ Automating L2CAP Analysis
 channel, note the Source CID and Destination CID from the Connection
 Request/Response pair. Then search for those CIDs in subsequent data
 frames.
+
+Throughput Estimation
+----------------------
+
+btmon's ``--analyze`` (``-a``) mode computes per-channel statistics
+including throughput.  For each L2CAP channel it reports:
+
+- **Speed**: Computed as ``bytes * 8 / latency_sum_ms`` where
+  ``latency_sum_ms`` is the sum of inter-packet deltas (not wall-clock
+  duration).  This means idle gaps are excluded, so the figure
+  represents the *active sending rate* rather than application-level
+  throughput.
+
+- **Min/Avg/Max latency**: Per-packet inter-arrival time range.
+
+Example output::
+
+    Found TX L2CAP channel with CID 64
+          PSM 128 (0x0080)
+          Mode: LE Credit
+          MTU: 672
+          MPS: 490
+          TX packets: 29120/29114
+          TX Latency: 1-79 msec (~29 msec)
+          TX size: 494-494 octets (~494 octets)
+          TX speed: ~571 Kb/s
+
+**Channel details shown in analyze mode:**
+
+- **Fixed channels** (CID <= 7) display their protocol name
+  (e.g., ``ATT``, ``L2CAP Signaling (LE)``).
+- **PSM** is shown in both decimal and hexadecimal.
+- **Mode** is decoded from Configure Request options (BR/EDR) or
+  LE signaling (``Basic``, ``ERTM``, ``LE Credit``,
+  ``Enhanced Credit``, etc.).
+- **MTU** and **MPS** are extracted from signaling exchanges.
+
+**Throughput caveats:**
+
+1. The speed value uses inter-packet latency sums as the denominator,
+   not wall-clock elapsed time.  If the sender pauses (e.g., waiting
+   for credits), the idle period is not counted, which inflates the
+   reported speed relative to overall throughput.
+
+2. TX latency is measured from command submission to completion event.
+   RX latency is the inter-arrival time between consecutive packets.
+   These measure different things, so TX and RX speeds for the same
+   channel are not directly comparable.
+
+3. For windowed throughput (min/avg/max), btsnoop-analyzer uses
+   1-second sampling windows over wall-clock time, which provides
+   a more realistic view of application-level bandwidth variation.
+
+**Automated throughput extraction** from btmon analyze output::
+
+    btmon -a trace.btsnoop 2>/dev/null | grep -E "speed:|Mode:|MTU:|MPS:|PSM"
-- 
2.53.0


  parent reply	other threads:[~2026-04-15 20:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-15 20:58 [PATCH BlueZ v1 1/3] monitor: Add L2CAP channel details to analyze output Luiz Augusto von Dentz
2026-04-15 20:58 ` [PATCH BlueZ v1 2/3] monitor: Use wall-clock duration for throughput and add min/max speed Luiz Augusto von Dentz
2026-04-15 20:58 ` Luiz Augusto von Dentz [this message]
2026-04-15 22:10 ` [BlueZ,v1,1/3] monitor: Add L2CAP channel details to analyze output bluez.test.bot
2026-04-16 13:50 ` [PATCH BlueZ v1 1/3] " 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=20260415205818.594024-3-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