1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0 */ 2*4882a593Smuzhiyun #ifndef __PERF_TOP_H 3*4882a593Smuzhiyun #define __PERF_TOP_H 1 4*4882a593Smuzhiyun 5*4882a593Smuzhiyun #include "tool.h" 6*4882a593Smuzhiyun #include "evswitch.h" 7*4882a593Smuzhiyun #include "annotate.h" 8*4882a593Smuzhiyun #include "ordered-events.h" 9*4882a593Smuzhiyun #include "record.h" 10*4882a593Smuzhiyun #include <linux/types.h> 11*4882a593Smuzhiyun #include <stddef.h> 12*4882a593Smuzhiyun #include <stdbool.h> 13*4882a593Smuzhiyun #include <sys/ioctl.h> 14*4882a593Smuzhiyun 15*4882a593Smuzhiyun struct evlist; 16*4882a593Smuzhiyun struct evsel; 17*4882a593Smuzhiyun struct perf_session; 18*4882a593Smuzhiyun 19*4882a593Smuzhiyun struct perf_top { 20*4882a593Smuzhiyun struct perf_tool tool; 21*4882a593Smuzhiyun struct evlist *evlist, *sb_evlist; 22*4882a593Smuzhiyun struct record_opts record_opts; 23*4882a593Smuzhiyun struct annotation_options annotation_opts; 24*4882a593Smuzhiyun struct evswitch evswitch; 25*4882a593Smuzhiyun /* 26*4882a593Smuzhiyun * Symbols will be added here in perf_event__process_sample and will 27*4882a593Smuzhiyun * get out after decayed. 28*4882a593Smuzhiyun */ 29*4882a593Smuzhiyun u64 samples, lost, lost_total, drop, drop_total; 30*4882a593Smuzhiyun u64 kernel_samples, us_samples; 31*4882a593Smuzhiyun u64 exact_samples; 32*4882a593Smuzhiyun u64 guest_us_samples, guest_kernel_samples; 33*4882a593Smuzhiyun int print_entries, count_filter, delay_secs; 34*4882a593Smuzhiyun int max_stack; 35*4882a593Smuzhiyun bool hide_kernel_symbols, hide_user_symbols, zero; 36*4882a593Smuzhiyun bool use_tui, use_stdio; 37*4882a593Smuzhiyun bool vmlinux_warned; 38*4882a593Smuzhiyun bool dump_symtab; 39*4882a593Smuzhiyun bool stitch_lbr; 40*4882a593Smuzhiyun struct hist_entry *sym_filter_entry; 41*4882a593Smuzhiyun struct evsel *sym_evsel; 42*4882a593Smuzhiyun struct perf_session *session; 43*4882a593Smuzhiyun struct winsize winsize; 44*4882a593Smuzhiyun int realtime_prio; 45*4882a593Smuzhiyun const char *sym_filter; 46*4882a593Smuzhiyun float min_percent; 47*4882a593Smuzhiyun unsigned int nr_threads_synthesize; 48*4882a593Smuzhiyun 49*4882a593Smuzhiyun struct { 50*4882a593Smuzhiyun struct ordered_events *in; 51*4882a593Smuzhiyun struct ordered_events data[2]; 52*4882a593Smuzhiyun bool rotate; 53*4882a593Smuzhiyun pthread_mutex_t mutex; 54*4882a593Smuzhiyun pthread_cond_t cond; 55*4882a593Smuzhiyun } qe; 56*4882a593Smuzhiyun }; 57*4882a593Smuzhiyun 58*4882a593Smuzhiyun #define CONSOLE_CLEAR "[H[2J" 59*4882a593Smuzhiyun 60*4882a593Smuzhiyun size_t perf_top__header_snprintf(struct perf_top *top, char *bf, size_t size); 61*4882a593Smuzhiyun void perf_top__reset_sample_counters(struct perf_top *top); 62*4882a593Smuzhiyun #endif /* __PERF_TOP_H */ 63