Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Arnaldo Carvalho de Melo | 8c3e10e | 2011-01-31 14:50:39 -0200 | [diff] [blame] | 2 | #ifndef __PERF_TOP_H |
| 3 | #define __PERF_TOP_H 1 |
| 4 | |
Arnaldo Carvalho de Melo | 45694aa | 2011-11-28 08:30:20 -0200 | [diff] [blame] | 5 | #include "tool.h" |
Arnaldo Carvalho de Melo | 982d410 | 2018-05-25 17:28:37 -0300 | [diff] [blame] | 6 | #include "annotate.h" |
Borislav Petkov | d944c4e | 2014-04-25 21:31:02 +0200 | [diff] [blame] | 7 | #include <linux/types.h> |
Arnaldo Carvalho de Melo | 8c3e10e | 2011-01-31 14:50:39 -0200 | [diff] [blame] | 8 | #include <stddef.h> |
Arnaldo Carvalho de Melo | 45694aa | 2011-11-28 08:30:20 -0200 | [diff] [blame] | 9 | #include <stdbool.h> |
Arnaldo Carvalho de Melo | 86a5e0c | 2017-04-19 19:03:14 -0300 | [diff] [blame] | 10 | #include <sys/ioctl.h> |
Arnaldo Carvalho de Melo | 8c3e10e | 2011-01-31 14:50:39 -0200 | [diff] [blame] | 11 | |
| 12 | struct perf_evlist; |
| 13 | struct perf_evsel; |
Arnaldo Carvalho de Melo | 45694aa | 2011-11-28 08:30:20 -0200 | [diff] [blame] | 14 | struct perf_session; |
Arnaldo Carvalho de Melo | 8c3e10e | 2011-01-31 14:50:39 -0200 | [diff] [blame] | 15 | |
Arnaldo Carvalho de Melo | 8c3e10e | 2011-01-31 14:50:39 -0200 | [diff] [blame] | 16 | struct perf_top { |
Arnaldo Carvalho de Melo | 45694aa | 2011-11-28 08:30:20 -0200 | [diff] [blame] | 17 | struct perf_tool tool; |
Arnaldo Carvalho de Melo | 8c3e10e | 2011-01-31 14:50:39 -0200 | [diff] [blame] | 18 | struct perf_evlist *evlist; |
Arnaldo Carvalho de Melo | b400679 | 2013-12-19 14:43:45 -0300 | [diff] [blame] | 19 | struct record_opts record_opts; |
Arnaldo Carvalho de Melo | 982d410 | 2018-05-25 17:28:37 -0300 | [diff] [blame] | 20 | struct annotation_options annotation_opts; |
Arnaldo Carvalho de Melo | 8c3e10e | 2011-01-31 14:50:39 -0200 | [diff] [blame] | 21 | /* |
| 22 | * Symbols will be added here in perf_event__process_sample and will |
| 23 | * get out after decayed. |
| 24 | */ |
Jiri Olsa | 97f7e0b | 2018-11-11 20:02:46 +0100 | [diff] [blame] | 25 | u64 samples, lost, lost_total, drop, drop_total; |
Arnaldo Carvalho de Melo | 8c3e10e | 2011-01-31 14:50:39 -0200 | [diff] [blame] | 26 | u64 kernel_samples, us_samples; |
| 27 | u64 exact_samples; |
| 28 | u64 guest_us_samples, guest_kernel_samples; |
| 29 | int print_entries, count_filter, delay_secs; |
Waiman Long | 5dbb6e8 | 2013-10-18 10:38:49 -0400 | [diff] [blame] | 30 | int max_stack; |
Arnaldo Carvalho de Melo | 8c3e10e | 2011-01-31 14:50:39 -0200 | [diff] [blame] | 31 | bool hide_kernel_symbols, hide_user_symbols, zero; |
Arnaldo Carvalho de Melo | 1758af1 | 2011-11-28 09:37:05 -0200 | [diff] [blame] | 32 | bool use_tui, use_stdio; |
Arnaldo Carvalho de Melo | 1758af1 | 2011-11-28 09:37:05 -0200 | [diff] [blame] | 33 | bool vmlinux_warned; |
Arnaldo Carvalho de Melo | 1758af1 | 2011-11-28 09:37:05 -0200 | [diff] [blame] | 34 | bool dump_symtab; |
Arnaldo Carvalho de Melo | ab81f3fd | 2011-10-05 19:16:15 -0300 | [diff] [blame] | 35 | struct hist_entry *sym_filter_entry; |
Arnaldo Carvalho de Melo | 8c3e10e | 2011-01-31 14:50:39 -0200 | [diff] [blame] | 36 | struct perf_evsel *sym_evsel; |
Arnaldo Carvalho de Melo | dcc101d | 2011-09-01 14:27:58 -0300 | [diff] [blame] | 37 | struct perf_session *session; |
Arnaldo Carvalho de Melo | 1758af1 | 2011-11-28 09:37:05 -0200 | [diff] [blame] | 38 | struct winsize winsize; |
Arnaldo Carvalho de Melo | 1758af1 | 2011-11-28 09:37:05 -0200 | [diff] [blame] | 39 | int realtime_prio; |
Arnaldo Carvalho de Melo | 1758af1 | 2011-11-28 09:37:05 -0200 | [diff] [blame] | 40 | const char *sym_filter; |
Namhyung Kim | fa5df94 | 2013-05-14 11:09:05 +0900 | [diff] [blame] | 41 | float min_percent; |
Kan Liang | 0c6b499 | 2017-09-29 07:47:55 -0700 | [diff] [blame] | 42 | unsigned int nr_threads_synthesize; |
Jiri Olsa | 16c66bc | 2018-11-05 13:24:55 +0100 | [diff] [blame] | 43 | |
| 44 | struct { |
| 45 | struct ordered_events *in; |
| 46 | struct ordered_events data[2]; |
Jiri Olsa | 94ad6e7 | 2018-11-05 21:23:40 +0100 | [diff] [blame] | 47 | bool rotate; |
| 48 | pthread_mutex_t mutex; |
| 49 | pthread_cond_t cond; |
Jiri Olsa | 16c66bc | 2018-11-05 13:24:55 +0100 | [diff] [blame] | 50 | } qe; |
Arnaldo Carvalho de Melo | 8c3e10e | 2011-01-31 14:50:39 -0200 | [diff] [blame] | 51 | }; |
| 52 | |
David Ahern | 42ee8c6 | 2013-08-02 14:05:39 -0600 | [diff] [blame] | 53 | #define CONSOLE_CLEAR "[H[2J" |
| 54 | |
Arnaldo Carvalho de Melo | 8c3e10e | 2011-01-31 14:50:39 -0200 | [diff] [blame] | 55 | size_t perf_top__header_snprintf(struct perf_top *top, char *bf, size_t size); |
| 56 | void perf_top__reset_sample_counters(struct perf_top *top); |
Arnaldo Carvalho de Melo | 8c3e10e | 2011-01-31 14:50:39 -0200 | [diff] [blame] | 57 | #endif /* __PERF_TOP_H */ |