Linux-Block Archive on
 help / color / Atom feed
From: Chaitanya Kulkarni <>
	Chaitanya Kulkarni <>
Subject: [PATCH 0/3] null_blk: add tracnepoints for zoned mode
Date: Fri, 14 Feb 2020 16:57:55 -0800
Message-ID: <> (raw)


Recently we've added several new operations for zoned block devices
blk-zone.c ZBD). These operations have a direct effect on the
zone-state machine present in the null_blk_zoned.c. 

This will allow us to add new testcases in blktests in order to verify
the correct operations on the driver side.

This is a small patch series which adds tracepoints for the null_blk
block driver when configured in a zoned mode (with command line
parameter zoned=1).

The first patch is a prep patch that adds a helper to stringify zone
conditions which we use in the trace, the second patch adds new
tracepoint definitions and the third patch allows null_blk_zoned to
trace operations.

Please have a look at the end for sample output.

P.S. I've kept the helper function blk_zone_cond_str() into header
file, please let me know if it needs to be in the blk-zoned.c.


Chaitanya Kulkarni (3):
  block: add zone condition debug helpers
  null_blk: add tracepoint helpers for zoned mode
  null_blk: add trace in null_blk_zoned.c

 block/blk-zoned.c              | 14 ++++++
 drivers/block/Makefile         |  3 ++
 drivers/block/null_blk_trace.c | 20 +++++++++
 drivers/block/null_blk_trace.h | 78 ++++++++++++++++++++++++++++++++++
 drivers/block/null_blk_zoned.c | 12 +++++-
 include/linux/blkdev.h         | 26 ++++++++++++
 include/uapi/linux/blkzoned.h  |  1 +
 7 files changed, 153 insertions(+), 1 deletion(-)
 create mode 100644 drivers/block/null_blk_trace.c
 create mode 100644 drivers/block/null_blk_trace.h

Sample Test Output :-

# modprobe null_blk zoned=1 zone_size=128 gb=1 bs=4096
# cd /sys/kernel/debug/tracing/
# echo 1 > events/nullb/enable; cat trace_pipe 
# for i in open close finish reset; do blkzone $i /dev/nullb0; done 
# dd if=/dev/zero of=/dev/nullb0 bs=4k count=5

nullb_zone_op: disk=nullb0,  req=ZONE_OPEN       zone_no=0 zone_cond=EXP_OPEN  
nullb_zone_op: disk=nullb0,  req=ZONE_OPEN       zone_no=1 zone_cond=EXP_OPEN  
nullb_zone_op: disk=nullb0,  req=ZONE_OPEN       zone_no=2 zone_cond=EXP_OPEN  
nullb_zone_op: disk=nullb0,  req=ZONE_OPEN       zone_no=3 zone_cond=EXP_OPEN  
nullb_zone_op: disk=nullb0,  req=ZONE_OPEN       zone_no=4 zone_cond=EXP_OPEN  
nullb_zone_op: disk=nullb0,  req=ZONE_OPEN       zone_no=5 zone_cond=EXP_OPEN  
nullb_zone_op: disk=nullb0,  req=ZONE_OPEN       zone_no=6 zone_cond=EXP_OPEN  
nullb_zone_op: disk=nullb0,  req=ZONE_OPEN       zone_no=7 zone_cond=EXP_OPEN  
nullb_zone_op: disk=nullb0,  req=ZONE_CLOSE      zone_no=0 zone_cond=EMPTY     
nullb_zone_op: disk=nullb0,  req=ZONE_CLOSE      zone_no=1 zone_cond=EMPTY     
nullb_zone_op: disk=nullb0,  req=ZONE_CLOSE      zone_no=2 zone_cond=EMPTY     
nullb_zone_op: disk=nullb0,  req=ZONE_CLOSE      zone_no=3 zone_cond=EMPTY     
nullb_zone_op: disk=nullb0,  req=ZONE_CLOSE      zone_no=4 zone_cond=EMPTY     
nullb_zone_op: disk=nullb0,  req=ZONE_CLOSE      zone_no=5 zone_cond=EMPTY     
nullb_zone_op: disk=nullb0,  req=ZONE_CLOSE      zone_no=6 zone_cond=EMPTY     
nullb_zone_op: disk=nullb0,  req=ZONE_CLOSE      zone_no=7 zone_cond=EMPTY     
nullb_zone_op: disk=nullb0,  req=ZONE_FINISH     zone_no=0 zone_cond=FULL      
nullb_zone_op: disk=nullb0,  req=ZONE_FINISH     zone_no=1 zone_cond=FULL      
nullb_zone_op: disk=nullb0,  req=ZONE_FINISH     zone_no=2 zone_cond=FULL      
nullb_zone_op: disk=nullb0,  req=ZONE_FINISH     zone_no=3 zone_cond=FULL      
nullb_zone_op: disk=nullb0,  req=ZONE_FINISH     zone_no=4 zone_cond=FULL      
nullb_zone_op: disk=nullb0,  req=ZONE_FINISH     zone_no=5 zone_cond=FULL      
nullb_zone_op: disk=nullb0,  req=ZONE_FINISH     zone_no=6 zone_cond=FULL      
nullb_zone_op: disk=nullb0,  req=ZONE_FINISH     zone_no=7 zone_cond=FULL      
nullb_zone_op: disk=nullb0,  req=ZONE_RESET_ALL  zone_no=0 zone_cond=EMPTY 
nullb_zone_op: disk=nullb0,  req=WRITE           zone_no=0 zone_cond=IMP_OPEN  
nullb_zone_op: disk=nullb0,  req=WRITE           zone_no=0 zone_cond=IMP_OPEN  
nullb_zone_op: disk=nullb0,  req=WRITE           zone_no=0 zone_cond=IMP_OPEN  
nullb_zone_op: disk=nullb0,  req=WRITE           zone_no=0 zone_cond=IMP_OPEN  
nullb_zone_op: disk=nullb0,  req=WRITE           zone_no=0 zone_cond=IMP_OPEN

             reply index

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-15  0:57 Chaitanya Kulkarni [this message]
2020-02-15  0:57 ` [PATCH 1/3] block: add a zone condition debug helper Chaitanya Kulkarni
2020-02-17  0:54   ` Damien Le Moal
2020-02-15  0:57 ` [PATCH 2/3] null_blk: add tracepoint helpers for zoned mode Chaitanya Kulkarni
2020-02-17  1:04   ` Damien Le Moal
2020-02-15  0:57 ` [PATCH 3/3] null_blk: add trace in null_blk_zoned.c Chaitanya Kulkarni
2020-02-17  1:05   ` Damien Le Moal

Reply instructions:

You may reply publically 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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-Block Archive on

Archives are clonable:
	git clone --mirror linux-block/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-block linux-block/ \
	public-inbox-index linux-block

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone