tlb.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #undef TRACE_SYSTEM
  3. #define TRACE_SYSTEM tlb
  4. #if !defined(_TRACE_TLB_H) || defined(TRACE_HEADER_MULTI_READ)
  5. #define _TRACE_TLB_H
  6. #include <linux/mm_types.h>
  7. #include <linux/tracepoint.h>
  8. #define TLB_FLUSH_REASON \
  9. EM( TLB_FLUSH_ON_TASK_SWITCH, "flush on task switch" ) \
  10. EM( TLB_REMOTE_SHOOTDOWN, "remote shootdown" ) \
  11. EM( TLB_LOCAL_SHOOTDOWN, "local shootdown" ) \
  12. EM( TLB_LOCAL_MM_SHOOTDOWN, "local mm shootdown" ) \
  13. EMe( TLB_REMOTE_SEND_IPI, "remote ipi send" )
  14. /*
  15. * First define the enums in TLB_FLUSH_REASON to be exported to userspace
  16. * via TRACE_DEFINE_ENUM().
  17. */
  18. #undef EM
  19. #undef EMe
  20. #define EM(a,b) TRACE_DEFINE_ENUM(a);
  21. #define EMe(a,b) TRACE_DEFINE_ENUM(a);
  22. TLB_FLUSH_REASON
  23. /*
  24. * Now redefine the EM() and EMe() macros to map the enums to the strings
  25. * that will be printed in the output.
  26. */
  27. #undef EM
  28. #undef EMe
  29. #define EM(a,b) { a, b },
  30. #define EMe(a,b) { a, b }
  31. TRACE_EVENT(tlb_flush,
  32. TP_PROTO(int reason, unsigned long pages),
  33. TP_ARGS(reason, pages),
  34. TP_STRUCT__entry(
  35. __field( int, reason)
  36. __field(unsigned long, pages)
  37. ),
  38. TP_fast_assign(
  39. __entry->reason = reason;
  40. __entry->pages = pages;
  41. ),
  42. TP_printk("pages:%ld reason:%s (%d)",
  43. __entry->pages,
  44. __print_symbolic(__entry->reason, TLB_FLUSH_REASON),
  45. __entry->reason)
  46. );
  47. #endif /* _TRACE_TLB_H */
  48. /* This part must be outside protection */
  49. #include <trace/define_trace.h>