From: Chandan Babu R <chandan.babu@oracle.com>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: sandeen@sandeen.net, linux-xfs@vger.kernel.org
Subject: Re: [PATCH 1/2] xfs_db: support computing btheight for all cursor types
Date: Fri, 06 May 2022 15:29:07 +0530 [thread overview]
Message-ID: <87zgjvouc4.fsf@debian-BULLSEYE-live-builder-AMD64> (raw)
In-Reply-To: <165176667420.247073.10421518802460549832.stgit@magnolia>
On 05 May 2022 at 21:34, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
>
> Add the special magic btree type value 'all' to the btheight command so
> that we can display information about all known btree types at once.
>
Looks good.
Reviewed-by: Chandan Babu R <chandan.babu@oracle.com>
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> ---
> db/btheight.c | 26 +++++++++++++++++++++++---
> man/man8/xfs_db.8 | 3 +++
> 2 files changed, 26 insertions(+), 3 deletions(-)
>
>
> diff --git a/db/btheight.c b/db/btheight.c
> index 8aa17c89..e4cd4eda 100644
> --- a/db/btheight.c
> +++ b/db/btheight.c
> @@ -57,7 +57,7 @@ btheight_help(void)
> " -w min -- Show only the worst case scenario.\n"
> "\n"
> " Supported btree types:\n"
> -" "
> +" all "
> ));
> for (i = 0, m = maps; i < ARRAY_SIZE(maps); i++, m++)
> printf("%s ", m->tag);
> @@ -107,7 +107,7 @@ calc_height(
>
> static int
> construct_records_per_block(
> - char *tag,
> + const char *tag,
> int blocksize,
> unsigned int *records_per_block)
> {
> @@ -235,7 +235,7 @@ _("%s: pointer size must be less than selected block size (%u bytes).\n"),
>
> static void
> report(
> - char *tag,
> + const char *tag,
> unsigned int report_what,
> unsigned long long nr_records,
> unsigned int blocksize)
> @@ -297,6 +297,19 @@ _("%s: worst case per %u-byte block: %u records (leaf) / %u keyptrs (node)\n"),
> }
> }
>
> +static void
> +report_all(
> + unsigned int report_what,
> + unsigned long long nr_records,
> + unsigned int blocksize)
> +{
> + struct btmap *m;
> + int i;
> +
> + for (i = 0, m = maps; i < ARRAY_SIZE(maps); i++, m++)
> + report(m->tag, report_what, nr_records, blocksize);
> +}
> +
> static int
> btheight_f(
> int argc,
> @@ -366,6 +379,13 @@ _("The smallest block size this command will consider is 128 bytes.\n"));
> return 0;
> }
>
> + for (i = optind; i < argc; i++) {
> + if (!strcmp(argv[i], "all")) {
> + report_all(report_what, nr_records, blocksize);
> + return 0;
> + }
> + }
> +
> for (i = optind; i < argc; i++)
> report(argv[i], report_what, nr_records, blocksize);
>
> diff --git a/man/man8/xfs_db.8 b/man/man8/xfs_db.8
> index 58727495..55ac3487 100644
> --- a/man/man8/xfs_db.8
> +++ b/man/man8/xfs_db.8
> @@ -420,6 +420,9 @@ The supported btree types are:
> .IR refcountbt ,
> and
> .IR rmapbt .
> +The magic value
> +.I all
> +can be used to walk through all btree types.
>
> Options are as follows:
> .RS 1.0i
--
chandan
next prev parent reply other threads:[~2022-05-06 9:59 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-05 16:04 [PATCHSET 0/2] xfs_db: tweaks to btheight command Darrick J. Wong
2022-05-05 16:04 ` [PATCH 1/2] xfs_db: support computing btheight for all cursor types Darrick J. Wong
2022-05-06 9:59 ` Chandan Babu R [this message]
2022-05-10 9:40 ` Christoph Hellwig
2022-05-05 16:04 ` [PATCH 2/2] xfs_db: report absolute maxlevels for each btree type Darrick J. Wong
2022-05-06 9:59 ` Chandan Babu R
2022-05-10 9:40 ` Christoph Hellwig
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=87zgjvouc4.fsf@debian-BULLSEYE-live-builder-AMD64 \
--to=chandan.babu@oracle.com \
--cc=djwong@kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=sandeen@sandeen.net \
/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.