All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kent Overstreet <koverstreet-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
To: Joe Perches <joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
Cc: g@google.com,
	linux-bcache-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	dm-devel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	tejun-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org,
	agk-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	dan.j.williams-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org
Subject: Re: [Bcache v14 16/16] bcache: Debug and tracing code
Date: Tue, 12 Jun 2012 10:45:28 -0700	[thread overview]
Message-ID: <20120612174528.GB11365@google.com> (raw)
In-Reply-To: <1339522543.2404.3.camel@joe2Laptop>

On Tue, Jun 12, 2012 at 10:35:43AM -0700, Joe Perches wrote:
> "(uint64_t *)k - i->d" is what type again?
> What is a %zu?
> 
> Isn't that a mismatch?

You're right - ssize_t and size_t. I think gcc just isn't checking
signedness at all, that %i should be a %u too. Good catch.

> 
> > > > +static int debug_seq_show(struct seq_file *f, void *data)
> > > > +{
> > > > +	static const char *tabs = "\t\t\t\t\t";
> > > 
> > > Seems a _very_ odd use.
> > 
> > It is a strange hack.
> > 
> > The idea is that we want to indent more as we recurse; we could build up
> > a new string of tabs each time we recurse that's got one more tab than
> > our parent's, but that'd be a pain in the ass and it'd use more stack
> > space (though that should be fine here), so instead it's just
> > decrementing the pointer to the tab string to produce a string with one
> > more tab.
> 
> It's a nice idea, but that's not what's happening
> as I believe you reference tabs only once as &tabs[4]

bch_btree_dump() prints out tabs, and passes tabs - 1 when it recurses.

WARNING: multiple messages have this Message-ID (diff)
From: Kent Overstreet <koverstreet@google.com>
To: Joe Perches <joe@perches.com>
Cc: g@google.com, linux-bcache@vger.kernel.org,
	linux-kernel@vger.kernel.org, dm-devel@redhat.com,
	tejun@google.com, agk@redhat.com, dan.j.williams@intel.com
Subject: Re: [Bcache v14 16/16] bcache: Debug and tracing code
Date: Tue, 12 Jun 2012 10:45:28 -0700	[thread overview]
Message-ID: <20120612174528.GB11365@google.com> (raw)
In-Reply-To: <1339522543.2404.3.camel@joe2Laptop>

On Tue, Jun 12, 2012 at 10:35:43AM -0700, Joe Perches wrote:
> "(uint64_t *)k - i->d" is what type again?
> What is a %zu?
> 
> Isn't that a mismatch?

You're right - ssize_t and size_t. I think gcc just isn't checking
signedness at all, that %i should be a %u too. Good catch.

> 
> > > > +static int debug_seq_show(struct seq_file *f, void *data)
> > > > +{
> > > > +	static const char *tabs = "\t\t\t\t\t";
> > > 
> > > Seems a _very_ odd use.
> > 
> > It is a strange hack.
> > 
> > The idea is that we want to indent more as we recurse; we could build up
> > a new string of tabs each time we recurse that's got one more tab than
> > our parent's, but that'd be a pain in the ass and it'd use more stack
> > space (though that should be fine here), so instead it's just
> > decrementing the pointer to the tab string to produce a string with one
> > more tab.
> 
> It's a nice idea, but that's not what's happening
> as I believe you reference tabs only once as &tabs[4]

bch_btree_dump() prints out tabs, and passes tabs - 1 when it recurses.

  reply	other threads:[~2012-06-12 17:45 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-12 15:39 [Bcache v14 00/16] Kent Overstreet
2012-06-12 15:39 ` Kent Overstreet
2012-06-12 15:39 ` [Bcache v14 01/16] Revert "rw_semaphore: remove up/down_read_non_owner" Kent Overstreet
2012-06-12 15:39   ` Kent Overstreet
2012-06-12 15:39 ` [Bcache v14 02/16] Fix ratelimit macro to compile in c99 mode Kent Overstreet
2012-06-12 15:39 ` [Bcache v14 04/16] Add human-readable units modifier to vsnprintf() Kent Overstreet
2012-06-12 15:39   ` Kent Overstreet
2012-06-12 15:39 ` [Bcache v14 05/16] Export blk_fill_rwbs() Kent Overstreet
2012-06-12 15:39   ` Kent Overstreet
2012-06-12 15:39 ` [Bcache v14 06/16] Export __lockdep_no_validate__ Kent Overstreet
2012-06-12 15:39   ` Kent Overstreet
2012-06-12 15:39 ` [Bcache v14 08/16] bcache: Documentation, and changes to generic code Kent Overstreet
2012-06-12 15:39 ` [Bcache v14 09/16] bcache: Generic utility code Kent Overstreet
2012-06-12 15:39   ` Kent Overstreet
     [not found] ` <1339515562-14638-1-git-send-email-koverstreet-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-06-12 15:39   ` [Bcache v14 03/16] Export get_random_int() Kent Overstreet
2012-06-12 15:39     ` Kent Overstreet
2012-06-12 15:39   ` [Bcache v14 07/16] Closures Kent Overstreet
2012-06-12 15:39     ` Kent Overstreet
2012-06-12 15:39   ` [Bcache v14 10/16] bcache: Superblock/initialization/sysfs code Kent Overstreet
2012-06-12 15:39     ` Kent Overstreet
2012-06-12 15:39   ` [Bcache v14 15/16] bcache: Writeback, copying garbage collection Kent Overstreet
2012-06-12 15:39     ` Kent Overstreet
2012-06-12 15:39 ` [Bcache v14 11/16] bcache: Core btree code Kent Overstreet
2012-06-12 15:39 ` [Bcache v14 12/16] bcache: Bset code (lookups within a btree node) Kent Overstreet
2012-06-12 15:39 ` [Bcache v14 13/16] bcache: Journalling Kent Overstreet
2012-06-12 15:39 ` [Bcache v14 14/16] bcache: Request, io and allocation code Kent Overstreet
2012-06-12 15:39   ` Kent Overstreet
2012-06-12 15:39 ` [Bcache v14 16/16] bcache: Debug and tracing code Kent Overstreet
     [not found]   ` <1339515562-14638-17-git-send-email-koverstreet-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2012-06-12 16:50     ` Joe Perches
2012-06-12 16:50       ` Joe Perches
2012-06-12 17:24       ` Kent Overstreet
2012-06-12 17:24         ` Kent Overstreet
2012-06-12 17:35         ` Joe Perches
2012-06-12 17:45           ` Kent Overstreet [this message]
2012-06-12 17:45             ` Kent Overstreet

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=20120612174528.GB11365@google.com \
    --to=koverstreet-hpiqsd4aklfqt0dzr+alfa@public.gmane.org \
    --cc=agk-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=dan.j.williams-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=dm-devel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=g@google.com \
    --cc=joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org \
    --cc=linux-bcache-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=tejun-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
    /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.