xref: /OK3568_Linux_fs/kernel/include/trace/hooks/creds.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0 */
2*4882a593Smuzhiyun #undef TRACE_SYSTEM
3*4882a593Smuzhiyun #define TRACE_SYSTEM creds
4*4882a593Smuzhiyun 
5*4882a593Smuzhiyun #define TRACE_INCLUDE_PATH trace/hooks
6*4882a593Smuzhiyun #if !defined(_TRACE_HOOK_CREDS_H) || defined(TRACE_HEADER_MULTI_READ)
7*4882a593Smuzhiyun #define _TRACE_HOOK_CREDS_H
8*4882a593Smuzhiyun #include <linux/tracepoint.h>
9*4882a593Smuzhiyun #include <trace/hooks/vendor_hooks.h>
10*4882a593Smuzhiyun /*
11*4882a593Smuzhiyun  * Following tracepoints are not exported in tracefs and provide a
12*4882a593Smuzhiyun  * mechanism for vendor modules to hook and extend functionality
13*4882a593Smuzhiyun  */
14*4882a593Smuzhiyun #ifdef __GENKSYMS__
15*4882a593Smuzhiyun struct cred;
16*4882a593Smuzhiyun struct task_struct;
17*4882a593Smuzhiyun #else
18*4882a593Smuzhiyun /* struct cred */
19*4882a593Smuzhiyun #include <linux/cred.h>
20*4882a593Smuzhiyun /* struct task_struct */
21*4882a593Smuzhiyun #include <linux/sched.h>
22*4882a593Smuzhiyun #endif /* __GENKSYMS__ */
23*4882a593Smuzhiyun DECLARE_HOOK(android_vh_commit_creds,
24*4882a593Smuzhiyun 	TP_PROTO(const struct task_struct *task, const struct cred *new),
25*4882a593Smuzhiyun 	TP_ARGS(task, new));
26*4882a593Smuzhiyun 
27*4882a593Smuzhiyun DECLARE_HOOK(android_vh_exit_creds,
28*4882a593Smuzhiyun 	TP_PROTO(const struct task_struct *task, const struct cred *cred),
29*4882a593Smuzhiyun 	TP_ARGS(task, cred));
30*4882a593Smuzhiyun 
31*4882a593Smuzhiyun DECLARE_HOOK(android_vh_override_creds,
32*4882a593Smuzhiyun 	TP_PROTO(const struct task_struct *task, const struct cred *new),
33*4882a593Smuzhiyun 	TP_ARGS(task, new));
34*4882a593Smuzhiyun 
35*4882a593Smuzhiyun DECLARE_HOOK(android_vh_revert_creds,
36*4882a593Smuzhiyun 	TP_PROTO(const struct task_struct *task, const struct cred *old),
37*4882a593Smuzhiyun 	TP_ARGS(task, old));
38*4882a593Smuzhiyun 
39*4882a593Smuzhiyun #endif /* _TRACE_HOOK_CREDS_H */
40*4882a593Smuzhiyun /* This part must be outside protection */
41*4882a593Smuzhiyun #include <trace/define_trace.h>
42