#include "callchain.h"
+#define chain_for_each_child(child, parent) \
+ list_for_each_entry(child, &parent->children, brothers)
+
static void
rb_insert_callchain(struct rb_root *root, struct callchain_node *chain)
{
struct callchain_node *child;
- list_for_each_entry(child, &node->children, brothers)
+ chain_for_each_child(child, node)
sort_chain_to_rbtree(rb_root, child);
if (node->hit)
list_splice(&parent->children, &new->children);
INIT_LIST_HEAD(&parent->children);
- list_for_each_entry(next, &new->children, brothers)
+ chain_for_each_child(next, new)
next->parent = new;
}
list_add_tail(&new->brothers, &parent->children);
struct callchain_node *rnode;
/* lookup in childrens */
- list_for_each_entry(rnode, &root->children, brothers) {
+ chain_for_each_child(rnode, root) {
unsigned int ret = __append_chain(rnode, chain, start, syms);
if (!ret)