callchain.h 788 字节
Newer Older
1 2 3 4
#ifndef __PERF_CALLCHAIN_H
#define __PERF_CALLCHAIN_H

#include "../perf.h"
5
#include <linux/list.h>
6
#include <linux/rbtree.h>
7
#include "symbol.h"
8 9 10 11 12


struct callchain_node {
	struct callchain_node	*parent;
	struct list_head	brothers;
13 14
	struct list_head	children;
	struct list_head	val;
15
	struct rb_node		rb_node;
16 17
	unsigned int		val_nr;
	u64			hit;
18 19 20
};

struct callchain_list {
21
	u64			ip;
22
	struct symbol		*sym;
23 24 25 26 27 28 29 30 31 32
	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);
}

33 34
void append_chain(struct callchain_node *root, struct ip_callchain *chain,
		  struct symbol **syms);
35 36
void sort_chain_to_rbtree(struct rb_root *rb_root, struct callchain_node *node);
#endif