From patchwork Thu Mar 15 10:42:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Coly Li X-Patchwork-Id: 10284213 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 08F2960386 for ; Thu, 15 Mar 2018 10:43:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 98B7A27F88 for ; Thu, 15 Mar 2018 10:43:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8DD0628740; Thu, 15 Mar 2018 10:43:12 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 29C4C27F88 for ; Thu, 15 Mar 2018 10:43:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751666AbeCOKnJ (ORCPT ); Thu, 15 Mar 2018 06:43:09 -0400 Received: from mx2.suse.de ([195.135.220.15]:54831 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751977AbeCOKnH (ORCPT ); Thu, 15 Mar 2018 06:43:07 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 6F2B9AECC; Thu, 15 Mar 2018 10:43:06 +0000 (UTC) From: Coly Li To: linux-bcache@vger.kernel.org Cc: linux-block@vger.kernel.org, Coly Li Subject: [PATCH 3/4] bcache-tools: print more super block information in bcache-super-show Date: Thu, 15 Mar 2018 18:42:39 +0800 Message-Id: <20180315104240.24647-4-colyli@suse.de> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180315104240.24647-1-colyli@suse.de> References: <20180315104240.24647-1-colyli@suse.de> 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 This patch prints out more super block information. The more detailed and exact information is helpful to analyse and debug cache device and backing device states. Signed-off-by: Coly Li --- bcache-super-show.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/bcache-super-show.c b/bcache-super-show.c index 515c596..2d46cac 100644 --- a/bcache-super-show.c +++ b/bcache-super-show.c @@ -131,12 +131,18 @@ int main(int argc, char **argv) case BCACHE_SB_VERSION_CDEV: case BCACHE_SB_VERSION_CDEV_WITH_UUID: printf(" [cache device]\n"); + printf("sb.nbuckets\t\t%" PRIu64 "\n", sb.nbuckets); + printf("sb.bucket_size\t\t%d\n", sb.bucket_size); + printf("sb.nr_in_set\t\t%d\n", sb.nr_in_set); + printf("sb.nr_this_dev\t\t%d\n", sb.nr_this_dev); break; // The second adds data offset support case BCACHE_SB_VERSION_BDEV: case BCACHE_SB_VERSION_BDEV_WITH_OFFSET: printf(" [backing device]\n"); + printf("sb.data_offset\t\t%" PRIu64 "\n", + sb.data_offset); break; default: @@ -145,6 +151,14 @@ int main(int argc, char **argv) return 0; } + printf("sb.block_size\t\t%d\n", sb.block_size); + printf("sb.offset\t\t%" PRIu64 "\n", sb.offset); + printf("sb.flags\t\t%" PRIx64 "\n", sb.flags); + printf("sb.seq\t\t\t%" PRIu64 "\n", sb.seq); + printf("sb.last_mount\t\t%" PRIu32 "\n", sb.last_mount); + printf("sb.first_bucket\t\t%d\n", sb.first_bucket); + printf("sb.keys\t\t\t%d\n", sb.keys); + putchar('\n'); char label[SB_LABEL_SIZE + 1];