tlb.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #undef TRACE_SYSTEM
  2. #define TRACE_SYSTEM tlb
  3. #if !defined(_TRACE_TLB_H) || defined(TRACE_HEADER_MULTI_READ)
  4. #define _TRACE_TLB_H
  5. #include <linux/mm_types.h>
  6. #include <linux/tracepoint.h>
  7. #define TLB_FLUSH_REASON \
  8. EM( TLB_FLUSH_ON_TASK_SWITCH, "flush on task switch" ) \
  9. EM( TLB_REMOTE_SHOOTDOWN, "remote shootdown" ) \
  10. EM( TLB_LOCAL_SHOOTDOWN, "local shootdown" ) \
  11. EM( TLB_LOCAL_MM_SHOOTDOWN, "local mm shootdown" ) \
  12. EMe( TLB_REMOTE_SEND_IPI, "remote ipi send" )
  13. /*
  14. * First define the enums in TLB_FLUSH_REASON to be exported to userspace
  15. * via TRACE_DEFINE_ENUM().
  16. */
  17. #undef EM
  18. #undef EMe
  19. #define EM(a,b) TRACE_DEFINE_ENUM(a);
  20. #define EMe(a,b) TRACE_DEFINE_ENUM(a);
  21. TLB_FLUSH_REASON
  22. /*
  23. * Now redefine the EM() and EMe() macros to map the enums to the strings
  24. * that will be printed in the output.
  25. */
  26. #undef EM
  27. #undef EMe
  28. #define EM(a,b) { a, b },
  29. #define EMe(a,b) { a, b }
  30. TRACE_EVENT_CONDITION(tlb_flush,
  31. TP_PROTO(int reason, unsigned long pages),
  32. TP_ARGS(reason, pages),
  33. TP_CONDITION(cpu_online(smp_processor_id())),
  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>