tool.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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 perf_evlist;
  9. struct perf_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 perf_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 perf_evlist **pevlist);
  22. typedef int (*event_op2)(struct perf_tool *tool, union perf_event *event,
  23. struct perf_session *session);
  24. typedef int (*event_oe)(struct perf_tool *tool, union perf_event *event,
  25. struct ordered_events *oe);
  26. typedef s64 (*event_op3)(struct perf_tool *tool, union perf_event *event,
  27. struct perf_session *session);
  28. enum show_feature_header {
  29. SHOW_FEAT_NO_HEADER = 0,
  30. SHOW_FEAT_HEADER,
  31. SHOW_FEAT_HEADER_FULL_INFO,
  32. };
  33. struct perf_tool {
  34. event_sample sample,
  35. read;
  36. event_op mmap,
  37. mmap2,
  38. comm,
  39. namespaces,
  40. fork,
  41. exit,
  42. lost,
  43. lost_samples,
  44. aux,
  45. itrace_start,
  46. context_switch,
  47. throttle,
  48. unthrottle;
  49. event_attr_op attr;
  50. event_attr_op event_update;
  51. event_op2 tracing_data;
  52. event_oe finished_round;
  53. event_op2 build_id,
  54. id_index,
  55. auxtrace_info,
  56. auxtrace_error,
  57. time_conv,
  58. thread_map,
  59. cpu_map,
  60. stat_config,
  61. stat,
  62. stat_round,
  63. feature;
  64. event_op3 auxtrace;
  65. bool ordered_events;
  66. bool ordering_requires_timestamps;
  67. bool namespace_events;
  68. bool no_warn;
  69. enum show_feature_header show_feat_hdr;
  70. };
  71. #endif /* __PERF_TOOL_H */