linux/tools/perf/util/callchain.h
Arnaldo Carvalho de Melo 43cbcd8acb perf_counter tools: Share rbtree.with the kernel
The tools/perf/util/rbtree.c copy already drifted by three
csets:

 4b324126e0c6c3a5080ca3ec0981e8766ed6f1ee
 4c60117811171d867d4f27f17ea07d7419d45dae
 16c047add3ceaf0ab882e3e094d1ec904d02312d

So remove the copy and use the lib/rbtree.c directly, sharing
the source code while still generating a separate object file,
since tools/perf uses a far more agressive -O6 switch.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <20090701152837.GG15682@ghostprotocols.net>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-07-01 22:37:22 +02:00

37 lines
782 B
C

#ifndef __PERF_CALLCHAIN_H
#define __PERF_CALLCHAIN_H
#include "../perf.h"
#include "list.h"
#include <linux/rbtree.h>
#include "symbol.h"
struct callchain_node {
struct callchain_node *parent;
struct list_head brothers;
struct list_head children;
struct list_head val;
struct rb_node rb_node;
unsigned int val_nr;
u64 hit;
};
struct callchain_list {
u64 ip;
struct symbol *sym;
struct list_head list;
};
static inline void callchain_init(struct callchain_node *node)
{
INIT_LIST_HEAD(&node->brothers);
INIT_LIST_HEAD(&node->children);
INIT_LIST_HEAD(&node->val);
}
void append_chain(struct callchain_node *root, struct ip_callchain *chain,
struct symbol **syms);
void sort_chain_to_rbtree(struct rb_root *rb_root, struct callchain_node *node);
#endif