Re: [tip:perf/core] perf callchain: Convert children list to rbtree
From: Arnaldo Carvalho de Melo
Date: Wed Oct 23 2013 - 08:45:54 EST
Em Wed, Oct 23, 2013 at 12:07:26PM +0100, Frederic Weisbecker escreveu:
> On Wed, Oct 23, 2013 at 12:54:48AM -0700, tip-bot for Namhyung Kim wrote:
> > -#define chain_for_each_child(child, parent) \
> > - list_for_each_entry(child, &parent->children, siblings)
> > -
> > -#define chain_for_each_child_safe(child, next, parent) \
> > - list_for_each_entry_safe(child, next, &parent->children, siblings)
>
> We can probably keep these APIs using the rb root iteration code.
>
> There should be an rb_node_for_each() anyway, and rb_node_for_each_entry(). People
> refused to have to have such an API because they feared it would encourage blind use
> of this O(n log n) iteration. There is plenty of such usecase in practice though, especially
> in perf. So I think we can now start to think about it for real.
I tried introducing one, PeterZ objected, on the grounds you mentioned,
and I still think they are needed, agree with you. Just put a:
/*
DANGER WILL ROBINSON DANGER
You should know what you're doing, PeterZ is watching you!
I CAN NOT ACCEPT THAT PERSON ACTION
*/
or something like that above such helpers ;-)
- Arnaldo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/