Linux block layer
 help / color / mirror / Atom feed
* [PATCH blktests 0/3] introduce command trace feature
@ 2026-05-13 11:23 Shin'ichiro Kawasaki
  2026-05-13 11:23 ` [PATCH blktests 1/3] check: add --cmd-trace option Shin'ichiro Kawasaki
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Shin'ichiro Kawasaki @ 2026-05-13 11:23 UTC (permalink / raw)
  To: linux-block; +Cc: Daniel Wagner, John Meneghini, Shin'ichiro Kawasaki

Some blktests test cases have deep nesting, making their behavior
difficult to understand. For example, the nvme test group has many
helper functions that set sysfs attribute values and call nvme-cli
commands. Understanding these behaviors is essential for debugging test
case failures.

This series adds a new 'command trace' feature to blktests. The first
patch introduces a new --cmd-trace (or -t) option to record commands
executed during test runs. The second and third patches add a new helper
function _echo(), which traces both the value and file name of sysfs
attribute writes.

With this series, blktests users can use the option to generate a
.cmdtrace file that records all commands executed during a test case
run. By grepping the .cmdtrace file, users can check writes to sysfs
attributes and nvme-cli command invocations. The example below shows how
nvme targets are set up for the nvme/008 test case with rdma transport.

# NVMET_TRTYPES=rdma NVMET_BLKDEV_TYPES=device ./check --cmd-trace nvme/008
nvme/008 (tr=rdma bd=device) (create an NVMeOF host)         [passed]
    runtime  1.903s  ...  1.890s
# grep -e _echo -e "nvme " results/nodev_tr_rdma_bd_device/nvme/008.cmdtrace
+ _echo 0 /sys/kernel/config/nvmet/subsystems/blktests-subsystem-1/attr_allow_any_host
+ _echo /dev/loop0 /sys/kernel/config/nvmet/subsystems/blktests-subsystem-1/namespaces/1/device_path
+ _echo 91fdba0d-f87b-4c25-b80f-db7be1418b9e /sys/kernel/config/nvmet/subsystems/blktests-subsystem-1/namespaces/1/device_uuid
+ _echo 1 /sys/kernel/config/nvmet/subsystems/blktests-subsystem-1/namespaces/1/enable
++ _echo rdma /sys/kernel/config/nvmet/ports/0/addr_trtype
++ _echo 10.0.2.15 /sys/kernel/config/nvmet/ports/0/addr_traddr
++ _echo ipv4 /sys/kernel/config/nvmet/ports/0/addr_adrfam
++ _echo 4420 /sys/kernel/config/nvmet/ports/0/addr_trsvcid
++ nvme connect --traddr 10.0.2.15 --transport rdma --trsvcid 4420 --nqn blktests-subsystem-1 --hostnqn=nqn.2014-08.org.nvmexpress:uuid:0f01fb42-9f7f-4856-b0b3-51e60b8de349 --hostid=0f01fb42-9f7f-4856-b0b3-51e60b8de349 --output-format=json
+ nvme disconnect --nqn blktests-subsystem-1
+ _echo 0 /sys/kernel/config/nvmet/subsystems/blktests-subsystem-1/namespaces/1/enable


P.S. The idea of command trace came from the hallway discussion at LSFMMBPF
     2026 with John Meneghini and Daniel Wagner. Thanks!

Shin'ichiro Kawasaki (3):
  check: add --cmd-trace option
  common/rc: add _echo() function to trace sysfs attribute writes
  common/nvme, nvme/rc: use _echo() to trace sysfs attribute writes

 check         | 17 ++++++++++++++-
 common/nvme   | 34 ++++++++++++++---------------
 common/rc     |  6 ++++++
 tests/nvme/rc | 60 +++++++++++++++++++++++++--------------------------
 4 files changed, 68 insertions(+), 49 deletions(-)

-- 
2.54.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-05-13 17:17 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-13 11:23 [PATCH blktests 0/3] introduce command trace feature Shin'ichiro Kawasaki
2026-05-13 11:23 ` [PATCH blktests 1/3] check: add --cmd-trace option Shin'ichiro Kawasaki
2026-05-13 17:08   ` Bart Van Assche
2026-05-13 11:23 ` [PATCH blktests 2/3] common/rc: add _echo() function to trace sysfs attribute writes Shin'ichiro Kawasaki
2026-05-13 14:05   ` Daniel Wagner
2026-05-13 17:07     ` Bart Van Assche
2026-05-13 17:17   ` Bart Van Assche
2026-05-13 11:23 ` [PATCH blktests 3/3] common/nvme, nvme/rc: use _echo() " Shin'ichiro Kawasaki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox