tool.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. fork,
  40. exit,
  41. lost,
  42. lost_samples,
  43. aux,
  44. itrace_start,
  45. context_switch,
  46. throttle,
  47. unthrottle,
  48. ksymbol,
  49. bpf;
  50. event_attr_op attr;
  51. event_attr_op event_update;
  52. event_op2 tracing_data;
  53. event_oe finished_round;
  54. event_op2 build_id,
  55. id_index,
  56. auxtrace_info,
  57. auxtrace_error,
  58. time_conv,
  59. thread_map,
  60. cpu_map,
  61. stat_config,
  62. stat,
  63. stat_round,
  64. feature;
  65. event_op4 compressed;
  66. event_op3 auxtrace;
  67. bool ordered_events;
  68. bool ordering_requires_timestamps;
  69. bool namespace_events;
  70. bool no_warn;
  71. enum show_feature_header show_feat_hdr;
  72. };
  73. #endif /* __PERF_TOOL_H */