diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-01-31 11:50:39 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-01-31 11:50:39 -0500 |
commit | 8c3e10eb1968877d6a1957b7e790c6ce01bd56fc (patch) | |
tree | f0660d444639407e776fee780410755220ee212e /tools/perf/util/top.h | |
parent | 7e2ed097538c57ff5268e9a6bced7c0b885809c8 (diff) |
perf top: Move display agnostic routines to util/top.[ch]
Paving the way for a slang browser a la 'perf report --tui'.
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Tom Zanussi <tzanussi@gmail.com>
LKML-Reference: <new-submission>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/top.h')
-rw-r--r-- | tools/perf/util/top.h | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/tools/perf/util/top.h b/tools/perf/util/top.h new file mode 100644 index 000000000000..0467b26dd8d8 --- /dev/null +++ b/tools/perf/util/top.h | |||
@@ -0,0 +1,67 @@ | |||
1 | #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 | |||
11 | struct perf_evlist; | ||
12 | struct perf_evsel; | ||
13 | |||
14 | struct source_line { | ||
15 | u64 eip; | ||
16 | unsigned long count[MAX_COUNTERS]; /* FIXME */ | ||
17 | char *line; | ||
18 | struct source_line *next; | ||
19 | }; | ||
20 | |||
21 | struct 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 | |||
28 | struct 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 | |||
41 | struct 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 | |||
61 | size_t perf_top__header_snprintf(struct perf_top *top, char *bf, size_t size); | ||
62 | void perf_top__reset_sample_counters(struct perf_top *top); | ||
63 | float perf_top__decay_samples(struct perf_top *top, struct rb_root *root); | ||
64 | void 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 */ | ||