top.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __PERF_TOP_H
  3. #define __PERF_TOP_H 1
  4. #include "tool.h"
  5. #include "evswitch.h"
  6. #include "annotate.h"
  7. #include "ordered-events.h"
  8. #include "record.h"
  9. #include <linux/types.h>
  10. #include <stddef.h>
  11. #include <stdbool.h>
  12. #include <sys/ioctl.h>
  13. struct evlist;
  14. struct evsel;
  15. struct perf_session;
  16. struct perf_top {
  17. struct perf_tool tool;
  18. struct evlist *evlist, *sb_evlist;
  19. struct record_opts record_opts;
  20. struct annotation_options annotation_opts;
  21. struct evswitch evswitch;
  22. /*
  23. * Symbols will be added here in perf_event__process_sample and will
  24. * get out after decayed.
  25. */
  26. u64 samples, lost, lost_total, drop, drop_total;
  27. u64 kernel_samples, us_samples;
  28. u64 exact_samples;
  29. u64 guest_us_samples, guest_kernel_samples;
  30. int print_entries, count_filter, delay_secs;
  31. int max_stack;
  32. bool hide_kernel_symbols, hide_user_symbols, zero;
  33. bool use_tui, use_stdio;
  34. bool vmlinux_warned;
  35. bool dump_symtab;
  36. bool stitch_lbr;
  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. struct {
  46. struct ordered_events *in;
  47. struct ordered_events data[2];
  48. bool rotate;
  49. pthread_mutex_t mutex;
  50. pthread_cond_t cond;
  51. } qe;
  52. };
  53. #define CONSOLE_CLEAR ""
  54. size_t perf_top__header_snprintf(struct perf_top *top, char *bf, size_t size);
  55. void perf_top__reset_sample_counters(struct perf_top *top);
  56. #endif /* __PERF_TOP_H */