blob: 0467b26dd8d89cf4c02a1b745467d107394371d8 [file] [log] [blame]
Arnaldo Carvalho de Melo8c3e10e2011-01-31 14:50:39 -02001#ifndef __PERF_TOP_H
2#define __PERF_TOP_H 1
3
4#include "types.h"
5#include "../perf.h"
6#include <stddef.h>
7#include <pthread.h>
8#include <linux/list.h>
9#include <linux/rbtree.h>
10
11struct perf_evlist;
12struct perf_evsel;
13
14struct source_line {
15 u64 eip;
16 unsigned long count[MAX_COUNTERS]; /* FIXME */
17 char *line;
18 struct source_line *next;
19};
20
21struct sym_entry_source {
22 struct source_line *source;
23 struct source_line *lines;
24 struct source_line **lines_tail;
25 pthread_mutex_t lock;
26};
27
28struct sym_entry {
29 struct rb_node rb_node;
30 struct list_head node;
31 unsigned long snap_count;
32 double weight;
33 int skip;
34 u16 name_len;
35 u8 origin;
36 struct map *map;
37 struct sym_entry_source *src;
38 unsigned long count[0];
39};
40
41struct perf_top {
42 struct perf_evlist *evlist;
43 /*
44 * Symbols will be added here in perf_event__process_sample and will
45 * get out after decayed.
46 */
47 struct list_head active_symbols;
48 pthread_mutex_t active_symbols_lock;
49 u64 samples;
50 u64 kernel_samples, us_samples;
51 u64 exact_samples;
52 u64 guest_us_samples, guest_kernel_samples;
53 int print_entries, count_filter, delay_secs;
54 int display_weighted, freq;
55 int sym_counter, target_pid, target_tid;
56 bool hide_kernel_symbols, hide_user_symbols, zero;
57 const char *cpu_list;
58 struct perf_evsel *sym_evsel;
59};
60
61size_t perf_top__header_snprintf(struct perf_top *top, char *bf, size_t size);
62void perf_top__reset_sample_counters(struct perf_top *top);
63float perf_top__decay_samples(struct perf_top *top, struct rb_root *root);
64void perf_top__find_widths(struct perf_top *top, struct rb_root *root,
65 int *dso_width, int *dso_short_width, int *sym_width);
66
67#endif /* __PERF_TOP_H */