syscall.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #ifndef _TRACE_SYSCALL_H
  2. #define _TRACE_SYSCALL_H
  3. #include <linux/tracepoint.h>
  4. #include <linux/unistd.h>
  5. #include <linux/trace_events.h>
  6. #include <linux/thread_info.h>
  7. #include <asm/ptrace.h>
  8. /*
  9. * A syscall entry in the ftrace syscalls array.
  10. *
  11. * @name: name of the syscall
  12. * @syscall_nr: number of the syscall
  13. * @nb_args: number of parameters it takes
  14. * @types: list of types as strings
  15. * @args: list of args as strings (args[i] matches types[i])
  16. * @enter_fields: list of fields for syscall_enter trace event
  17. * @enter_event: associated syscall_enter trace event
  18. * @exit_event: associated syscall_exit trace event
  19. */
  20. struct syscall_metadata {
  21. const char *name;
  22. int syscall_nr;
  23. int nb_args;
  24. const char **types;
  25. const char **args;
  26. struct list_head enter_fields;
  27. struct trace_event_call *enter_event;
  28. struct trace_event_call *exit_event;
  29. };
  30. #if defined(CONFIG_TRACEPOINTS) && defined(CONFIG_HAVE_SYSCALL_TRACEPOINTS)
  31. static inline void syscall_tracepoint_update(struct task_struct *p)
  32. {
  33. if (test_thread_flag(TIF_SYSCALL_TRACEPOINT))
  34. set_tsk_thread_flag(p, TIF_SYSCALL_TRACEPOINT);
  35. else
  36. clear_tsk_thread_flag(p, TIF_SYSCALL_TRACEPOINT);
  37. }
  38. #else
  39. static inline void syscall_tracepoint_update(struct task_struct *p)
  40. {
  41. }
  42. #endif
  43. #endif /* _TRACE_SYSCALL_H */