Re: [PATCH v3 03/13] perf report: create real callchain entries for inlined frames

Milian Wolff
2017-10-01T14:16:42Z

On Dienstag, 19. September 2017 14:27:19 CEST Jiri Olsa wrote:
> On Wed, Sep 06, 2017 at 03:54:51PM +0200, Milian Wolff wrote:
>
> SNIP
>
> > +void inlines__tree_insert(struct rb_root *tree, struct inline_node
> > *inlines) +{
> > + struct rb_node **p = &tree->rb_node;
> > + struct rb_node *parent = NULL;
> > + const u64 addr = inlines->addr;
> > + struct inline_node *i;
> > +
> > + while (*p != NULL) {
> > + parent = *p;
> > + i = rb_entry(parent, struct inline_node, rb_node);
> > + if (addr < i->addr)
> > + p = &(*p)->rb_left;
> > + else
> > + p = &(*p)->rb_right;
> > + }
> > + rb_link_node(&inlines->rb_node, parent, p);
> > + rb_insert_color(&inlines->rb_node, tree);
> > +}
> > +
> > +struct inline_node *inlines__tree_find(struct rb_root *tree, u64 addr)
> > +{
> > + struct rb_node *n = tree->rb_node;
> > +
> > + while (n) {
> > + struct inline_node *i = rb_entry(n, struct inline_node,
> > + rb_node);
> > +
> > + if (addr < i->addr)
> > + n = n->rb_left;
> > + else if (addr > i->addr)
> > + n = n->rb_right;
> > + else
> > + return i;
> > + }
> > +
> > + return NULL;
> > +}
> > +
> > +void inlines__tree_delete(struct rb_root *tree)
> > +{
> > + struct inline_node *pos;
> > + struct rb_node *next = rb_first(tree);
> > +
> > + while (next) {
> > + pos = rb_entry(next, struct inline_node, rb_node);
> > + next = rb_next(&pos->rb_node);
> > + rb_erase(&pos->rb_node, tree);
> > + inline_node__delete(pos);
> > + }
> > +}
>
> could you please split the patch at least into
> above 'adding related inline_node tree managing functions + append_inlines'
>
> and below 'struct inline_list' changes
>
> not sure the 'struct symbol::inlined' could be separated,
> I'd take it as a bonus and nice gesture to reviewers ;-)

I have now split it up in three parts:

a) use symbol in srcline api and create fake symbols
b) use srcline string in srcline api
c) create real callchain entries

I hope that is easier to review. Thanks for the comments so far. I'll push a
new version of this patch series now.

Cheers

--
Milian Wolff | milian.wolff@kdab.com | Senior Software Engineer
KDAB (Deutschland) GmbH&Co KG, a KDAB Group company
Tel: +49-30-521325470
KDAB - The Qt Experts