Re: [PATCH 02/10] blk-mq: add hctx->{state,flags} to debugfs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 01/23/2017 07:59 PM, Omar Sandoval wrote:
> From: Omar Sandoval <osandov@xxxxxx>
> 
> hctx->state could come in handy for bugs where the hardware queue gets
> stuck in the stopped state, and hctx->flags is just useful to know.
> 
> Signed-off-by: Omar Sandoval <osandov@xxxxxx>
> ---
>  block/blk-mq-debugfs.c | 42 ++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 42 insertions(+)
> 
Hehe. I've found myself adding exactly the same attributes when
debugging mq-deadline :-)

> diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c
> index 01711bbf5ade..0c14511fa9e0 100644
> --- a/block/blk-mq-debugfs.c
> +++ b/block/blk-mq-debugfs.c
> @@ -29,7 +29,49 @@ struct blk_mq_debugfs_attr {
>  
>  static struct dentry *block_debugfs_root;
>  
> +static int hctx_state_show(struct seq_file *m, void *v)
> +{
> +	struct blk_mq_hw_ctx *hctx = m->private;
> +
> +	seq_printf(m, "0x%lx\n", hctx->state);
> +	return 0;
> +}
> +
What about decoding it?
Would make life so much easier, and one doesn't have to have a kernel
source tree available when looking things up...

> +static int hctx_state_open(struct inode *inode, struct file *file)
> +{
> +	return single_open(file, hctx_state_show, inode->i_private);
> +}
> +
> +static const struct file_operations hctx_state_fops = {
> +	.open		= hctx_state_open,
> +	.read		= seq_read,
> +	.llseek		= seq_lseek,
> +	.release	= single_release,
> +};
> +
> +static int hctx_flags_show(struct seq_file *m, void *v)
> +{
> +	struct blk_mq_hw_ctx *hctx = m->private;
> +
> +	seq_printf(m, "0x%lx\n", hctx->flags);
> +	return 0;
> +}
> +
Same argument here.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		   Teamlead Storage & Networking
hare@xxxxxxx			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-block" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux