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 v1 0/6] monitor: Search the frames with a pager
Date: Thu, 17 Sep 2026 16:45:35 -0400	[thread overview]
Message-ID: <20260917204541.2176720-1-luiz.dentz@gmail.com> (raw)

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

A frame spans several lines, and what identifies one is spread between
its header and its contents: the header says which controller and when,
the body says what happened. Searching a trace a line at a time finds the
line reporting an error without any of that context.

This series makes the frames searchable as whole entries:

  $ btmon                            # then press Ctrl-R
  $ btmon -r hcidump.log
  $ btmon -r hcidump.log --print0 | fzf --read0

Patch 1 sends the decoding output through one function so that a frame
can be observed as a whole. It is a pure redirection and the output is
unchanged.

Patch 2 separates the frames with a NUL when something is going to read
them as records, asked for by --print0 or by --read0 already being in
PAGER. Nothing is separated otherwise, so a pager reading lines and
redirected output are both untouched.

Patches 3 and 4 hand the frames seen so far to the pager on Ctrl-R while
capturing. The capture is never paused for this, as anything not read in
time is dropped by the kernel, and whatever arrives while the pager is up
is printed once it closes so the trace on the terminal has no gap.

Patches 5 and 6 use fzf when PAGER is not set and it is installed, since
it suits a trace far better than a plain pager, giving it --ansi and
--read0 wherever it is used.

Luiz Augusto von Dentz (6):
  monitor: Route the decoding output through a single function
  monitor: Separate the frames for a pager reading records
  monitor: Hand the captured frames to the pager on Ctrl-R
  doc/btmon: Document searching the frames
  monitor: Prefer fzf as the pager when one is not set
  doc/btmon: Document the pager choice

 Makefile.tools    |   1 +
 doc/btmon.rst     |  64 ++++++
 monitor/analyze.c |  44 ++--
 monitor/avctp.c   |  68 +++----
 monitor/control.c | 163 ++++++++-------
 monitor/display.c |  93 ++++++++-
 monitor/display.h |  14 +-
 monitor/find.c    | 499 ++++++++++++++++++++++++++++++++++++++++++++++
 monitor/find.h    |  19 ++
 monitor/l2cap.c   |  34 ++--
 monitor/lmp.c     |   4 +-
 monitor/main.c    |  28 ++-
 monitor/packet.c  |  18 +-
 monitor/rfcomm.c  |   6 +-
 tools/l2test.c    |  10 +
 15 files changed, 891 insertions(+), 174 deletions(-)
 create mode 100644 monitor/find.c
 create mode 100644 monitor/find.h

-- 
2.55.0


             reply	other threads:[~2026-09-17 20:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-17 20:45 Luiz Augusto von Dentz [this message]
2026-09-17 20:45 ` [PATCH BlueZ v1 1/6] monitor: Route the decoding output through a single function Luiz Augusto von Dentz
2026-09-17 23:55   ` monitor: Search the frames with a pager bluez.test.bot
2026-09-17 20:45 ` [PATCH BlueZ v1 2/6] monitor: Separate the frames for a pager reading records Luiz Augusto von Dentz
2026-09-17 20:45 ` [PATCH BlueZ v1 3/6] monitor: Hand the captured frames to the pager on Ctrl-R Luiz Augusto von Dentz
2026-09-17 20:45 ` [PATCH BlueZ v1 4/6] doc/btmon: Document searching the frames Luiz Augusto von Dentz
2026-09-17 20:45 ` [PATCH BlueZ v1 5/6] monitor: Prefer fzf as the pager when one is not set Luiz Augusto von Dentz
2026-09-17 20:45 ` [PATCH BlueZ v1 6/6] doc/btmon: Document the pager choice Luiz Augusto von Dentz

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=20260917204541.2176720-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