syscall.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #ifndef _TRACE_SYSCALL_H
  2. #define _TRACE_SYSCALL_H
  3. #include <linux/tracepoint.h>
  4. #include <linux/unistd.h>
  5. #include <linux/ftrace_event.h>
  6. #include <asm/ptrace.h>
  7. /*
  8. * A syscall entry in the ftrace syscalls array.
  9. *
  10. * @name: name of the syscall
  11. * @nb_args: number of parameters it takes
  12. * @types: list of types as strings
  13. * @args: list of args as strings (args[i] matches types[i])
  14. * @enter_event: associated syscall_enter trace event
  15. * @exit_event: associated syscall_exit trace event
  16. */
  17. struct syscall_metadata {
  18. const char *name;
  19. int nb_args;
  20. const char **types;
  21. const char **args;
  22. struct ftrace_event_call *enter_event;
  23. struct ftrace_event_call *exit_event;
  24. };
  25. #ifdef CONFIG_FTRACE_SYSCALLS
  26. extern unsigned long arch_syscall_addr(int nr);
  27. extern int syscall_name_to_nr(const char *name);
  28. extern int syscall_enter_format(struct ftrace_event_call *call,
  29. struct trace_seq *s);
  30. extern int syscall_exit_format(struct ftrace_event_call *call,
  31. struct trace_seq *s);
  32. extern int syscall_enter_define_fields(struct ftrace_event_call *call);
  33. extern int syscall_exit_define_fields(struct ftrace_event_call *call);
  34. extern int reg_event_syscall_enter(struct ftrace_event_call *call);
  35. extern void unreg_event_syscall_enter(struct ftrace_event_call *call);
  36. extern int reg_event_syscall_exit(struct ftrace_event_call *call);
  37. extern void unreg_event_syscall_exit(struct ftrace_event_call *call);
  38. extern int
  39. ftrace_format_syscall(struct ftrace_event_call *call, struct trace_seq *s);
  40. enum print_line_t print_syscall_enter(struct trace_iterator *iter, int flags);
  41. enum print_line_t print_syscall_exit(struct trace_iterator *iter, int flags);
  42. #endif
  43. #ifdef CONFIG_EVENT_PROFILE
  44. int reg_prof_syscall_enter(char *name);
  45. void unreg_prof_syscall_enter(char *name);
  46. int reg_prof_syscall_exit(char *name);
  47. void unreg_prof_syscall_exit(char *name);
  48. #endif
  49. #endif /* _TRACE_SYSCALL_H */