Mirror of strace – the linux syscall tracer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

perf_event_struct.h 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*
  2. * Copyright (c) 2016-2018 Eugene Syromyatnikov <evgsyr@gmail.com>
  3. * All rights reserved.
  4. *
  5. * SPDX-License-Identifier: LGPL-2.1-or-later
  6. */
  7. #ifndef STRACE_LINUX_PERF_EVENT_STRUCT_H
  8. # define STRACE_LINUX_PERF_EVENT_STRUCT_H
  9. # include <stdint.h>
  10. struct perf_event_attr {
  11. uint32_t type;
  12. uint32_t size;
  13. uint64_t config;
  14. union {
  15. uint64_t sample_period;
  16. uint64_t sample_freq;
  17. };
  18. uint64_t sample_type;
  19. uint64_t read_format;
  20. uint64_t disabled :1,
  21. inherit :1,
  22. pinned :1,
  23. exclusive :1,
  24. exclude_user :1,
  25. exclude_kernel :1,
  26. exclude_hv :1,
  27. exclude_idle :1,
  28. mmap :1,
  29. comm :1,
  30. freq :1,
  31. inherit_stat :1,
  32. enable_on_exec :1,
  33. task :1,
  34. watermark :1,
  35. precise_ip :2,
  36. mmap_data :1,
  37. sample_id_all :1,
  38. exclude_host :1,
  39. exclude_guest :1,
  40. exclude_callchain_kernel :1,
  41. exclude_callchain_user :1,
  42. mmap2 :1,
  43. comm_exec :1,
  44. use_clockid :1,
  45. context_switch :1,
  46. write_backward :1,
  47. namespaces :1,
  48. __reserved_1 :35;
  49. union {
  50. uint32_t wakeup_events;
  51. uint32_t wakeup_watermark;
  52. };
  53. uint32_t bp_type;
  54. union {
  55. uint64_t bp_addr;
  56. uint64_t config1;
  57. };
  58. /* End of ver 0 - 64 bytes */
  59. union {
  60. uint64_t bp_len;
  61. uint64_t config2;
  62. };
  63. /* End of ver 1 - 72 bytes */
  64. uint64_t branch_sample_type;
  65. /* End of ver 2 - 80 bytes */
  66. uint64_t sample_regs_user;
  67. uint32_t sample_stack_user;
  68. int32_t clockid;
  69. /* End of ver 3 - 96 bytes */
  70. uint64_t sample_regs_intr;
  71. /* End of ver 4 - 104 bytes */
  72. uint32_t aux_watermark;
  73. uint16_t sample_max_stack;
  74. uint16_t __reserved_2;
  75. /* End of ver 5 - 112 bytes */
  76. };
  77. struct perf_event_query_bpf {
  78. uint32_t ids_len;
  79. uint32_t prog_cnt;
  80. uint32_t ids[0];
  81. };
  82. #endif /* !STRACE_LINUX_PERF_EVENT_STRUCT_H */