futex.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #undef TRACE_SYSTEM
  3. #define TRACE_SYSTEM futex
  4. #undef TRACE_INCLUDE_PATH
  5. #define TRACE_INCLUDE_PATH trace/hooks
  6. #if !defined(_TRACE_HOOK_FUTEX_H) || defined(TRACE_HEADER_MULTI_READ)
  7. #define _TRACE_HOOK_FUTEX_H
  8. #include <linux/tracepoint.h>
  9. #include <trace/hooks/vendor_hooks.h>
  10. #include <linux/plist.h>
  11. #ifndef __GENKSYMS__
  12. #include <linux/futex.h>
  13. #endif
  14. /*
  15. * Following tracepoints are not exported in tracefs and provide a
  16. * mechanism for vendor modules to hook and extend functionality
  17. */
  18. DECLARE_HOOK(android_vh_alter_futex_plist_add,
  19. TP_PROTO(struct plist_node *node,
  20. struct plist_head *head,
  21. bool *already_on_hb),
  22. TP_ARGS(node, head, already_on_hb));
  23. DECLARE_HOOK(android_vh_futex_sleep_start,
  24. TP_PROTO(struct task_struct *p),
  25. TP_ARGS(p));
  26. DECLARE_HOOK(android_vh_do_futex,
  27. TP_PROTO(int cmd,
  28. unsigned int *flags,
  29. u32 __user *uaddr2),
  30. TP_ARGS(cmd, flags, uaddr2));
  31. DECLARE_HOOK(android_vh_futex_wait_start,
  32. TP_PROTO(unsigned int flags,
  33. u32 bitset),
  34. TP_ARGS(flags, bitset));
  35. DECLARE_HOOK(android_vh_futex_wait_end,
  36. TP_PROTO(unsigned int flags,
  37. u32 bitset),
  38. TP_ARGS(flags, bitset));
  39. DECLARE_HOOK(android_vh_futex_wake_traverse_plist,
  40. TP_PROTO(struct plist_head *chain, int *target_nr,
  41. union futex_key key, u32 bitset),
  42. TP_ARGS(chain, target_nr, key, bitset));
  43. DECLARE_HOOK(android_vh_futex_wake_this,
  44. TP_PROTO(int ret, int nr_wake, int target_nr,
  45. struct task_struct *p),
  46. TP_ARGS(ret, nr_wake, target_nr, p));
  47. DECLARE_HOOK(android_vh_futex_wake_up_q_finish,
  48. TP_PROTO(int nr_wake, int target_nr),
  49. TP_ARGS(nr_wake, target_nr));
  50. /* macro versions of hooks are no longer required */
  51. #endif /* _TRACE_HOOK_FUTEX_H */
  52. /* This part must be outside protection */
  53. #include <trace/define_trace.h>