^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 creds
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) #define TRACE_INCLUDE_PATH trace/hooks
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) #if !defined(_TRACE_HOOK_CREDS_H) || defined(TRACE_HEADER_MULTI_READ)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) #define _TRACE_HOOK_CREDS_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 cred;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) struct task_struct;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) /* struct cred */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) #include <linux/cred.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) /* struct task_struct */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) #include <linux/sched.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) #endif /* __GENKSYMS__ */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) DECLARE_HOOK(android_vh_commit_creds,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) TP_PROTO(const struct task_struct *task, const struct cred *new),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) TP_ARGS(task, new));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) DECLARE_HOOK(android_vh_exit_creds,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) TP_PROTO(const struct task_struct *task, const struct cred *cred),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) TP_ARGS(task, cred));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) DECLARE_HOOK(android_vh_override_creds,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) TP_PROTO(const struct task_struct *task, const struct cred *new),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) TP_ARGS(task, new));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) DECLARE_HOOK(android_vh_revert_creds,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) TP_PROTO(const struct task_struct *task, const struct cred *old),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) TP_ARGS(task, old));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) #endif /* _TRACE_HOOK_CREDS_H */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) /* This part must be outside protection */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) #include <trace/define_trace.h>