^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) #undef TRACE_SYSTEM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) #define TRACE_SYSTEM dtask
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) #define TRACE_INCLUDE_PATH trace/hooks
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) #if !defined(_TRACE_HOOK_DTASK_H) || defined(TRACE_HEADER_MULTI_READ)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) #define _TRACE_HOOK_DTASK_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) #include <linux/tracepoint.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) #include <trace/hooks/vendor_hooks.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) * Following tracepoints are not exported in tracefs and provide a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) * mechanism for vendor modules to hook and extend functionality
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #ifdef __GENKSYMS__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) struct mutex;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) struct rt_mutex;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) struct rw_semaphore;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) struct task_struct;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) /* struct mutex */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) #include <linux/mutex.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) /* struct rt_mutex */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) #include <linux/rtmutex.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) /* struct rw_semaphore */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) #include <linux/rwsem.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) /* struct task_struct */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) #include <linux/sched.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) #endif /* __GENKSYMS__ */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) DECLARE_HOOK(android_vh_mutex_wait_start,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) TP_PROTO(struct mutex *lock),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) TP_ARGS(lock));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) DECLARE_HOOK(android_vh_mutex_wait_finish,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) TP_PROTO(struct mutex *lock),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) TP_ARGS(lock));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) DECLARE_HOOK(android_vh_rtmutex_wait_start,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) TP_PROTO(struct rt_mutex *lock),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) TP_ARGS(lock));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) DECLARE_HOOK(android_vh_rtmutex_wait_finish,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) TP_PROTO(struct rt_mutex *lock),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) TP_ARGS(lock));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) DECLARE_HOOK(android_vh_rwsem_read_wait_start,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) TP_PROTO(struct rw_semaphore *sem),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) TP_ARGS(sem));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) DECLARE_HOOK(android_vh_rwsem_read_wait_finish,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) TP_PROTO(struct rw_semaphore *sem),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) TP_ARGS(sem));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) DECLARE_HOOK(android_vh_rwsem_write_wait_start,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) TP_PROTO(struct rw_semaphore *sem),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) TP_ARGS(sem));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) DECLARE_HOOK(android_vh_rwsem_write_wait_finish,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) TP_PROTO(struct rw_semaphore *sem),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) TP_ARGS(sem));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) DECLARE_HOOK(android_vh_sched_show_task,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) TP_PROTO(struct task_struct *task),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) TP_ARGS(task));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) DECLARE_HOOK(android_vh_alter_mutex_list_add,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) TP_PROTO(struct mutex *lock,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) struct mutex_waiter *waiter,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) struct list_head *list,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) bool *already_on_list),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) TP_ARGS(lock, waiter, list, already_on_list));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) DECLARE_HOOK(android_vh_mutex_unlock_slowpath,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) TP_PROTO(struct mutex *lock),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) TP_ARGS(lock));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) DECLARE_HOOK(android_vh_mutex_unlock_slowpath_end,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) TP_PROTO(struct mutex *lock, struct task_struct *next),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) TP_ARGS(lock, next));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) DECLARE_HOOK(android_vh_mutex_start_check_new_owner,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) TP_PROTO(struct mutex *lock),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) TP_ARGS(lock));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) /* macro versions of hooks are no longer required */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) #endif /* _TRACE_HOOK_DTASK_H */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) /* This part must be outside protection */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) #include <trace/define_trace.h>