From: Lachlan McIlroy <lachlan@sgi.com>
To: David Chinner <dgc@sgi.com>
Cc: xfs-dev <xfs-dev@sgi.com>, xfs-oss <xfs@oss.sgi.com>
Subject: Re: [PATCH] Fix non-debug build for xfsidbg.c
Date: Thu, 01 May 2008 11:42:00 +1000 [thread overview]
Message-ID: <48191FE8.9080607@sgi.com> (raw)
In-Reply-To: <20080501004925.GU108924158@sgi.com>
Sorry I should have been clearer. What I actually meant was something
like this:
--- a/fs/xfs/xfsidbg.c 2008-05-01 11:34:55.000000000 +1000
+++ b/fs/xfs/xfsidbg.c 2008-05-01 11:35:18.000000000 +1000
@@ -5845,9 +5845,11 @@
kdb_printf("curr_cycle: %d prev_cycle: %d curr_block: %d prev_block: %d\n",
log->l_curr_cycle, log->l_prev_cycle, log->l_curr_block,
log->l_prev_block);
- kdb_printf("iclog_bak: 0x%p iclog_size: 0x%x (%d) num iclogs: %d\n",
- log->l_iclog_bak, log->l_iclog_size, log->l_iclog_size,
- log->l_iclog_bufs);
+#ifdef DEBUG
+ kdb_printf("iclog_bak: 0x%p\n", log->l_iclog_bak);
+#endif
+ kdb_printf("iclog_size: 0x%x (%d) num iclogs: %d\n",
+ log->l_iclog_size, log->l_iclog_size, log->l_iclog_bufs);
kdb_printf("l_iclog_hsize %d l_iclog_heads %d\n",
log->l_iclog_hsize, log->l_iclog_heads);
kdb_printf("l_sectbb_log %u l_sectbb_mask %u\n",
This way there is no code duplicated between the debug and non-debug cases.
But I'm fine with your approach too.
Lachlan
David Chinner wrote:
> On Wed, Apr 30, 2008 at 05:17:24PM +1000, Lachlan McIlroy wrote:
>> Dave, would the code look cleaner if iclog_bak was printed on a line by
>> itself?
>> That way we wouldn't need the #else and we wouldn't be duplicating code.
>
> Yup, probably a good idea. I've changed it to match how this is handled
> in other places in xfsidbg.c:
>
> @@ -5846,8 +5846,12 @@
> log->l_curr_cycle, log->l_prev_cycle, log->l_curr_block,
> log->l_prev_block);
> kdb_printf("iclog_bak: 0x%p iclog_size: 0x%x (%d) num iclogs: %d\n",
> - log->l_iclog_bak, log->l_iclog_size, log->l_iclog_size,
> - log->l_iclog_bufs);
> +#ifdef DEBUG
> + log->l_iclog_bak,
> +#else
> + NULL,
> +#endif
> + log->l_iclog_size, log->l_iclog_size, log->l_iclog_bufs);
> kdb_printf("l_iclog_hsize %d l_iclog_heads %d\n",
> log->l_iclog_hsize, log->l_iclog_heads);
> kdb_printf("l_sectbb_log %u l_sectbb_mask %u\n",
>
> Cheers,
>
> Dave.
next prev parent reply other threads:[~2008-05-01 1:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-30 6:59 [PATCH] Fix non-debug build for xfsidbg.c David Chinner
2008-04-30 7:17 ` Lachlan McIlroy
2008-05-01 0:49 ` David Chinner
2008-05-01 1:42 ` Lachlan McIlroy [this message]
2008-05-01 3:01 ` David Chinner
2008-05-01 7:22 ` Lachlan McIlroy
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=48191FE8.9080607@sgi.com \
--to=lachlan@sgi.com \
--cc=dgc@sgi.com \
--cc=xfs-dev@sgi.com \
--cc=xfs@oss.sgi.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox