trace.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. #undef TRACE_SYSTEM
  2. #define TRACE_SYSTEM regmap
  3. #if !defined(_TRACE_REGMAP_H) || defined(TRACE_HEADER_MULTI_READ)
  4. #define _TRACE_REGMAP_H
  5. #include <linux/ktime.h>
  6. #include <linux/tracepoint.h>
  7. #include "internal.h"
  8. /*
  9. * Log register events
  10. */
  11. DECLARE_EVENT_CLASS(regmap_reg,
  12. TP_PROTO(struct regmap *map, unsigned int reg,
  13. unsigned int val),
  14. TP_ARGS(map, reg, val),
  15. TP_STRUCT__entry(
  16. __string( name, regmap_name(map) )
  17. __field( unsigned int, reg )
  18. __field( unsigned int, val )
  19. ),
  20. TP_fast_assign(
  21. __assign_str(name, regmap_name(map));
  22. __entry->reg = reg;
  23. __entry->val = val;
  24. ),
  25. TP_printk("%s reg=%x val=%x", __get_str(name),
  26. (unsigned int)__entry->reg,
  27. (unsigned int)__entry->val)
  28. );
  29. DEFINE_EVENT(regmap_reg, regmap_reg_write,
  30. TP_PROTO(struct regmap *map, unsigned int reg,
  31. unsigned int val),
  32. TP_ARGS(map, reg, val)
  33. );
  34. DEFINE_EVENT(regmap_reg, regmap_reg_read,
  35. TP_PROTO(struct regmap *map, unsigned int reg,
  36. unsigned int val),
  37. TP_ARGS(map, reg, val)
  38. );
  39. DEFINE_EVENT(regmap_reg, regmap_reg_read_cache,
  40. TP_PROTO(struct regmap *map, unsigned int reg,
  41. unsigned int val),
  42. TP_ARGS(map, reg, val)
  43. );
  44. DECLARE_EVENT_CLASS(regmap_block,
  45. TP_PROTO(struct regmap *map, unsigned int reg, int count),
  46. TP_ARGS(map, reg, count),
  47. TP_STRUCT__entry(
  48. __string( name, regmap_name(map) )
  49. __field( unsigned int, reg )
  50. __field( int, count )
  51. ),
  52. TP_fast_assign(
  53. __assign_str(name, regmap_name(map));
  54. __entry->reg = reg;
  55. __entry->count = count;
  56. ),
  57. TP_printk("%s reg=%x count=%d", __get_str(name),
  58. (unsigned int)__entry->reg,
  59. (int)__entry->count)
  60. );
  61. DEFINE_EVENT(regmap_block, regmap_hw_read_start,
  62. TP_PROTO(struct regmap *map, unsigned int reg, int count),
  63. TP_ARGS(map, reg, count)
  64. );
  65. DEFINE_EVENT(regmap_block, regmap_hw_read_done,
  66. TP_PROTO(struct regmap *map, unsigned int reg, int count),
  67. TP_ARGS(map, reg, count)
  68. );
  69. DEFINE_EVENT(regmap_block, regmap_hw_write_start,
  70. TP_PROTO(struct regmap *map, unsigned int reg, int count),
  71. TP_ARGS(map, reg, count)
  72. );
  73. DEFINE_EVENT(regmap_block, regmap_hw_write_done,
  74. TP_PROTO(struct regmap *map, unsigned int reg, int count),
  75. TP_ARGS(map, reg, count)
  76. );
  77. TRACE_EVENT(regcache_sync,
  78. TP_PROTO(struct regmap *map, const char *type,
  79. const char *status),
  80. TP_ARGS(map, type, status),
  81. TP_STRUCT__entry(
  82. __string( name, regmap_name(map) )
  83. __string( status, status )
  84. __string( type, type )
  85. __field( int, type )
  86. ),
  87. TP_fast_assign(
  88. __assign_str(name, regmap_name(map));
  89. __assign_str(status, status);
  90. __assign_str(type, type);
  91. ),
  92. TP_printk("%s type=%s status=%s", __get_str(name),
  93. __get_str(type), __get_str(status))
  94. );
  95. DECLARE_EVENT_CLASS(regmap_bool,
  96. TP_PROTO(struct regmap *map, bool flag),
  97. TP_ARGS(map, flag),
  98. TP_STRUCT__entry(
  99. __string( name, regmap_name(map) )
  100. __field( int, flag )
  101. ),
  102. TP_fast_assign(
  103. __assign_str(name, regmap_name(map));
  104. __entry->flag = flag;
  105. ),
  106. TP_printk("%s flag=%d", __get_str(name),
  107. (int)__entry->flag)
  108. );
  109. DEFINE_EVENT(regmap_bool, regmap_cache_only,
  110. TP_PROTO(struct regmap *map, bool flag),
  111. TP_ARGS(map, flag)
  112. );
  113. DEFINE_EVENT(regmap_bool, regmap_cache_bypass,
  114. TP_PROTO(struct regmap *map, bool flag),
  115. TP_ARGS(map, flag)
  116. );
  117. DECLARE_EVENT_CLASS(regmap_async,
  118. TP_PROTO(struct regmap *map),
  119. TP_ARGS(map),
  120. TP_STRUCT__entry(
  121. __string( name, regmap_name(map) )
  122. ),
  123. TP_fast_assign(
  124. __assign_str(name, regmap_name(map));
  125. ),
  126. TP_printk("%s", __get_str(name))
  127. );
  128. DEFINE_EVENT(regmap_block, regmap_async_write_start,
  129. TP_PROTO(struct regmap *map, unsigned int reg, int count),
  130. TP_ARGS(map, reg, count)
  131. );
  132. DEFINE_EVENT(regmap_async, regmap_async_io_complete,
  133. TP_PROTO(struct regmap *map),
  134. TP_ARGS(map)
  135. );
  136. DEFINE_EVENT(regmap_async, regmap_async_complete_start,
  137. TP_PROTO(struct regmap *map),
  138. TP_ARGS(map)
  139. );
  140. DEFINE_EVENT(regmap_async, regmap_async_complete_done,
  141. TP_PROTO(struct regmap *map),
  142. TP_ARGS(map)
  143. );
  144. TRACE_EVENT(regcache_drop_region,
  145. TP_PROTO(struct regmap *map, unsigned int from,
  146. unsigned int to),
  147. TP_ARGS(map, from, to),
  148. TP_STRUCT__entry(
  149. __string( name, regmap_name(map) )
  150. __field( unsigned int, from )
  151. __field( unsigned int, to )
  152. ),
  153. TP_fast_assign(
  154. __assign_str(name, regmap_name(map));
  155. __entry->from = from;
  156. __entry->to = to;
  157. ),
  158. TP_printk("%s %u-%u", __get_str(name), (unsigned int)__entry->from,
  159. (unsigned int)__entry->to)
  160. );
  161. #endif /* _TRACE_REGMAP_H */
  162. #undef TRACE_INCLUDE_PATH
  163. #define TRACE_INCLUDE_PATH .
  164. #undef TRACE_INCLUDE_FILE
  165. #define TRACE_INCLUDE_FILE trace
  166. /* This part must be outside protection */
  167. #include <trace/define_trace.h>