xref: /linux/tools/perf/util/top.h (revision d2912cb15bdda8ba4a5dd73396ad62641af2f520)
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 "annotate.h"
7 #include <linux/types.h>
8 #include <stddef.h>
9 #include <stdbool.h>
10 #include <sys/ioctl.h>
11 
12 struct perf_evlist;
13 struct perf_evsel;
14 struct perf_session;
15 
16 struct perf_top {
17 	struct perf_tool   tool;
18 	struct perf_evlist *evlist;
19 	struct record_opts record_opts;
20 	struct annotation_options annotation_opts;
21 	/*
22 	 * Symbols will be added here in perf_event__process_sample and will
23 	 * get out after decayed.
24 	 */
25 	u64		   samples, lost, lost_total, drop, drop_total;
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;
30 	int		   max_stack;
31 	bool		   hide_kernel_symbols, hide_user_symbols, zero;
32 	bool		   use_tui, use_stdio;
33 	bool		   vmlinux_warned;
34 	bool		   dump_symtab;
35 	struct hist_entry  *sym_filter_entry;
36 	struct perf_evsel  *sym_evsel;
37 	struct perf_session *session;
38 	struct winsize	   winsize;
39 	int		   realtime_prio;
40 	const char	   *sym_filter;
41 	float		   min_percent;
42 	unsigned int	   nr_threads_synthesize;
43 
44 	struct {
45 		struct ordered_events	*in;
46 		struct ordered_events	 data[2];
47 		bool			 rotate;
48 		pthread_mutex_t		 mutex;
49 		pthread_cond_t		 cond;
50 	} qe;
51 };
52 
53 #define CONSOLE_CLEAR ""
54 
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);
57 #endif /* __PERF_TOP_H */
58