* [PATCH BlueZ v1 1/8] doc/btmon: Add missing documentation
@ 2026-02-19 16:22 Luiz Augusto von Dentz
2026-02-19 16:22 ` [PATCH BlueZ v1 2/8] doc/btmon: Add dedicate sections for timestamp and frame number Luiz Augusto von Dentz
` (7 more replies)
0 siblings, 8 replies; 9+ messages in thread
From: Luiz Augusto von Dentz @ 2026-02-19 16:22 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This adds missing documentation for -I/--iso and -N/--no-time options.
---
doc/btmon.rst | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/doc/btmon.rst b/doc/btmon.rst
index 11d98a93b4b0..e51001921ab1 100644
--- a/doc/btmon.rst
+++ b/doc/btmon.rst
@@ -84,10 +84,15 @@ OPTIONS
-T, --date Show a time and date information instead of
time offset.
+-N, --no-time Suppress the time offset display entirely.
+
-S, --sco Dump SCO traffic in raw hex format.
-A, --a2dp Dump A2DP stream traffic in a raw hex format.
+-I, --iso Dump ISO stream traffic in raw hex format. Required
+ to see LE Audio isochronous data in the output.
+
-E IP, --ellisys IP Send Ellisys HCI Injection.
-P, --no-pager Disable pager usage while reading the log file.
--
2.52.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH BlueZ v1 2/8] doc/btmon: Add dedicate sections for timestamp and frame number
2026-02-19 16:22 [PATCH BlueZ v1 1/8] doc/btmon: Add missing documentation Luiz Augusto von Dentz
@ 2026-02-19 16:22 ` Luiz Augusto von Dentz
2026-02-19 16:22 ` [PATCH BlueZ v1 3/8] doc/btmon: Add connection tracking section Luiz Augusto von Dentz
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Luiz Augusto von Dentz @ 2026-02-19 16:22 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This adds sections for how timestamp and frame numbers are generated
and explaim the difference between a frame number and a line number.
---
doc/btmon.rst | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)
diff --git a/doc/btmon.rst b/doc/btmon.rst
index e51001921ab1..de05a5fcd6df 100644
--- a/doc/btmon.rst
+++ b/doc/btmon.rst
@@ -442,6 +442,41 @@ Example of protocol layering in ACL data::
Authentication requirement: Bonding, MITM, SC (0x2d)
Max encryption key size: 16
+Timestamp Notes
+---------------
+
+When reading btsnoop files with ``-t`` or ``-T``, timestamps reflect the
+wall-clock time recorded in the btsnoop file. The precision depends on
+the source:
+
+- **Live capture** (``btmon`` monitor channel): Microsecond precision
+ from the kernel.
+- **btsnoop files**: The btsnoop format stores timestamps as
+ microseconds since epoch, so full microsecond precision is
+ preserved. Trailing zeros in the display (e.g., ``14:38:46.589000``)
+ indicate the original capture source had millisecond granularity.
+
+The default timestamp mode shows seconds elapsed since the first
+packet in the trace, which is useful for measuring intervals between
+events without needing to know the absolute time.
+
+Frame Numbers vs Line Numbers
+-----------------------------
+
+btmon assigns sequential **frame numbers** (``#N``) to HCI packets.
+These are stable identifiers for specific packets regardless of output
+formatting. However, when processing btmon text output with tools like
+``grep`` or ``sed``, the relevant unit is **line numbers** in the output
+file. The two are unrelated:
+
+- A single frame may produce many output lines (header + decoded
+ fields).
+- Frame numbers only apply to HCI traffic (``<`` and ``>``). MGMT
+ (``@``) and system notes (``=``) do not have frame numbers.
+- When referencing specific packets, prefer frame numbers (``#487``)
+ over line numbers, as frame numbers are stable across different
+ terminal widths and formatting options.
+
Practical Reading Guide
-----------------------
--
2.52.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH BlueZ v1 3/8] doc/btmon: Add connection tracking section
2026-02-19 16:22 [PATCH BlueZ v1 1/8] doc/btmon: Add missing documentation Luiz Augusto von Dentz
2026-02-19 16:22 ` [PATCH BlueZ v1 2/8] doc/btmon: Add dedicate sections for timestamp and frame number Luiz Augusto von Dentz
@ 2026-02-19 16:22 ` Luiz Augusto von Dentz
2026-02-19 16:22 ` [PATCH BlueZ v1 4/8] doc/btmon: Add a dedicated section for analyze mode Luiz Augusto von Dentz
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Luiz Augusto von Dentz @ 2026-02-19 16:22 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This adds connection tracking section which explains how connections
and buffers are tracked.
---
doc/btmon.rst | 141 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 141 insertions(+)
diff --git a/doc/btmon.rst b/doc/btmon.rst
index de05a5fcd6df..d93aa34a9412 100644
--- a/doc/btmon.rst
+++ b/doc/btmon.rst
@@ -531,6 +531,147 @@ The kernel forwarded this as a MGMT Device Connected event. bluetoothd
logged its ``connected_callback()``. Then data exchange began -- an L2CAP
parameter update and ATT MTU negotiation over the new ACL connection.
+CONNECTION TRACKING
+===================
+
+HCI uses **connection handles** (16-bit integers) to identify individual
+connections. Understanding how handles map to devices is essential for
+reading traces.
+
+Handle Types
+------------
+
+Different connection types use different handle ranges, but these ranges
+are controller-specific and not standardized. The connection type can be
+determined by looking at the event that created the handle:
+
+.. list-table::
+ :header-rows: 1
+ :widths: 15 25 60
+
+ * - Type
+ - Creation Event
+ - Description
+ * - BR/EDR ACL
+ - Connection Complete
+ - Classic Bluetooth data connection
+ * - LE ACL
+ - LE (Enhanced) Connection Complete
+ - Low Energy data connection
+ * - CIS
+ - LE CIS Established
+ - Connected Isochronous Stream (LE Audio)
+ * - BIS
+ - LE BIG Complete
+ - Broadcast Isochronous Stream (LE Audio)
+ * - SCO/eSCO
+ - Synchronous Connection Complete
+ - Voice/audio synchronous connection (classic)
+
+A single device may have multiple handles simultaneously. For example,
+an LE Audio device will have an LE ACL handle for control traffic and
+one or more CIS handles for audio streams. The ``LE CIS Established``
+event includes the ACL connection handle that the CIS is associated
+with.
+
+Controller Buffer Tracking
+--------------------------
+
+Buffer tracking may show a indicator in square brackets::
+
+ < ACL Data TX: Handle 2048 [1/6] flags 0x00 dlen 16
+
+The ``[1/6]`` means this is buffer slot 1 of 6 available controller
+ACL buffers. This reflects the host-side HCI flow control: the host
+tracks how many buffers the controller has available and shows the
+current usage. When the controller sends ``Number of Completed Packets``
+events, buffers are freed and the count decreases.
+
+HCI ERROR AND DISCONNECT REASON CODES
+======================================
+
+HCI status and disconnect reason codes use the same code space. These
+appear in ``Status:`` and ``Reason:`` fields throughout the trace.
+btmon decodes them automatically, but the hex values are useful for
+searching and filtering.
+
+Common Disconnect Reasons
+-------------------------
+
+.. list-table::
+ :header-rows: 1
+ :widths: 8 40 52
+
+ * - Code
+ - Name
+ - Diagnostic Meaning
+ * - 0x05
+ - Authentication Failure
+ - Pairing or encryption setup failed. Key may be
+ stale or devices have mismatched security databases.
+ * - 0x08
+ - Connection Timeout
+ - The supervision timer expired. The remote device
+ moved out of range or stopped responding. This is
+ an RF link loss.
+ * - 0x13
+ - Remote User Terminated Connection
+ - The remote device intentionally disconnected.
+ This is the normal graceful disconnect.
+ * - 0x14
+ - Remote Device Terminated due to Low Resources
+ - The remote device ran out of resources (memory,
+ connection slots).
+ * - 0x15
+ - Remote Device Terminated due to Power Off
+ - The remote device is powering down.
+ * - 0x16
+ - Connection Terminated By Local Host
+ - The local BlueZ stack intentionally disconnected.
+ Normal when bluetoothd initiates disconnect.
+ * - 0x1f
+ - Unspecified Error
+ - Generic error. Often indicates a firmware issue.
+ * - 0x22
+ - LMP/LL Response Timeout
+ - Link layer procedure timed out. The remote device
+ stopped responding to LL control PDUs.
+ * - 0x28
+ - Instant Passed
+ - A timing-critical operation missed its deadline.
+ Often seen with connection parameter updates.
+ * - 0x2f
+ - Insufficient Security
+ - The required security level (encryption, MITM
+ protection) was not met.
+ * - 0x3b
+ - Unacceptable Connection Parameters
+ - The remote rejected a connection parameter update.
+ * - 0x3d
+ - Connection Terminated due to MIC Failure
+ - Encryption integrity check failed. Possible key
+ mismatch or corruption.
+ * - 0x3e
+ - Connection Failed to be Established
+ - Connection attempt failed entirely (e.g., the
+ remote device did not respond to connection
+ requests).
+ * - 0x3f
+ - MAC Connection Failed
+ - MAC-level connection failure.
+ * - 0x44
+ - Operation Cancelled by Host
+ - The host cancelled the operation before it
+ completed.
+
+Full Error Code Table
+---------------------
+
+The complete set of HCI error codes (0x00-0x45) is defined in the
+Bluetooth Core Specification, Volume 1, Part F. btmon decodes all
+of them automatically in ``Status:`` and ``Reason:`` fields. The
+source mapping is in ``monitor/packet.c`` (``error2str_table``).
+
EXAMPLES
========
--
2.52.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH BlueZ v1 4/8] doc/btmon: Add a dedicated section for analyze mode
2026-02-19 16:22 [PATCH BlueZ v1 1/8] doc/btmon: Add missing documentation Luiz Augusto von Dentz
2026-02-19 16:22 ` [PATCH BlueZ v1 2/8] doc/btmon: Add dedicate sections for timestamp and frame number Luiz Augusto von Dentz
2026-02-19 16:22 ` [PATCH BlueZ v1 3/8] doc/btmon: Add connection tracking section Luiz Augusto von Dentz
@ 2026-02-19 16:22 ` Luiz Augusto von Dentz
2026-02-19 16:22 ` [PATCH BlueZ v1 5/8] doc/btmon: Add a section for automated trace analysis Luiz Augusto von Dentz
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Luiz Augusto von Dentz @ 2026-02-19 16:22 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This adds a dedicated section for analyze mode.
---
doc/btmon.rst | 37 +++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)
diff --git a/doc/btmon.rst b/doc/btmon.rst
index d93aa34a9412..66a97859a49e 100644
--- a/doc/btmon.rst
+++ b/doc/btmon.rst
@@ -672,6 +672,43 @@ Bluetooth Core Specification, Volume 1, Part F. btmon decodes all
of them automatically in ``Status:`` and ``Reason:`` fields. The
source mapping is in ``monitor/packet.c`` (``error2str_table``).
+ANALYZE MODE
+============
+
+The ``-a`` (``--analyze``) option reads a btsnoop file and produces a
+statistical summary instead of the full decoded trace.
+
+Usage
+-----
+
+.. code-block::
+
+ $ btmon -a hcidump.log
+
+Output Contents
+---------------
+
+Analyze mode reports, for each controller found in the trace:
+
+- **Packet counts**: Total HCI packets broken down by type (commands,
+ events, ACL, SCO, ISO, vendor diagnostics, system notes, user
+ logs, control messages).
+
+- **Per-connection statistics**: For each connection handle found:
+
+ - Connection type (BR-ACL, LE-ACL, BR-SCO, BR-ESCO, LE-ISO)
+ - Device address
+ - TX and RX packet counts and completion counts
+ - Latency statistics (min, max, median) in milliseconds
+ - Packet size statistics (min, max, average) in octets
+ - Throughput estimate in Kb/s
+
+- **Per-channel statistics**: For each L2CAP channel within a
+ connection, the same packet/latency/size statistics.
+
+- **Latency plots**: If ``gnuplot`` is installed, ASCII-art latency
+ distribution plots are rendered in the terminal.
+
EXAMPLES
========
--
2.52.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH BlueZ v1 5/8] doc/btmon: Add a section for automated trace analysis
2026-02-19 16:22 [PATCH BlueZ v1 1/8] doc/btmon: Add missing documentation Luiz Augusto von Dentz
` (2 preceding siblings ...)
2026-02-19 16:22 ` [PATCH BlueZ v1 4/8] doc/btmon: Add a dedicated section for analyze mode Luiz Augusto von Dentz
@ 2026-02-19 16:22 ` Luiz Augusto von Dentz
2026-02-19 16:22 ` [PATCH BlueZ v1 6/8] monitor: Annotate ACL/SCO/ISO data with device address Luiz Augusto von Dentz
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Luiz Augusto von Dentz @ 2026-02-19 16:22 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This adds a section dedicated for automated trace analysis which can be
used for analysing traces programmatically or with use of AI assistance.
---
doc/btmon.rst | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 75 insertions(+)
diff --git a/doc/btmon.rst b/doc/btmon.rst
index 66a97859a49e..70cdb90e37ab 100644
--- a/doc/btmon.rst
+++ b/doc/btmon.rst
@@ -740,6 +740,81 @@ Open the trace file with full date and time
$ btmon -T -r hcidump.log
+AUTOMATED TRACE ANALYSIS
+=========================
+
+This section provides guidance for analyzing btmon traces
+programmatically or with AI assistance.
+
+Recommended Workflow
+--------------------
+
+1. **Get an overview**: Start with ``btmon -a <file>`` to see packet
+ counts, connection handles, device addresses, and traffic volumes.
+
+2. **Decode with timestamps**: Use ``btmon -t -r <file> > output.txt``
+ to produce a text file with wall-clock timestamps for analysis.
+
+3. **Identify connections**: Search for connection establishment events
+ to build a handle-to-address mapping::
+
+ grep -n "Connection Complete\|Enhanced Connection Complete\|CIS Established" output.txt
+
+4. **Track disconnections**: Search for disconnect events and their
+ reasons::
+
+ grep -n "Disconnect Complete" output.txt
+
+ Then examine the lines following each match for the ``Reason:``
+ field.
+
+5. **Identify LE Audio**: Search for ASCS and CIS activity::
+
+ grep -n "ASE Control Point\|CIG Parameters\|Create Connected Isochronous\|CIS Established\|Setup ISO Data Path" output.txt
+
+6. **Check for errors**: Search for non-success status codes::
+
+ grep -n "Status:" output.txt | grep -v "Success"
+
+Key Patterns for Connection Lifecycle
+-------------------------------------
+
+A complete connection lifecycle for an LE ACL connection follows this
+pattern in the trace:
+
+1. ``LE Enhanced Connection Complete`` -- connection established,
+ note the Handle and Peer address
+2. ``LE Connection Update Complete`` -- connection parameters changed
+ (may occur zero or more times)
+3. ``Encryption Change`` -- link encrypted (may show encryption
+ algorithm)
+4. ACL Data with ATT/SMP/L2CAP -- service discovery and data exchange
+5. ``Disconnect Complete`` -- connection ended, check Reason field
+
+For LE Audio connections, additional steps appear between 3 and 5:
+
+- ATT operations on PACS/ASCS characteristics (codec negotiation)
+- ``LE Set CIG Parameters`` command and response
+- ``LE Create CIS`` command
+- ``LE CIS Established`` event (note the CIS handle)
+- ``LE Setup ISO Data Path`` command
+- ISO Data TX/RX (audio streaming)
+- ``Disconnect Complete`` on CIS handle (stream ended)
+- ``LE Remove CIG`` (group removed)
+
+Vendor-Specific Events
+----------------------
+
+Vendor-specific HCI events (event code 0xFF) contain
+controller-manufacturer diagnostic data. btmon decodes some vendor
+events for known manufacturers (Intel, Broadcom, etc.) but many
+sub-events show as ``Unknown`` with raw hex data. These are expected
+and generally not actionable without vendor documentation.
+
+Intel controllers emit extended telemetry events (subevent 0x8780)
+that include connection quality metrics, error counters, and firmware
+state. Partial decoding is available in ``monitor/intel.c``.
+
RESOURCES
=========
--
2.52.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH BlueZ v1 6/8] monitor: Annotate ACL/SCO/ISO data with device address
2026-02-19 16:22 [PATCH BlueZ v1 1/8] doc/btmon: Add missing documentation Luiz Augusto von Dentz
` (3 preceding siblings ...)
2026-02-19 16:22 ` [PATCH BlueZ v1 5/8] doc/btmon: Add a section for automated trace analysis Luiz Augusto von Dentz
@ 2026-02-19 16:22 ` Luiz Augusto von Dentz
2026-02-19 16:22 ` [PATCH BlueZ v1 7/8] monitor: Print connection type in Disconnect Complete Luiz Augusto von Dentz
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Luiz Augusto von Dentz @ 2026-02-19 16:22 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Add the remote device address to ACL, SCO and ISO data packet output
so each data packet line shows which device it belongs to. This makes
it much easier to follow multi-device traces without having to
cross-reference handle numbers with earlier connection events:
< ACL Data TX: Handle 2048 [1/6] [42:96:D7:49:78:CC (Resolvable)] flags 0x00 dlen 7
ATT: Exchange MTU Request (0x02) len 2
Client RX MTU: 527
> ACL Data RX: Handle 256 [20:32:C6:09:FF:6C (Apple, Inc.)] flags 0x02 dlen 16
L2CAP: Connection Response (0x03) ident 33 len 8
Destination CID: 17169
Source CID: 64
Result: Connection successful (0x0000)
Status: No further information available (0x0000)
Also fix the connection lookup in packet_hci_acldata() to use
acl_handle() to mask off the flags bits, matching what assign_handle()
stores.
---
monitor/packet.c | 92 +++++++++++++++++++++++++++++++++++++++++++++---
monitor/packet.h | 4 +++
2 files changed, 92 insertions(+), 4 deletions(-)
diff --git a/monitor/packet.c b/monitor/packet.c
index 3ba33f8f3afa..b8a48bb549af 100644
--- a/monitor/packet.c
+++ b/monitor/packet.c
@@ -322,6 +322,43 @@ static void assign_handle(uint16_t index, uint16_t handle, uint8_t type,
memcpy(conn->dst, dst, sizeof(conn->dst));
conn->dst_type = dst_type;
}
+
+ switch (conn->dst_type) {
+ case 0x00:
+ case 0x02:
+ /* If address public set dst_oui */
+ hwdb_get_company(conn->dst, &conn->dst_oui);
+ break;
+ case 0x01:
+ case 0x03:
+ /* Attempt to resolve the identity if resolvable */
+ if ((conn->dst[5] & 0xc0) == 0x40) {
+ keys_resolve_identity(conn->dst, conn->dst,
+ &conn->dst_type);
+ /* If identity address is public set dst_out */
+ if (conn->dst_type == 0x00 || conn->dst_type == 0x02) {
+ hwdb_get_company(conn->dst, &conn->dst_oui);
+ break;
+ }
+ }
+
+ /* Set the random type */
+ switch ((conn->dst[5] & 0xc0) >> 6) {
+ case 0x00:
+ conn->dst_rtype = strdup("Non-Resolvable");
+ break;
+ case 0x01:
+ conn->dst_rtype = strdup("Resolvable");
+ break;
+ case 0x03:
+ conn->dst_rtype = strdup("Static");
+ break;
+ default:
+ conn->dst_rtype = strdup("Reserved");
+ break;
+ }
+ break;
+ }
}
struct packet_conn_data *packet_get_conn_data(uint16_t handle)
@@ -329,7 +366,7 @@ struct packet_conn_data *packet_get_conn_data(uint16_t handle)
int i;
for (i = 0; i < MAX_CONN; i++) {
- if (conn_list[i].handle == handle)
+ if (conn_list[i].handle == acl_handle(handle))
return &conn_list[i];
}
@@ -14047,6 +14084,43 @@ static void packet_enqueue_tx(struct timeval *tv, uint16_t handle,
queue_push_tail(conn->tx_q, frame);
}
+static void handle_str_append_addr(char *handle_str,
+ struct packet_conn_data *conn)
+{
+ if (!conn)
+ return;
+
+ switch (conn->dst_type) {
+ case 0x00:
+ case 0x02:
+ if (conn->dst_oui) {
+ sprintf(handle_str + strlen(handle_str),
+ " [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X (%.16s)]",
+ conn->dst[5], conn->dst[4], conn->dst[3],
+ conn->dst[2], conn->dst[1], conn->dst[0],
+ conn->dst_oui);
+ return;
+ }
+ break;
+ case 0x01:
+ case 0x03:
+ if (conn->dst_rtype) {
+ sprintf(handle_str + strlen(handle_str),
+ " [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X (%.16s)]",
+ conn->dst[5], conn->dst[4], conn->dst[3],
+ conn->dst[2], conn->dst[1], conn->dst[0],
+ conn->dst_rtype);
+ return;
+ }
+ break;
+ }
+
+ sprintf(handle_str + strlen(handle_str),
+ " [%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X]",
+ conn->dst[5], conn->dst[4], conn->dst[3],
+ conn->dst[2], conn->dst[1], conn->dst[0]);
+}
+
void packet_hci_acldata(struct timeval *tv, struct ucred *cred, uint16_t index,
bool in, const void *data, uint16_t size)
{
@@ -14054,7 +14128,7 @@ void packet_hci_acldata(struct timeval *tv, struct ucred *cred, uint16_t index,
uint16_t handle = le16_to_cpu(hdr->handle);
uint16_t dlen = le16_to_cpu(hdr->dlen);
uint8_t flags = acl_flags(handle);
- char handle_str[22], extra_str[32];
+ char handle_str[58], extra_str[32];
struct packet_conn_data *conn;
struct index_buf_pool *pool = &index_list[index].acl;
@@ -14089,6 +14163,8 @@ void packet_hci_acldata(struct timeval *tv, struct ucred *cred, uint16_t index,
else
sprintf(handle_str, "Handle %d", acl_handle(handle));
+ handle_str_append_addr(handle_str, conn);
+
sprintf(extra_str, "flags 0x%2.2x dlen %d", flags, dlen);
print_packet(tv, cred, in ? '>' : '<', index, NULL, COLOR_HCI_ACLDATA,
@@ -14118,7 +14194,8 @@ void packet_hci_scodata(struct timeval *tv, struct ucred *cred, uint16_t index,
const hci_sco_hdr *hdr = data;
uint16_t handle = le16_to_cpu(hdr->handle);
uint8_t flags = acl_flags(handle);
- char handle_str[22], extra_str[32];
+ char handle_str[42], extra_str[32];
+ struct packet_conn_data *conn;
if (index >= MAX_INDEX) {
print_field("Invalid index (%d).", index);
@@ -14140,6 +14217,7 @@ void packet_hci_scodata(struct timeval *tv, struct ucred *cred, uint16_t index,
data += HCI_SCO_HDR_SIZE;
size -= HCI_SCO_HDR_SIZE;
+ conn = packet_get_conn_data(handle);
if (index_list[index].sco.total && !in)
sprintf(handle_str, "Handle %d [%u/%u]", acl_handle(handle),
@@ -14147,6 +14225,8 @@ void packet_hci_scodata(struct timeval *tv, struct ucred *cred, uint16_t index,
else
sprintf(handle_str, "Handle %d", acl_handle(handle));
+ handle_str_append_addr(handle_str, conn);
+
sprintf(extra_str, "flags 0x%2.2x dlen %d", flags, hdr->dlen);
print_packet(tv, cred, in ? '>' : '<', index, NULL, COLOR_HCI_SCODATA,
@@ -14175,8 +14255,9 @@ void packet_hci_isodata(struct timeval *tv, struct ucred *cred, uint16_t index,
const struct bt_hci_iso_data_start *start;
uint16_t handle = le16_to_cpu(hdr->handle);
uint8_t flags = acl_flags(handle);
- char handle_str[36], extra_str[50], ts_str[16] = { 0 };
+ char handle_str[56], extra_str[50], ts_str[16] = { 0 };
struct index_buf_pool *pool = &index_list[index].iso;
+ struct packet_conn_data *conn;
size_t ts_size = 0;
if (index >= MAX_INDEX) {
@@ -14206,6 +14287,7 @@ void packet_hci_isodata(struct timeval *tv, struct ucred *cred, uint16_t index,
}
start = data;
+ conn = packet_get_conn_data(handle);
if (!in && pool->total)
sprintf(handle_str, "Handle %d [%u/%u] SN %u",
@@ -14214,6 +14296,8 @@ void packet_hci_isodata(struct timeval *tv, struct ucred *cred, uint16_t index,
sprintf(handle_str, "Handle %u SN %u", acl_handle(handle),
start->sn);
+ handle_str_append_addr(handle_str, conn);
+
sprintf(extra_str, "flags 0x%2.2x dlen %u slen %u%s", flags, hdr->dlen,
start->slen, ts_str);
diff --git a/monitor/packet.h b/monitor/packet.h
index 2990b795bd3e..f6547ec9b594 100644
--- a/monitor/packet.h
+++ b/monitor/packet.h
@@ -47,6 +47,10 @@ struct packet_conn_data {
uint8_t type;
uint8_t dst[6];
uint8_t dst_type;
+ union {
+ char *dst_oui;
+ char *dst_rtype;
+ };
struct queue *tx_q;
struct queue *chan_q;
struct packet_latency tx_l;
--
2.52.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH BlueZ v1 7/8] monitor: Print connection type in Disconnect Complete
2026-02-19 16:22 [PATCH BlueZ v1 1/8] doc/btmon: Add missing documentation Luiz Augusto von Dentz
` (4 preceding siblings ...)
2026-02-19 16:22 ` [PATCH BlueZ v1 6/8] monitor: Annotate ACL/SCO/ISO data with device address Luiz Augusto von Dentz
@ 2026-02-19 16:22 ` Luiz Augusto von Dentz
2026-02-19 16:22 ` [PATCH BlueZ v1 8/8] monitor: Add connection lifecycle to analyze summary Luiz Augusto von Dentz
2026-02-19 17:57 ` [BlueZ,v1,1/8] doc/btmon: Add missing documentation bluez.test.bot
7 siblings, 0 replies; 9+ messages in thread
From: Luiz Augusto von Dentz @ 2026-02-19 16:22 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Print the connection type (BR-ACL, LE-ACL, BR-SCO, BR-ESCO, LE-CIS,
LE-BIS) alongside the handle in Disconnect Complete events so the type
of link being torn down is immediately visible without cross-referencing
earlier connection events.
---
monitor/analyze.c | 53 +++++++++++++++++++++++-------------------
monitor/packet.c | 59 ++++++++++++++++++++++++++++++++++-------------
monitor/packet.h | 9 ++++++++
3 files changed, 81 insertions(+), 40 deletions(-)
diff --git a/monitor/analyze.c b/monitor/analyze.c
index 268ea10e29e6..2cf42f903b61 100644
--- a/monitor/analyze.c
+++ b/monitor/analyze.c
@@ -53,12 +53,6 @@ struct hci_dev {
struct queue *conn_list;
};
-#define CONN_BR_ACL 0x01
-#define CONN_BR_SCO 0x02
-#define CONN_BR_ESCO 0x03
-#define CONN_LE_ACL 0x04
-#define CONN_LE_ISO 0x05
-
struct hci_stats {
size_t bytes;
size_t num;
@@ -223,20 +217,23 @@ static void conn_destroy(void *data)
const char *str;
switch (conn->type) {
- case CONN_BR_ACL:
+ case BTMON_CONN_ACL:
str = "BR-ACL";
break;
- case CONN_BR_SCO:
+ case BTMON_CONN_LE:
str = "BR-SCO";
break;
- case CONN_BR_ESCO:
+ case BTMON_CONN_SCO:
str = "BR-ESCO";
break;
- case CONN_LE_ACL:
+ case BTMON_CONN_ESCO:
str = "LE-ACL";
break;
- case CONN_LE_ISO:
- str = "LE-ISO";
+ case BTMON_CONN_CIS:
+ str = "LE-CIS";
+ break;
+ case BTMON_CONN_BIS:
+ str = "LE-BIS";
break;
default:
str = "unknown";
@@ -476,7 +473,7 @@ static void evt_conn_complete(struct hci_dev *dev, struct timeval *tv,
if (evt->status)
return;
- conn = conn_lookup_type(dev, le16_to_cpu(evt->handle), CONN_BR_ACL);
+ conn = conn_lookup_type(dev, le16_to_cpu(evt->handle), BTMON_CONN_ACL);
if (!conn)
return;
@@ -567,7 +564,7 @@ static void evt_le_conn_complete(struct hci_dev *dev, struct timeval *tv,
if (!evt || evt->status)
return;
- conn = conn_lookup_type(dev, le16_to_cpu(evt->handle), CONN_LE_ACL);
+ conn = conn_lookup_type(dev, le16_to_cpu(evt->handle), BTMON_CONN_LE);
if (!conn)
return;
@@ -585,7 +582,7 @@ static void evt_le_enh_conn_complete(struct hci_dev *dev, struct timeval *tv,
if (!evt || evt->status)
return;
- conn = conn_lookup_type(dev, le16_to_cpu(evt->handle), CONN_LE_ACL);
+ conn = conn_lookup_type(dev, le16_to_cpu(evt->handle), BTMON_CONN_LE);
if (!conn)
return;
@@ -670,7 +667,7 @@ static void evt_le_cis_established(struct hci_dev *dev, struct timeval *tv,
return;
conn = conn_lookup_type(dev, le16_to_cpu(evt->conn_handle),
- CONN_LE_ISO);
+ BTMON_CONN_CIS);
if (!conn)
return;
@@ -715,7 +712,7 @@ static void evt_le_big_complete(struct hci_dev *dev, struct timeval *tv,
if (!util_iov_pull_le16(iov, &handle))
return;
- conn = conn_lookup_type(dev, handle, CONN_LE_ISO);
+ conn = conn_lookup_type(dev, handle, BTMON_CONN_BIS);
if (conn)
conn->setup_seen = true;
}
@@ -738,7 +735,7 @@ static void evt_le_big_sync_established(struct hci_dev *dev, struct timeval *tv,
if (!util_iov_pull_le16(iov, &handle))
return;
- conn = conn_lookup_type(dev, handle, CONN_LE_ISO);
+ conn = conn_lookup_type(dev, handle, BTMON_CONN_BIS);
if (conn)
conn->setup_seen = true;
}
@@ -928,9 +925,13 @@ static void sco_pkt(struct timeval *tv, uint16_t index, bool out,
dev->num_sco++;
conn = conn_lookup_type(dev, le16_to_cpu(hdr->handle) & 0x0fff,
- CONN_BR_SCO);
- if (!conn)
- return;
+ BTMON_CONN_SCO);
+ if (!conn) {
+ conn = conn_lookup_type(dev, le16_to_cpu(hdr->handle) & 0x0fff,
+ BTMON_CONN_ESCO);
+ if (!conn)
+ return;
+ }
if (out) {
conn_pkt_tx(conn, tv, size - sizeof(*hdr), NULL);
@@ -1015,9 +1016,13 @@ static void iso_pkt(struct timeval *tv, uint16_t index, bool out,
dev->num_iso++;
conn = conn_lookup_type(dev, le16_to_cpu(hdr->handle) & 0x0fff,
- CONN_LE_ISO);
- if (!conn)
- return;
+ BTMON_CONN_CIS);
+ if (!conn) {
+ conn = conn_lookup_type(dev, le16_to_cpu(hdr->handle) & 0x0fff,
+ BTMON_CONN_BIS);
+ if (!conn)
+ return;
+ }
if (out) {
conn_pkt_tx(conn, tv, size - sizeof(*hdr), NULL);
diff --git a/monitor/packet.c b/monitor/packet.c
index b8a48bb549af..92e23bf3a54b 100644
--- a/monitor/packet.c
+++ b/monitor/packet.c
@@ -221,22 +221,24 @@ static struct index_buf_pool *get_pool(uint16_t index, uint8_t type)
return NULL;
switch (type) {
- case 0x00:
+ case BTMON_CONN_ACL:
if (index_list[index].acl.total)
return &index_list[index].acl;
break;
- case 0x01:
+ case BTMON_CONN_LE:
if (index_list[index].le.total)
return &index_list[index].le;
break;
- case 0x05:
- if (index_list[index].iso.total)
- return &index_list[index].iso;
- break;
- default:
+ case BTMON_CONN_SCO:
+ case BTMON_CONN_ESCO:
if (index_list[index].sco.total)
return &index_list[index].sco;
break;
+ case BTMON_CONN_CIS:
+ case BTMON_CONN_BIS:
+ if (index_list[index].iso.total)
+ return &index_list[index].iso;
+ break;
}
return NULL;
@@ -922,10 +924,30 @@ static void print_lt_addr(uint8_t lt_addr)
print_field("LT address: %d", lt_addr);
}
+static const char *conn_type_str(uint8_t type)
+{
+ switch (type) {
+ case BTMON_CONN_ACL:
+ return "BR-ACL";
+ case BTMON_CONN_LE:
+ return "LE-ACL";
+ case BTMON_CONN_SCO:
+ return "BR-ESCO";
+ case BTMON_CONN_ESCO:
+ return "LE-ESCO";
+ case BTMON_CONN_CIS:
+ return "LE-CIS";
+ case BTMON_CONN_BIS:
+ return "LE-BIS";
+ default:
+ return "unknown";
+ }
+}
+
static void print_handle_native(uint16_t handle)
{
struct packet_conn_data *conn;
- char label[25];
+ char label[32];
conn = packet_get_conn_data(handle);
if (!conn) {
@@ -933,7 +955,8 @@ static void print_handle_native(uint16_t handle)
return;
}
- sprintf(label, "Handle: %d Address", handle);
+ sprintf(label, "Handle: %d (%s) Address", handle,
+ conn_type_str(conn->type));
print_addr(label, conn->dst, conn->dst_type);
}
@@ -10996,7 +11019,7 @@ static void conn_complete_evt(struct timeval *tv, uint16_t index,
print_enable("Encryption", evt->encr_mode);
if (evt->status == 0x00)
- assign_handle(index, le16_to_cpu(evt->handle), 0x00,
+ assign_handle(index, le16_to_cpu(evt->handle), BTMON_CONN_ACL,
(void *)evt->bdaddr, BDADDR_BREDR);
}
@@ -11583,7 +11606,9 @@ static void sync_conn_complete_evt(struct timeval *tv, uint16_t index,
print_air_mode(evt->air_mode);
if (evt->status == 0x00)
- assign_handle(index, le16_to_cpu(evt->handle), evt->link_type,
+ assign_handle(index, le16_to_cpu(evt->handle),
+ evt->link_type ? BTMON_CONN_ESCO :
+ BTMON_CONN_SCO,
(void *)evt->bdaddr, BDADDR_BREDR);
}
@@ -12014,7 +12039,7 @@ static void le_conn_complete_evt(struct timeval *tv, uint16_t index,
print_field("Central clock accuracy: 0x%2.2x", evt->clock_accuracy);
if (evt->status == 0x00)
- assign_handle(index, le16_to_cpu(evt->handle), 0x01,
+ assign_handle(index, le16_to_cpu(evt->handle), BTMON_CONN_LE,
(void *)evt->peer_addr, evt->peer_addr_type);
}
@@ -12145,7 +12170,7 @@ static void le_enhanced_conn_complete_evt(struct timeval *tv, uint16_t index,
print_field("Central clock accuracy: 0x%2.2x", evt->clock_accuracy);
if (evt->status == 0x00)
- assign_handle(index, le16_to_cpu(evt->handle), 0x01,
+ assign_handle(index, le16_to_cpu(evt->handle), BTMON_CONN_LE,
(void *)evt->peer_addr, evt->peer_addr_type);
}
@@ -12545,7 +12570,8 @@ static void le_cis_established_evt(struct timeval *tv, uint16_t index,
print_slot_125("ISO Interval", evt->interval);
if (!evt->status)
- assign_handle(index, le16_to_cpu(evt->conn_handle), 0x05,
+ assign_handle(index, le16_to_cpu(evt->conn_handle),
+ BTMON_CONN_CIS,
NULL, BDADDR_LE_PUBLIC);
}
@@ -12596,7 +12622,8 @@ static void le_big_complete_evt(struct timeval *tv, uint16_t index,
for (i = 0; i < evt->num_bis; i++)
assign_handle(index, le16_to_cpu(evt->bis_handle[i]),
- 0x05, NULL, BDADDR_LE_PUBLIC);
+ BTMON_CONN_BIS, NULL,
+ BDADDR_LE_PUBLIC);
}
}
@@ -12631,7 +12658,7 @@ static void le_big_sync_estabilished_evt(struct timeval *tv, uint16_t index,
for (i = 0; i < evt->num_bis; i++)
assign_handle(index, le16_to_cpu(evt->bis[i]),
- 0x05, NULL, BDADDR_LE_PUBLIC);
+ BTMON_CONN_BIS, NULL, BDADDR_LE_PUBLIC);
}
}
diff --git a/monitor/packet.h b/monitor/packet.h
index f6547ec9b594..38f3f5514dba 100644
--- a/monitor/packet.h
+++ b/monitor/packet.h
@@ -39,6 +39,15 @@ struct packet_frame {
size_t len;
};
+enum {
+ BTMON_CONN_ACL = 0x00,
+ BTMON_CONN_LE,
+ BTMON_CONN_SCO,
+ BTMON_CONN_ESCO,
+ BTMON_CONN_CIS,
+ BTMON_CONN_BIS
+};
+
struct packet_conn_data {
uint16_t index;
uint8_t src[6];
--
2.52.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH BlueZ v1 8/8] monitor: Add connection lifecycle to analyze summary
2026-02-19 16:22 [PATCH BlueZ v1 1/8] doc/btmon: Add missing documentation Luiz Augusto von Dentz
` (5 preceding siblings ...)
2026-02-19 16:22 ` [PATCH BlueZ v1 7/8] monitor: Print connection type in Disconnect Complete Luiz Augusto von Dentz
@ 2026-02-19 16:22 ` Luiz Augusto von Dentz
2026-02-19 17:57 ` [BlueZ,v1,1/8] doc/btmon: Add missing documentation bluez.test.bot
7 siblings, 0 replies; 9+ messages in thread
From: Luiz Augusto von Dentz @ 2026-02-19 16:22 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Record the frame number at connection and disconnection time for each
connection. Print the connected and disconnected frame numbers in the
per-connection summary produced by analyze mode so that users can
cross-reference with the btmon trace output:
Found LE-ACL connection with handle 2051
Address: 66:B0:26:F1:D3:BC (Resolvable)
RX packets: 48/48
RX Latency: 1-7604 msec (~74 msec)
RX size: 5-51 octets (~13 octets)
RX speed: ~0 Kb/s
TX packets: 39/37
TX Latency: 12-426 msec (~43 msec)
TX size: 5-97 octets (~15 octets)
TX speed: ~1 Kb/s
Connected: #52044
Disconnected: #53069
Disconnect Reason: 0x08
Also fix the TODO in conn_destroy() that was passing a hardcoded 0x00
address type by using the stored bdaddr_type from the LE connection
complete events.
---
monitor/analyze.c | 73 ++++++++++++++++++++++++++++++++++++++---------
1 file changed, 59 insertions(+), 14 deletions(-)
diff --git a/monitor/analyze.c b/monitor/analyze.c
index 2cf42f903b61..1db1e7898132 100644
--- a/monitor/analyze.c
+++ b/monitor/analyze.c
@@ -68,8 +68,12 @@ struct hci_conn {
uint16_t link;
uint8_t type;
uint8_t bdaddr[6];
+ uint8_t bdaddr_type;
bool setup_seen;
bool terminated;
+ uint8_t disconnect_reason;
+ unsigned long frame_connected;
+ unsigned long frame_disconnected;
struct queue *tx_queue;
struct timeval last_rx;
struct queue *chan_list;
@@ -241,13 +245,22 @@ static void conn_destroy(void *data)
}
printf(" Found %s connection with handle %u\n", str, conn->handle);
- /* TODO: Store address type */
- packet_print_addr("Address", conn->bdaddr, 0x00);
+ packet_print_addr("Address", conn->bdaddr, conn->bdaddr_type);
if (!conn->setup_seen)
print_field("Connection setup missing");
print_stats(&conn->rx, "RX");
print_stats(&conn->tx, "TX");
+ if (conn->setup_seen) {
+ print_field("Connected: #%lu", conn->frame_connected);
+ if (conn->terminated) {
+ print_field("Disconnected: #%lu",
+ conn->frame_disconnected);
+ print_field("Disconnect Reason: 0x%02x",
+ conn->disconnect_reason);
+ }
+ }
+
queue_destroy(conn->rx.plot, free);
queue_destroy(conn->tx.plot, free);
queue_destroy(conn->chan_list, chan_destroy);
@@ -465,6 +478,7 @@ static void command_pkt(struct timeval *tv, uint16_t index,
}
static void evt_conn_complete(struct hci_dev *dev, struct timeval *tv,
+ unsigned long frame,
const void *data, uint16_t size)
{
const struct bt_hci_evt_conn_complete *evt = data;
@@ -478,10 +492,12 @@ static void evt_conn_complete(struct hci_dev *dev, struct timeval *tv,
return;
memcpy(conn->bdaddr, evt->bdaddr, 6);
+ conn->frame_connected = frame;
conn->setup_seen = true;
}
static void evt_disconnect_complete(struct hci_dev *dev, struct timeval *tv,
+ unsigned long frame,
const void *data, uint16_t size)
{
const struct bt_hci_evt_disconnect_complete *evt = data;
@@ -494,6 +510,8 @@ static void evt_disconnect_complete(struct hci_dev *dev, struct timeval *tv,
if (!conn)
return;
+ conn->frame_disconnected = frame;
+ conn->disconnect_reason = evt->reason;
conn->terminated = true;
}
@@ -555,6 +573,7 @@ static void plot_add(struct queue *queue, struct timeval *latency,
}
static void evt_le_conn_complete(struct hci_dev *dev, struct timeval *tv,
+ unsigned long frame,
struct iovec *iov)
{
const struct bt_hci_evt_le_conn_complete *evt;
@@ -569,10 +588,13 @@ static void evt_le_conn_complete(struct hci_dev *dev, struct timeval *tv,
return;
memcpy(conn->bdaddr, evt->peer_addr, 6);
+ conn->bdaddr_type = evt->peer_addr_type;
+ conn->frame_connected = frame;
conn->setup_seen = true;
}
static void evt_le_enh_conn_complete(struct hci_dev *dev, struct timeval *tv,
+ unsigned long frame,
struct iovec *iov)
{
const struct bt_hci_evt_le_enhanced_conn_complete *evt;
@@ -587,6 +609,8 @@ static void evt_le_enh_conn_complete(struct hci_dev *dev, struct timeval *tv,
return;
memcpy(conn->bdaddr, evt->peer_addr, 6);
+ conn->bdaddr_type = evt->peer_addr_type;
+ conn->frame_connected = frame;
conn->setup_seen = true;
}
@@ -640,6 +664,7 @@ static void evt_num_completed_packets(struct hci_dev *dev, struct timeval *tv,
}
static void evt_sync_conn_complete(struct hci_dev *dev, struct timeval *tv,
+ unsigned long frame,
const void *data, uint16_t size)
{
const struct bt_hci_evt_sync_conn_complete *evt = data;
@@ -653,10 +678,12 @@ static void evt_sync_conn_complete(struct hci_dev *dev, struct timeval *tv,
return;
memcpy(conn->bdaddr, evt->bdaddr, 6);
+ conn->frame_connected = frame;
conn->setup_seen = true;
}
static void evt_le_cis_established(struct hci_dev *dev, struct timeval *tv,
+ unsigned long frame,
struct iovec *iov)
{
const struct bt_hci_evt_le_cis_established *evt;
@@ -671,6 +698,7 @@ static void evt_le_cis_established(struct hci_dev *dev, struct timeval *tv,
if (!conn)
return;
+ conn->frame_connected = frame;
conn->setup_seen = true;
link = link_lookup(dev, conn->handle);
@@ -696,6 +724,7 @@ static void evt_le_cis_req(struct hci_dev *dev, struct timeval *tv,
}
static void evt_le_big_complete(struct hci_dev *dev, struct timeval *tv,
+ unsigned long frame,
struct iovec *iov)
{
const struct bt_hci_evt_le_big_complete *evt;
@@ -713,12 +742,15 @@ static void evt_le_big_complete(struct hci_dev *dev, struct timeval *tv,
return;
conn = conn_lookup_type(dev, handle, BTMON_CONN_BIS);
- if (conn)
+ if (conn) {
conn->setup_seen = true;
+ conn->frame_connected = frame;
+ }
}
}
static void evt_le_big_sync_established(struct hci_dev *dev, struct timeval *tv,
+ unsigned long frame,
struct iovec *iov)
{
const struct bt_hci_evt_le_big_sync_estabilished *evt;
@@ -736,12 +768,15 @@ static void evt_le_big_sync_established(struct hci_dev *dev, struct timeval *tv,
return;
conn = conn_lookup_type(dev, handle, BTMON_CONN_BIS);
- if (conn)
+ if (conn) {
conn->setup_seen = true;
+ conn->frame_connected = frame;
+ }
}
}
static void evt_le_meta_event(struct hci_dev *dev, struct timeval *tv,
+ unsigned long frame,
const void *data, uint16_t size)
{
struct iovec iov = {
@@ -755,27 +790,28 @@ static void evt_le_meta_event(struct hci_dev *dev, struct timeval *tv,
switch (subevt) {
case BT_HCI_EVT_LE_CONN_COMPLETE:
- evt_le_conn_complete(dev, tv, &iov);
+ evt_le_conn_complete(dev, tv, frame, &iov);
break;
case BT_HCI_EVT_LE_ENHANCED_CONN_COMPLETE:
- evt_le_enh_conn_complete(dev, tv, &iov);
+ evt_le_enh_conn_complete(dev, tv, frame, &iov);
break;
case BT_HCI_EVT_LE_CIS_ESTABLISHED:
- evt_le_cis_established(dev, tv, &iov);
+ evt_le_cis_established(dev, tv, frame, &iov);
break;
case BT_HCI_EVT_LE_CIS_REQ:
evt_le_cis_req(dev, tv, &iov);
break;
case BT_HCI_EVT_LE_BIG_COMPLETE:
- evt_le_big_complete(dev, tv, &iov);
+ evt_le_big_complete(dev, tv, frame, &iov);
break;
case BT_HCI_EVT_LE_BIG_SYNC_ESTABILISHED:
- evt_le_big_sync_established(dev, tv, &iov);
+ evt_le_big_sync_established(dev, tv, frame, &iov);
break;
}
}
static void event_pkt(struct timeval *tv, uint16_t index,
+ unsigned long frame,
const void *data, uint16_t size)
{
const struct bt_hci_evt_hdr *hdr = data;
@@ -793,10 +829,10 @@ static void event_pkt(struct timeval *tv, uint16_t index,
switch (hdr->evt) {
case BT_HCI_EVT_CONN_COMPLETE:
- evt_conn_complete(dev, tv, data, size);
+ evt_conn_complete(dev, tv, frame, data, size);
break;
case BT_HCI_EVT_DISCONNECT_COMPLETE:
- evt_disconnect_complete(dev, tv, data, size);
+ evt_disconnect_complete(dev, tv, frame, data, size);
break;
case BT_HCI_EVT_CMD_COMPLETE:
evt_cmd_complete(dev, tv, data, size);
@@ -805,10 +841,10 @@ static void event_pkt(struct timeval *tv, uint16_t index,
evt_num_completed_packets(dev, tv, data, size);
break;
case BT_HCI_EVT_SYNC_CONN_COMPLETE:
- evt_sync_conn_complete(dev, tv, data, size);
+ evt_sync_conn_complete(dev, tv, frame, data, size);
break;
case BT_HCI_EVT_LE_META_EVENT:
- evt_le_meta_event(dev, tv, data, size);
+ evt_le_meta_event(dev, tv, frame, data, size);
break;
}
}
@@ -1047,6 +1083,7 @@ void analyze_trace(const char *path)
{
struct btsnoop *btsnoop_file;
unsigned long num_packets = 0;
+ unsigned long num_frames = 0;
uint32_t format;
btsnoop_file = btsnoop_open(path, BTSNOOP_FLAG_PKLG_SUPPORT);
@@ -1084,21 +1121,27 @@ void analyze_trace(const char *path)
del_index(&tv, index, buf, pktlen);
break;
case BTSNOOP_OPCODE_COMMAND_PKT:
+ num_frames++;
command_pkt(&tv, index, buf, pktlen);
break;
case BTSNOOP_OPCODE_EVENT_PKT:
- event_pkt(&tv, index, buf, pktlen);
+ num_frames++;
+ event_pkt(&tv, index, num_frames, buf, pktlen);
break;
case BTSNOOP_OPCODE_ACL_TX_PKT:
+ num_frames++;
acl_pkt(&tv, index, true, buf, pktlen);
break;
case BTSNOOP_OPCODE_ACL_RX_PKT:
+ num_frames++;
acl_pkt(&tv, index, false, buf, pktlen);
break;
case BTSNOOP_OPCODE_SCO_TX_PKT:
+ num_frames++;
sco_pkt(&tv, index, true, buf, pktlen);
break;
case BTSNOOP_OPCODE_SCO_RX_PKT:
+ num_frames++;
sco_pkt(&tv, index, false, buf, pktlen);
break;
case BTSNOOP_OPCODE_OPEN_INDEX:
@@ -1123,9 +1166,11 @@ void analyze_trace(const char *path)
ctrl_msg(&tv, index, buf, pktlen);
break;
case BTSNOOP_OPCODE_ISO_TX_PKT:
+ num_frames++;
iso_pkt(&tv, index, true, buf, pktlen);
break;
case BTSNOOP_OPCODE_ISO_RX_PKT:
+ num_frames++;
iso_pkt(&tv, index, false, buf, pktlen);
break;
default:
--
2.52.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* RE: [BlueZ,v1,1/8] doc/btmon: Add missing documentation
2026-02-19 16:22 [PATCH BlueZ v1 1/8] doc/btmon: Add missing documentation Luiz Augusto von Dentz
` (6 preceding siblings ...)
2026-02-19 16:22 ` [PATCH BlueZ v1 8/8] monitor: Add connection lifecycle to analyze summary Luiz Augusto von Dentz
@ 2026-02-19 17:57 ` bluez.test.bot
7 siblings, 0 replies; 9+ messages in thread
From: bluez.test.bot @ 2026-02-19 17:57 UTC (permalink / raw)
To: linux-bluetooth, luiz.dentz
[-- Attachment #1: Type: text/plain, Size: 1812 bytes --]
This is automated email and please do not reply to this email!
Dear submitter,
Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=1055603
---Test result---
Test Summary:
CheckPatch PENDING 0.44 seconds
GitLint PENDING 0.48 seconds
BuildEll PASS 21.54 seconds
BluezMake PASS 642.32 seconds
MakeCheck PASS 18.62 seconds
MakeDistcheck PASS 252.23 seconds
CheckValgrind PASS 298.02 seconds
CheckSmatch WARNING 361.63 seconds
bluezmakeextell PASS 184.14 seconds
IncrementalBuild PENDING 0.32 seconds
ScanBuild PASS 1063.68 seconds
Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:
##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:
##############################
Test: CheckSmatch - WARNING
Desc: Run smatch tool with source
Output:
monitor/packet.c:1993:26: warning: Variable length array is used.monitor/packet.c: note: in included file:monitor/bt.h:3866:52: warning: array of flexible structuresmonitor/bt.h:3854:40: warning: array of flexible structuresmonitor/packet.c:1993:26: warning: Variable length array is used.monitor/packet.c: note: in included file:monitor/bt.h:3866:52: warning: array of flexible structuresmonitor/bt.h:3854:40: warning: array of flexible structures
##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2026-02-19 17:57 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-19 16:22 [PATCH BlueZ v1 1/8] doc/btmon: Add missing documentation Luiz Augusto von Dentz
2026-02-19 16:22 ` [PATCH BlueZ v1 2/8] doc/btmon: Add dedicate sections for timestamp and frame number Luiz Augusto von Dentz
2026-02-19 16:22 ` [PATCH BlueZ v1 3/8] doc/btmon: Add connection tracking section Luiz Augusto von Dentz
2026-02-19 16:22 ` [PATCH BlueZ v1 4/8] doc/btmon: Add a dedicated section for analyze mode Luiz Augusto von Dentz
2026-02-19 16:22 ` [PATCH BlueZ v1 5/8] doc/btmon: Add a section for automated trace analysis Luiz Augusto von Dentz
2026-02-19 16:22 ` [PATCH BlueZ v1 6/8] monitor: Annotate ACL/SCO/ISO data with device address Luiz Augusto von Dentz
2026-02-19 16:22 ` [PATCH BlueZ v1 7/8] monitor: Print connection type in Disconnect Complete Luiz Augusto von Dentz
2026-02-19 16:22 ` [PATCH BlueZ v1 8/8] monitor: Add connection lifecycle to analyze summary Luiz Augusto von Dentz
2026-02-19 17:57 ` [BlueZ,v1,1/8] doc/btmon: Add missing documentation bluez.test.bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox