[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: [dm-devel] [Bcache v14 16/16] bcache: Debug and tracing code
- From: Kent Overstreet <koverstreet google com>
- To: Joe Perches <joe perches com>
- Cc: dm-devel redhat com, linux-kernel vger kernel org, linux-bcache vger kernel org, dan j williams intel com, tejun google com, g google com, agk redhat com
- Subject: Re: [dm-devel] [Bcache v14 16/16] bcache: Debug and tracing code
- Date: Tue, 12 Jun 2012 10:45:28 -0700
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.
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]