percpu.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #undef TRACE_SYSTEM
  3. #define TRACE_SYSTEM percpu
  4. #if !defined(_TRACE_PERCPU_H) || defined(TRACE_HEADER_MULTI_READ)
  5. #define _TRACE_PERCPU_H
  6. #include <linux/tracepoint.h>
  7. TRACE_EVENT(percpu_alloc_percpu,
  8. TP_PROTO(bool reserved, bool is_atomic, size_t size,
  9. size_t align, void *base_addr, int off, void __percpu *ptr),
  10. TP_ARGS(reserved, is_atomic, size, align, base_addr, off, ptr),
  11. TP_STRUCT__entry(
  12. __field( bool, reserved )
  13. __field( bool, is_atomic )
  14. __field( size_t, size )
  15. __field( size_t, align )
  16. __field( void *, base_addr )
  17. __field( int, off )
  18. __field( void __percpu *, ptr )
  19. ),
  20. TP_fast_assign(
  21. __entry->reserved = reserved;
  22. __entry->is_atomic = is_atomic;
  23. __entry->size = size;
  24. __entry->align = align;
  25. __entry->base_addr = base_addr;
  26. __entry->off = off;
  27. __entry->ptr = ptr;
  28. ),
  29. TP_printk("reserved=%d is_atomic=%d size=%zu align=%zu base_addr=%p off=%d ptr=%p",
  30. __entry->reserved, __entry->is_atomic,
  31. __entry->size, __entry->align,
  32. __entry->base_addr, __entry->off, __entry->ptr)
  33. );
  34. TRACE_EVENT(percpu_free_percpu,
  35. TP_PROTO(void *base_addr, int off, void __percpu *ptr),
  36. TP_ARGS(base_addr, off, ptr),
  37. TP_STRUCT__entry(
  38. __field( void *, base_addr )
  39. __field( int, off )
  40. __field( void __percpu *, ptr )
  41. ),
  42. TP_fast_assign(
  43. __entry->base_addr = base_addr;
  44. __entry->off = off;
  45. __entry->ptr = ptr;
  46. ),
  47. TP_printk("base_addr=%p off=%d ptr=%p",
  48. __entry->base_addr, __entry->off, __entry->ptr)
  49. );
  50. TRACE_EVENT(percpu_alloc_percpu_fail,
  51. TP_PROTO(bool reserved, bool is_atomic, size_t size, size_t align),
  52. TP_ARGS(reserved, is_atomic, size, align),
  53. TP_STRUCT__entry(
  54. __field( bool, reserved )
  55. __field( bool, is_atomic )
  56. __field( size_t, size )
  57. __field( size_t, align )
  58. ),
  59. TP_fast_assign(
  60. __entry->reserved = reserved;
  61. __entry->is_atomic = is_atomic;
  62. __entry->size = size;
  63. __entry->align = align;
  64. ),
  65. TP_printk("reserved=%d is_atomic=%d size=%zu align=%zu",
  66. __entry->reserved, __entry->is_atomic,
  67. __entry->size, __entry->align)
  68. );
  69. TRACE_EVENT(percpu_create_chunk,
  70. TP_PROTO(void *base_addr),
  71. TP_ARGS(base_addr),
  72. TP_STRUCT__entry(
  73. __field( void *, base_addr )
  74. ),
  75. TP_fast_assign(
  76. __entry->base_addr = base_addr;
  77. ),
  78. TP_printk("base_addr=%p", __entry->base_addr)
  79. );
  80. TRACE_EVENT(percpu_destroy_chunk,
  81. TP_PROTO(void *base_addr),
  82. TP_ARGS(base_addr),
  83. TP_STRUCT__entry(
  84. __field( void *, base_addr )
  85. ),
  86. TP_fast_assign(
  87. __entry->base_addr = base_addr;
  88. ),
  89. TP_printk("base_addr=%p", __entry->base_addr)
  90. );
  91. #endif /* _TRACE_PERCPU_H */
  92. #include <trace/define_trace.h>