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