trace_augment.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #ifndef TRACE_AUGMENT_H
  2. #define TRACE_AUGMENT_H
  3. #include <linux/compiler.h>
  4. struct bpf_program;
  5. struct evlist;
  6. #ifdef HAVE_BPF_SKEL
  7. int augmented_syscalls__prepare(void);
  8. int augmented_syscalls__create_bpf_output(struct evlist *evlist);
  9. void augmented_syscalls__setup_bpf_output(void);
  10. int augmented_syscalls__set_filter_pids(unsigned int nr, pid_t *pids);
  11. int augmented_syscalls__get_map_fds(int *enter_fd, int *exit_fd, int *beauty_fd);
  12. struct bpf_program *augmented_syscalls__find_by_title(const char *name);
  13. struct bpf_program *augmented_syscalls__unaugmented(void);
  14. void augmented_syscalls__cleanup(void);
  15. #else /* !HAVE_BPF_SKEL */
  16. static inline int augmented_syscalls__prepare(void)
  17. {
  18. return -1;
  19. }
  20. static inline int augmented_syscalls__create_bpf_output(struct evlist *evlist __maybe_unused)
  21. {
  22. return -1;
  23. }
  24. static inline void augmented_syscalls__setup_bpf_output(void)
  25. {
  26. }
  27. static inline int augmented_syscalls__set_filter_pids(unsigned int nr __maybe_unused,
  28. pid_t *pids __maybe_unused)
  29. {
  30. return 0;
  31. }
  32. static inline int augmented_syscalls__get_map_fds(int *enter_fd __maybe_unused,
  33. int *exit_fd __maybe_unused,
  34. int *beauty_fd __maybe_unused)
  35. {
  36. return -1;
  37. }
  38. static inline struct bpf_program *
  39. augmented_syscalls__find_by_title(const char *name __maybe_unused)
  40. {
  41. return NULL;
  42. }
  43. static inline struct bpf_program *augmented_syscalls__unaugmented(void)
  44. {
  45. return NULL;
  46. }
  47. static inline void augmented_syscalls__cleanup(void)
  48. {
  49. }
  50. #endif /* HAVE_BPF_SKEL */
  51. #endif