blob: 19f95eaf75c8aae163be370e7c80c69cdad43678 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Arnaldo Carvalho de Melo8c3e10e2011-01-31 14:50:39 -02002#ifndef __PERF_TOP_H
3#define __PERF_TOP_H 1
4
Arnaldo Carvalho de Melo45694aa2011-11-28 08:30:20 -02005#include "tool.h"
Arnaldo Carvalho de Melo982d4102018-05-25 17:28:37 -03006#include "annotate.h"
Borislav Petkovd944c4e2014-04-25 21:31:02 +02007#include <linux/types.h>
Arnaldo Carvalho de Melo8c3e10e2011-01-31 14:50:39 -02008#include <stddef.h>
Arnaldo Carvalho de Melo45694aa2011-11-28 08:30:20 -02009#include <stdbool.h>
Arnaldo Carvalho de Melo86a5e0c2017-04-19 19:03:14 -030010#include <sys/ioctl.h>
Arnaldo Carvalho de Melo8c3e10e2011-01-31 14:50:39 -020011
12struct perf_evlist;
13struct perf_evsel;
Arnaldo Carvalho de Melo45694aa2011-11-28 08:30:20 -020014struct perf_session;
Arnaldo Carvalho de Melo8c3e10e2011-01-31 14:50:39 -020015
Arnaldo Carvalho de Melo8c3e10e2011-01-31 14:50:39 -020016struct perf_top {
Arnaldo Carvalho de Melo45694aa2011-11-28 08:30:20 -020017 struct perf_tool tool;
Arnaldo Carvalho de Melo8c3e10e2011-01-31 14:50:39 -020018 struct perf_evlist *evlist;
Arnaldo Carvalho de Melob4006792013-12-19 14:43:45 -030019 struct record_opts record_opts;
Arnaldo Carvalho de Melo982d4102018-05-25 17:28:37 -030020 struct annotation_options annotation_opts;
Arnaldo Carvalho de Melo8c3e10e2011-01-31 14:50:39 -020021 /*
22 * Symbols will be added here in perf_event__process_sample and will
23 * get out after decayed.
24 */
Jiri Olsa97f7e0b2018-11-11 20:02:46 +010025 u64 samples, lost, lost_total, drop, drop_total;
Arnaldo Carvalho de Melo8c3e10e2011-01-31 14:50:39 -020026 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 Long5dbb6e82013-10-18 10:38:49 -040030 int max_stack;
Arnaldo Carvalho de Melo8c3e10e2011-01-31 14:50:39 -020031 bool hide_kernel_symbols, hide_user_symbols, zero;
Arnaldo Carvalho de Melo1758af12011-11-28 09:37:05 -020032 bool use_tui, use_stdio;
Arnaldo Carvalho de Melo1758af12011-11-28 09:37:05 -020033 bool vmlinux_warned;
Arnaldo Carvalho de Melo1758af12011-11-28 09:37:05 -020034 bool dump_symtab;
Arnaldo Carvalho de Meloab81f3fd2011-10-05 19:16:15 -030035 struct hist_entry *sym_filter_entry;
Arnaldo Carvalho de Melo8c3e10e2011-01-31 14:50:39 -020036 struct perf_evsel *sym_evsel;
Arnaldo Carvalho de Melodcc101d2011-09-01 14:27:58 -030037 struct perf_session *session;
Arnaldo Carvalho de Melo1758af12011-11-28 09:37:05 -020038 struct winsize winsize;
Arnaldo Carvalho de Melo1758af12011-11-28 09:37:05 -020039 int realtime_prio;
Arnaldo Carvalho de Melo1758af12011-11-28 09:37:05 -020040 const char *sym_filter;
Namhyung Kimfa5df942013-05-14 11:09:05 +090041 float min_percent;
Kan Liang0c6b4992017-09-29 07:47:55 -070042 unsigned int nr_threads_synthesize;
Jiri Olsa16c66bc2018-11-05 13:24:55 +010043
44 struct {
45 struct ordered_events *in;
46 struct ordered_events data[2];
Jiri Olsa94ad6e72018-11-05 21:23:40 +010047 bool rotate;
48 pthread_mutex_t mutex;
49 pthread_cond_t cond;
Jiri Olsa16c66bc2018-11-05 13:24:55 +010050 } qe;
Arnaldo Carvalho de Melo8c3e10e2011-01-31 14:50:39 -020051};
52
David Ahern42ee8c62013-08-02 14:05:39 -060053#define CONSOLE_CLEAR ""
54
Arnaldo Carvalho de Melo8c3e10e2011-01-31 14:50:39 -020055size_t perf_top__header_snprintf(struct perf_top *top, char *bf, size_t size);
56void perf_top__reset_sample_counters(struct perf_top *top);
Arnaldo Carvalho de Melo8c3e10e2011-01-31 14:50:39 -020057#endif /* __PERF_TOP_H */