tool.h 1.7 KB

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