Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef _TRACE_SYSCALL_H
0003 #define _TRACE_SYSCALL_H
0004 
0005 #include <linux/tracepoint.h>
0006 #include <linux/unistd.h>
0007 #include <linux/trace_events.h>
0008 #include <linux/thread_info.h>
0009 
0010 #include <asm/ptrace.h>
0011 
0012 
0013 /*
0014  * A syscall entry in the ftrace syscalls array.
0015  *
0016  * @name: name of the syscall
0017  * @syscall_nr: number of the syscall
0018  * @nb_args: number of parameters it takes
0019  * @types: list of types as strings
0020  * @args: list of args as strings (args[i] matches types[i])
0021  * @enter_fields: list of fields for syscall_enter trace event
0022  * @enter_event: associated syscall_enter trace event
0023  * @exit_event: associated syscall_exit trace event
0024  */
0025 struct syscall_metadata {
0026     const char  *name;
0027     int     syscall_nr;
0028     int     nb_args;
0029     const char  **types;
0030     const char  **args;
0031     struct list_head enter_fields;
0032 
0033     struct trace_event_call *enter_event;
0034     struct trace_event_call *exit_event;
0035 };
0036 
0037 #if defined(CONFIG_TRACEPOINTS) && defined(CONFIG_HAVE_SYSCALL_TRACEPOINTS)
0038 static inline void syscall_tracepoint_update(struct task_struct *p)
0039 {
0040     if (test_syscall_work(SYSCALL_TRACEPOINT))
0041         set_task_syscall_work(p, SYSCALL_TRACEPOINT);
0042     else
0043         clear_task_syscall_work(p, SYSCALL_TRACEPOINT);
0044 }
0045 #else
0046 static inline void syscall_tracepoint_update(struct task_struct *p)
0047 {
0048 }
0049 #endif
0050 
0051 #endif /* _TRACE_SYSCALL_H */