From patchwork Mon Jan 23 18:59:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Omar Sandoval X-Patchwork-Id: 9533361 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DC0B360434 for ; Mon, 23 Jan 2017 19:00:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CF16D2833F for ; Mon, 23 Jan 2017 19:00:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C3CD02841D; Mon, 23 Jan 2017 19:00:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 728662833F for ; Mon, 23 Jan 2017 19:00:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751476AbdAWTA1 (ORCPT ); Mon, 23 Jan 2017 14:00:27 -0500 Received: from mail-pg0-f50.google.com ([74.125.83.50]:33003 "EHLO mail-pg0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751243AbdAWTAV (ORCPT ); Mon, 23 Jan 2017 14:00:21 -0500 Received: by mail-pg0-f50.google.com with SMTP id 204so47203250pge.0 for ; Mon, 23 Jan 2017 11:00:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osandov-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=SkcpqSGXtLLI8QiYaKdYm19OAA3SAlnoWuM/ZKMv/IE=; b=Y4RgM1Gz/5WxtOMCDKR+8fA9LiY/toEwbaCgBgcNosj5bVbZ1672FoPLyPkxZ5SGZD R4a3dt6gw1P2TL/P3Too0dBDhMQQLCueU5D6etJ9ENnh2yeV/vD9hP0YhNkwDC0VzkCd ReT86w/IRijdEQ/y9O5FXAmVYGPcU4aIy4zDAPtjHkJza0/7erycbvTZEqaJACrATZce 9DMMgk+mS2yTp0rcEdnuF8GBtW3FlfT3082fNU6fqugLs821MuU1O78yZxdBn1I5ipCC BUlF76wv8ZymDFHX/4YGdNpMD8fVRgYNhIhwxXR2mH3ugnK3/EGvxqkMCoGJvnfTmWmO 0BPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=SkcpqSGXtLLI8QiYaKdYm19OAA3SAlnoWuM/ZKMv/IE=; b=e5v92K+8WhV1/IHGDdUahIUtN48A7KhtFQ3LRSWIYulaorJ+DeBZ3h4tkBLnGscsdH RfyCKzFsRLzkWDebaU4Ha4uRIo/vTIeEsp4+HJLmgGK2ei2+6j70I1Azq/KvpzYbUR6x 7NYO0ui3sBXWQKdUSJhfFldbtAspVLQQSxZoQ8scoCqBKddHMdEEt6q7OLdwvA+Go6TX pIoTaaWTD1kfqwuU9hiWh2ChPusdYqkD+MMdVJPrnhKkhrscPpTD3ZEY8BL8HtQMywCE Y0ri+l2rJ1bC/hNtPlaNFNYOEBXxU1YizL0ZZl/b6fnhj976MdBZtNSmZbMnenYlBEuV LWTQ== X-Gm-Message-State: AIkVDXIX+/Ot/iapKT9D6A9cbUxO4KYjXBIEEoq7OT6c9YK5wUNVOR0a1+RD9RSfjHgaqdnp X-Received: by 10.84.216.70 with SMTP id f6mr45499759plj.10.1485198020689; Mon, 23 Jan 2017 11:00:20 -0800 (PST) Received: from vader.thefacebook.com ([2620:10d:c090:200::d:6f]) by smtp.gmail.com with ESMTPSA id j185sm38869867pgd.35.2017.01.23.11.00.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Jan 2017 11:00:20 -0800 (PST) From: Omar Sandoval To: Jens Axboe , linux-block@vger.kernel.org Cc: kernel-team@fb.com Subject: [PATCH 02/10] blk-mq: add hctx->{state,flags} to debugfs Date: Mon, 23 Jan 2017 10:59:39 -0800 Message-Id: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Omar Sandoval 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 --- block/blk-mq-debugfs.c | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) 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; +} + +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; +} + +static int hctx_flags_open(struct inode *inode, struct file *file) +{ + return single_open(file, hctx_flags_show, inode->i_private); +} + +static const struct file_operations hctx_flags_fops = { + .open = hctx_flags_open, + .read = seq_read, + .llseek = seq_lseek, + .release = single_release, +}; + static const struct blk_mq_debugfs_attr blk_mq_debugfs_hctx_attrs[] = { + {"state", 0400, &hctx_state_fops}, + {"flags", 0400, &hctx_flags_fops}, }; static const struct blk_mq_debugfs_attr blk_mq_debugfs_ctx_attrs[] = {