All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHSET 0/1] xfs_db: improve output of the logres command
@ 2022-06-28 20:50 Darrick J. Wong
  2022-06-28 20:51 ` [PATCH 1/1] xfs_db: identify the minlogsize transaction reservation Darrick J. Wong
  0 siblings, 1 reply; 3+ messages in thread
From: Darrick J. Wong @ 2022-06-28 20:50 UTC (permalink / raw)
  To: sandeen, djwong; +Cc: linux-xfs

Hi all,

Tweak the output of xfs_db's logres command so that it's more obvious
that the last line is the transaction reservation size used to compute
the minimum log size.

If you're going to start using this mess, you probably ought to just
pull from my git trees, which are linked below.

This is an extraordinary way to destroy everything.  Enjoy!
Comments and questions are, as always, welcome.

--D

xfsprogs git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfsprogs-dev.git/log/?h=db-improve-minlogsize-reporting
---
 db/logformat.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/1] xfs_db: identify the minlogsize transaction reservation
  2022-06-28 20:50 [PATCHSET 0/1] xfs_db: improve output of the logres command Darrick J. Wong
@ 2022-06-28 20:51 ` Darrick J. Wong
  2022-06-28 23:22   ` Dave Chinner
  0 siblings, 1 reply; 3+ messages in thread
From: Darrick J. Wong @ 2022-06-28 20:51 UTC (permalink / raw)
  To: sandeen, djwong; +Cc: linux-xfs

From: Darrick J. Wong <djwong@kernel.org>

Right now, we don't make it easy to spot the transaction reservation
used to compute the minimum log size in userspace:

# xfs_db -c logres /dev/sda
type 0 logres 168184 logcount 5 flags 0x4
...
type 25 logres 760 logcount 0 flags 0x0
type -1 logres 547200 logcount 8 flags 0x4

Type "-1" doesn't communicate the purpose at all, it just looks like a
math error.  Help out the user a bit by printing more information:

minlogsize logres 547200 logcount 8

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 db/logformat.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)


diff --git a/db/logformat.c b/db/logformat.c
index 38b0af11..5edaa549 100644
--- a/db/logformat.c
+++ b/db/logformat.c
@@ -160,8 +160,10 @@ logres_f(
 	end_res = (struct xfs_trans_res *)(M_RES(mp) + 1);
 	for (i = 0; res < end_res; i++, res++)
 		print_logres(i, res);
+
 	libxfs_log_get_max_trans_res(mp, &resv);
-	print_logres(-1, &resv);
+	dbprintf(_("minlogsize logres %u logcount %d\n"),
+			resv.tr_logres, resv.tr_logcount);
 
 	return 0;
 }


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] xfs_db: identify the minlogsize transaction reservation
  2022-06-28 20:51 ` [PATCH 1/1] xfs_db: identify the minlogsize transaction reservation Darrick J. Wong
@ 2022-06-28 23:22   ` Dave Chinner
  0 siblings, 0 replies; 3+ messages in thread
From: Dave Chinner @ 2022-06-28 23:22 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: sandeen, linux-xfs

On Tue, Jun 28, 2022 at 01:51:00PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
> 
> Right now, we don't make it easy to spot the transaction reservation
> used to compute the minimum log size in userspace:
> 
> # xfs_db -c logres /dev/sda
> type 0 logres 168184 logcount 5 flags 0x4
> ...
> type 25 logres 760 logcount 0 flags 0x0
> type -1 logres 547200 logcount 8 flags 0x4
> 
> Type "-1" doesn't communicate the purpose at all, it just looks like a
> math error.  Help out the user a bit by printing more information:
> 
> minlogsize logres 547200 logcount 8
> 
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> ---
>  db/logformat.c |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> 
> diff --git a/db/logformat.c b/db/logformat.c
> index 38b0af11..5edaa549 100644
> --- a/db/logformat.c
> +++ b/db/logformat.c
> @@ -160,8 +160,10 @@ logres_f(
>  	end_res = (struct xfs_trans_res *)(M_RES(mp) + 1);
>  	for (i = 0; res < end_res; i++, res++)
>  		print_logres(i, res);
> +
>  	libxfs_log_get_max_trans_res(mp, &resv);
> -	print_logres(-1, &resv);
> +	dbprintf(_("minlogsize logres %u logcount %d\n"),
> +			resv.tr_logres, resv.tr_logcount);

Looks good.

Reviewed-by: Dave Chinner <dchinner@redhat.com>

-- 
Dave Chinner
david@fromorbit.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-06-28 23:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-28 20:50 [PATCHSET 0/1] xfs_db: improve output of the logres command Darrick J. Wong
2022-06-28 20:51 ` [PATCH 1/1] xfs_db: identify the minlogsize transaction reservation Darrick J. Wong
2022-06-28 23:22   ` Dave Chinner

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.