1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */ 28c3e10ebSArnaldo Carvalho de Melo #ifndef __PERF_TOP_H 38c3e10ebSArnaldo Carvalho de Melo #define __PERF_TOP_H 1 48c3e10ebSArnaldo Carvalho de Melo 545694aa7SArnaldo Carvalho de Melo #include "tool.h" 62f53ae34SArnaldo Carvalho de Melo #include "evswitch.h" 7982d410bSArnaldo Carvalho de Melo #include "annotate.h" 8*d8e40b58SIan Rogers #include "mutex.h" 9f2a39fe8SArnaldo Carvalho de Melo #include "ordered-events.h" 10aeb00b1aSArnaldo Carvalho de Melo #include "record.h" 11d944c4eeSBorislav Petkov #include <linux/types.h> 128c3e10ebSArnaldo Carvalho de Melo #include <stddef.h> 1345694aa7SArnaldo Carvalho de Melo #include <stdbool.h> 1486a5e0c2SArnaldo Carvalho de Melo #include <sys/ioctl.h> 158c3e10ebSArnaldo Carvalho de Melo 1663503dbaSJiri Olsa struct evlist; 1732dcd021SJiri Olsa struct evsel; 1845694aa7SArnaldo Carvalho de Melo struct perf_session; 198c3e10ebSArnaldo Carvalho de Melo 208c3e10ebSArnaldo Carvalho de Melo struct perf_top { 2145694aa7SArnaldo Carvalho de Melo struct perf_tool tool; 22ca6c9c8bSArnaldo Carvalho de Melo struct evlist *evlist, *sb_evlist; 23b4006796SArnaldo Carvalho de Melo struct record_opts record_opts; 242f53ae34SArnaldo Carvalho de Melo struct evswitch evswitch; 258c3e10ebSArnaldo Carvalho de Melo /* 268c3e10ebSArnaldo Carvalho de Melo * Symbols will be added here in perf_event__process_sample and will 278c3e10ebSArnaldo Carvalho de Melo * get out after decayed. 288c3e10ebSArnaldo Carvalho de Melo */ 2997f7e0b3SJiri Olsa u64 samples, lost, lost_total, drop, drop_total; 308c3e10ebSArnaldo Carvalho de Melo u64 kernel_samples, us_samples; 318c3e10ebSArnaldo Carvalho de Melo u64 exact_samples; 328c3e10ebSArnaldo Carvalho de Melo u64 guest_us_samples, guest_kernel_samples; 338c3e10ebSArnaldo Carvalho de Melo int print_entries, count_filter, delay_secs; 345dbb6e81SWaiman Long int max_stack; 358c3e10ebSArnaldo Carvalho de Melo bool hide_kernel_symbols, hide_user_symbols, zero; 363402ae0aSIan Rogers #ifdef HAVE_SLANG_SUPPORT 373402ae0aSIan Rogers bool use_tui; 383402ae0aSIan Rogers #endif 393402ae0aSIan Rogers bool use_stdio; 401758af10SArnaldo Carvalho de Melo bool vmlinux_warned; 411758af10SArnaldo Carvalho de Melo bool dump_symtab; 4213e0c844SKan Liang bool stitch_lbr; 43ab81f3fdSArnaldo Carvalho de Melo struct hist_entry *sym_filter_entry; 4432dcd021SJiri Olsa struct evsel *sym_evsel; 45dcc101d1SArnaldo Carvalho de Melo struct perf_session *session; 461758af10SArnaldo Carvalho de Melo struct winsize winsize; 471758af10SArnaldo Carvalho de Melo int realtime_prio; 481758af10SArnaldo Carvalho de Melo const char *sym_filter; 49fa5df943SNamhyung Kim float min_percent; 500c6b4994SKan Liang unsigned int nr_threads_synthesize; 5116c66bc1SJiri Olsa 5216c66bc1SJiri Olsa struct { 5316c66bc1SJiri Olsa struct ordered_events *in; 5416c66bc1SJiri Olsa struct ordered_events data[2]; 5594ad6e7eSJiri Olsa bool rotate; 56*d8e40b58SIan Rogers struct mutex mutex; 57*d8e40b58SIan Rogers struct cond cond; 5816c66bc1SJiri Olsa } qe; 598c3e10ebSArnaldo Carvalho de Melo }; 608c3e10ebSArnaldo Carvalho de Melo 6142ee8c61SDavid Ahern #define CONSOLE_CLEAR "[H[2J" 6242ee8c61SDavid Ahern 638c3e10ebSArnaldo Carvalho de Melo size_t perf_top__header_snprintf(struct perf_top *top, char *bf, size_t size); 648c3e10ebSArnaldo Carvalho de Melo void perf_top__reset_sample_counters(struct perf_top *top); 658c3e10ebSArnaldo Carvalho de Melo #endif /* __PERF_TOP_H */ 66