tool.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __PERF_TOOL_H
  3. #define __PERF_TOOL_H
  4. #include <stdbool.h>
  5. #include <linux/types.h>
  6. struct perf_session;
  7. union perf_event;
  8. struct evlist;
  9. struct evsel;
  10. struct perf_sample;
  11. struct perf_tool;
  12. struct machine;
  13. struct ordered_events;
  14. typedef int (*event_sample)(struct perf_tool *tool, union perf_event *event,
  15. struct perf_sample *sample,
  16. struct evsel *evsel, struct machine *machine);
  17. typedef int (*event_op)(struct perf_tool *tool, union perf_event *event,
  18. struct perf_sample *sample, struct machine *machine);
  19. typedef int (*event_attr_op)(struct perf_tool *tool,
  20. union perf_event *event,
  21. struct evlist **pevlist);
  22. typedef int (*event_op2)(struct perf_session *session, union perf_event *event);
  23. typedef s64 (*event_op3)(struct perf_session *session, union perf_event *event);
  24. typedef int (*event_op4)(struct perf_session *session, union perf_event *event, u64 data);
  25. typedef int (*event_oe)(struct perf_tool *tool, union perf_event *event,
  26. struct ordered_events *oe);
  27. enum show_feature_header {
  28. SHOW_FEAT_NO_HEADER = 0,
  29. SHOW_FEAT_HEADER,
  30. SHOW_FEAT_HEADER_FULL_INFO,
  31. };
  32. struct perf_tool {
  33. event_sample sample,
  34. read;
  35. event_op mmap,
  36. mmap2,
  37. comm,
  38. namespaces,
  39. cgroup,
  40. fork,
  41. exit,
  42. lost,
  43. lost_samples,
  44. aux,
  45. itrace_start,
  46. context_switch,
  47. throttle,
  48. unthrottle,
  49. ksymbol,
  50. bpf,
  51. text_poke;
  52. event_attr_op attr;
  53. event_attr_op event_update;
  54. event_op2 tracing_data;
  55. event_oe finished_round;
  56. event_op2 build_id,
  57. id_index,
  58. auxtrace_info,
  59. auxtrace_error,
  60. time_conv,
  61. thread_map,
  62. cpu_map,
  63. stat_config,
  64. stat,
  65. stat_round,
  66. feature;
  67. event_op4 compressed;
  68. event_op3 auxtrace;
  69. bool ordered_events;
  70. bool ordering_requires_timestamps;
  71. bool namespace_events;
  72. bool cgroup_events;
  73. bool no_warn;
  74. enum show_feature_header show_feat_hdr;
  75. };
  76. #endif /* __PERF_TOOL_H */