context_tracking.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #undef TRACE_SYSTEM
  3. #define TRACE_SYSTEM context_tracking
  4. #if !defined(_TRACE_CONTEXT_TRACKING_H) || defined(TRACE_HEADER_MULTI_READ)
  5. #define _TRACE_CONTEXT_TRACKING_H
  6. #include <linux/tracepoint.h>
  7. DECLARE_EVENT_CLASS(context_tracking_user,
  8. TP_PROTO(int dummy),
  9. TP_ARGS(dummy),
  10. TP_STRUCT__entry(
  11. __field( int, dummy )
  12. ),
  13. TP_fast_assign(
  14. __entry->dummy = dummy;
  15. ),
  16. TP_printk("%s", "")
  17. );
  18. /**
  19. * user_enter - called when the kernel resumes to userspace
  20. * @dummy: dummy arg to make trace event macro happy
  21. *
  22. * This event occurs when the kernel resumes to userspace after
  23. * an exception or a syscall.
  24. */
  25. DEFINE_EVENT(context_tracking_user, user_enter,
  26. TP_PROTO(int dummy),
  27. TP_ARGS(dummy)
  28. );
  29. /**
  30. * user_exit - called when userspace enters the kernel
  31. * @dummy: dummy arg to make trace event macro happy
  32. *
  33. * This event occurs when userspace enters the kernel through
  34. * an exception or a syscall.
  35. */
  36. DEFINE_EVENT(context_tracking_user, user_exit,
  37. TP_PROTO(int dummy),
  38. TP_ARGS(dummy)
  39. );
  40. #endif /* _TRACE_CONTEXT_TRACKING_H */
  41. /* This part must be outside protection */
  42. #include <trace/define_trace.h>