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