All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <Bart.VanAssche@sandisk.com>
To: "osandov@osandov.com" <osandov@osandov.com>,
	"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
	"axboe@fb.com" <axboe@fb.com>
Cc: "kernel-team@fb.com" <kernel-team@fb.com>
Subject: Re: [PATCH v3 05/10] sbitmap: add helpers for dumping to a seq_file
Date: Fri, 27 Jan 2017 22:06:32 +0000	[thread overview]
Message-ID: <1485554768.13218.8.camel@sandisk.com> (raw)
In-Reply-To: <20a158eb0622e89cd16d1c112952908561f6b0e3.1485382647.git.osandov@fb.com>

On Wed, 2017-01-25 at 14:32 -0800, Omar Sandoval wrote:
> From: Omar Sandoval <osandov@fb.com>
>=20
> This is useful debugging information that will be used in the blk-mq
> debugfs directory.
>=20
> Reviewed-by: Hannes Reinecke <hare@suse.com>
> Signed-off-by: Omar Sandoval <osandov@fb.com>
> ---
> Jens took offense to me making the bitmap dumps binary, so this turns the=
m into
> nicely formatted hex dumps, like this one:
>=20
> # cat /sys/kernel/debug/block/nvme0n1/mq/0/tags_bitmap
> 00000000: 0000 0000 0000 0000 0000 0000 0000 0000
> 00000010: 0000 2000 0000 0000 0000 0000 0000 0000
> 00000020: 0000 0000 0000 0000 0000 0000 0000 0000
> 00000030: 0000 0000 0000 0000 0000 0000 0000 0000
> 00000040: 0000 0000 0000 0000 0000 0000 0000 0000
> 00000050: 0000 0000 0000 0000 0000 0000 0000 0000
> 00000060: 0000 0000 0000 0000 0000 0000 0000 0000
> 00000070: 0000 0000 0000 0000 0000 0000 0000 0000
>=20
> I decided to go with this format because 1) it's consistent with
> print_hex_dump() already in the kernel, and 2) it's much easier to read
> than a string of bits or hex values. In the example above, it's easy to
> see that byte 0x12 is set to 0x20 (and do some arithmetic from there to
> figure out that the stuck bit is 149).

Hello Omar,

Have you considered to convert the bitmap into a contiguous bitmap first
and to format that bitmap with snprintf(..., "%*pb", ...)? I think that
will result in even easier to read output.

Bart.=

  reply	other threads:[~2017-01-27 22:06 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-25 16:06 [PATCH v2 00/10] blk-mq: move debugging information from sysfs to debugfs Omar Sandoval
2017-01-25 16:06 ` [PATCH v2 01/10] blk-mq: create debugfs directory tree Omar Sandoval
2017-01-27 21:56   ` Bart Van Assche
2017-01-25 16:06 ` [PATCH v2 02/10] blk-mq: add hctx->{state,flags} to debugfs Omar Sandoval
2017-01-25 16:06 ` [PATCH v2 03/10] blk-mq: move hctx->dispatch and ctx->rq_list from sysfs " Omar Sandoval
2017-01-27 22:00   ` Bart Van Assche
2017-01-27 22:03     ` Omar Sandoval
2017-01-25 16:06 ` [PATCH v2 04/10] blk-mq: add extra request information " Omar Sandoval
2017-01-25 16:06 ` [PATCH v2 05/10] sbitmap: add helpers for dumping to a seq_file Omar Sandoval
2017-01-25 22:32   ` [PATCH v3 " Omar Sandoval
2017-01-27 22:06     ` Bart Van Assche [this message]
2017-01-25 16:06 ` [PATCH v2 06/10] blk-mq: export software queue pending map to debugfs Omar Sandoval
2017-01-25 16:06 ` [PATCH v2 07/10] blk-mq: move tags and sched_tags info from sysfs " Omar Sandoval
2017-01-25 16:06 ` [PATCH v2 08/10] blk-mq: add tags and sched_tags bitmaps " Omar Sandoval
2017-01-25 16:06 ` [PATCH v2 09/10] blk-mq: move hctx io_poll, stats, and dispatched from sysfs " Omar Sandoval
2017-01-25 16:06 ` [PATCH v2 10/10] blk-mq: move hctx and ctx counters " Omar Sandoval
2017-01-27 15:18 ` [PATCH v2 00/10] blk-mq: move debugging information " Jens Axboe

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=1485554768.13218.8.camel@sandisk.com \
    --to=bart.vanassche@sandisk.com \
    --cc=axboe@fb.com \
    --cc=kernel-team@fb.com \
    --cc=linux-block@vger.kernel.org \
    --cc=osandov@osandov.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.