syscall.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. * @syscall_nr: number of the syscall
  12. * @nb_args: number of parameters it takes
  13. * @types: list of types as strings
  14. * @args: list of args as strings (args[i] matches types[i])
  15. * @enter_event: associated syscall_enter trace event
  16. * @exit_event: associated syscall_exit trace event
  17. */
  18. struct syscall_metadata {
  19. const char *name;
  20. int syscall_nr;
  21. int nb_args;
  22. const char **types;
  23. const char **args;
  24. struct ftrace_event_call *enter_event;
  25. struct ftrace_event_call *exit_event;
  26. };
  27. #ifdef CONFIG_FTRACE_SYSCALLS
  28. extern unsigned long arch_syscall_addr(int nr);
  29. extern int init_syscall_trace(struct ftrace_event_call *call);
  30. extern int syscall_enter_format(struct ftrace_event_call *call,
  31. struct trace_seq *s);
  32. extern int syscall_exit_format(struct ftrace_event_call *call,
  33. struct trace_seq *s);
  34. extern int syscall_enter_define_fields(struct ftrace_event_call *call);
  35. extern int syscall_exit_define_fields(struct ftrace_event_call *call);
  36. extern int reg_event_syscall_enter(struct ftrace_event_call *call);
  37. extern void unreg_event_syscall_enter(struct ftrace_event_call *call);
  38. extern int reg_event_syscall_exit(struct ftrace_event_call *call);
  39. extern void unreg_event_syscall_exit(struct ftrace_event_call *call);
  40. extern int
  41. ftrace_format_syscall(struct ftrace_event_call *call, struct trace_seq *s);
  42. enum print_line_t print_syscall_enter(struct trace_iterator *iter, int flags);
  43. enum print_line_t print_syscall_exit(struct trace_iterator *iter, int flags);
  44. #endif
  45. #ifdef CONFIG_EVENT_PROFILE
  46. int prof_sysenter_enable(struct ftrace_event_call *call);
  47. void prof_sysenter_disable(struct ftrace_event_call *call);
  48. int prof_sysexit_enable(struct ftrace_event_call *call);
  49. void prof_sysexit_disable(struct ftrace_event_call *call);
  50. #endif
  51. #endif /* _TRACE_SYSCALL_H */