clk.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2014-2015, The Linux Foundation. All rights reserved.
  4. */
  5. #undef TRACE_SYSTEM
  6. #define TRACE_SYSTEM clk
  7. #if !defined(_TRACE_CLK_H) || defined(TRACE_HEADER_MULTI_READ)
  8. #define _TRACE_CLK_H
  9. #include <linux/tracepoint.h>
  10. struct clk_core;
  11. DECLARE_EVENT_CLASS(clk,
  12. TP_PROTO(struct clk_core *core),
  13. TP_ARGS(core),
  14. TP_STRUCT__entry(
  15. __string( name, core->name )
  16. ),
  17. TP_fast_assign(
  18. __assign_str(name, core->name);
  19. ),
  20. TP_printk("%s", __get_str(name))
  21. );
  22. DEFINE_EVENT(clk, clk_enable,
  23. TP_PROTO(struct clk_core *core),
  24. TP_ARGS(core)
  25. );
  26. DEFINE_EVENT(clk, clk_enable_complete,
  27. TP_PROTO(struct clk_core *core),
  28. TP_ARGS(core)
  29. );
  30. DEFINE_EVENT(clk, clk_disable,
  31. TP_PROTO(struct clk_core *core),
  32. TP_ARGS(core)
  33. );
  34. DEFINE_EVENT(clk, clk_disable_complete,
  35. TP_PROTO(struct clk_core *core),
  36. TP_ARGS(core)
  37. );
  38. DEFINE_EVENT(clk, clk_prepare,
  39. TP_PROTO(struct clk_core *core),
  40. TP_ARGS(core)
  41. );
  42. DEFINE_EVENT(clk, clk_prepare_complete,
  43. TP_PROTO(struct clk_core *core),
  44. TP_ARGS(core)
  45. );
  46. DEFINE_EVENT(clk, clk_unprepare,
  47. TP_PROTO(struct clk_core *core),
  48. TP_ARGS(core)
  49. );
  50. DEFINE_EVENT(clk, clk_unprepare_complete,
  51. TP_PROTO(struct clk_core *core),
  52. TP_ARGS(core)
  53. );
  54. DECLARE_EVENT_CLASS(clk_rate,
  55. TP_PROTO(struct clk_core *core, unsigned long rate),
  56. TP_ARGS(core, rate),
  57. TP_STRUCT__entry(
  58. __string( name, core->name )
  59. __field(unsigned long, rate )
  60. ),
  61. TP_fast_assign(
  62. __assign_str(name, core->name);
  63. __entry->rate = rate;
  64. ),
  65. TP_printk("%s %lu", __get_str(name), (unsigned long)__entry->rate)
  66. );
  67. DEFINE_EVENT(clk_rate, clk_set_rate,
  68. TP_PROTO(struct clk_core *core, unsigned long rate),
  69. TP_ARGS(core, rate)
  70. );
  71. DEFINE_EVENT(clk_rate, clk_set_rate_complete,
  72. TP_PROTO(struct clk_core *core, unsigned long rate),
  73. TP_ARGS(core, rate)
  74. );
  75. DEFINE_EVENT(clk_rate, clk_set_min_rate,
  76. TP_PROTO(struct clk_core *core, unsigned long rate),
  77. TP_ARGS(core, rate)
  78. );
  79. DEFINE_EVENT(clk_rate, clk_set_max_rate,
  80. TP_PROTO(struct clk_core *core, unsigned long rate),
  81. TP_ARGS(core, rate)
  82. );
  83. DECLARE_EVENT_CLASS(clk_rate_range,
  84. TP_PROTO(struct clk_core *core, unsigned long min, unsigned long max),
  85. TP_ARGS(core, min, max),
  86. TP_STRUCT__entry(
  87. __string( name, core->name )
  88. __field(unsigned long, min )
  89. __field(unsigned long, max )
  90. ),
  91. TP_fast_assign(
  92. __assign_str(name, core->name);
  93. __entry->min = min;
  94. __entry->max = max;
  95. ),
  96. TP_printk("%s min %lu max %lu", __get_str(name),
  97. (unsigned long)__entry->min,
  98. (unsigned long)__entry->max)
  99. );
  100. DEFINE_EVENT(clk_rate_range, clk_set_rate_range,
  101. TP_PROTO(struct clk_core *core, unsigned long min, unsigned long max),
  102. TP_ARGS(core, min, max)
  103. );
  104. DECLARE_EVENT_CLASS(clk_parent,
  105. TP_PROTO(struct clk_core *core, struct clk_core *parent),
  106. TP_ARGS(core, parent),
  107. TP_STRUCT__entry(
  108. __string( name, core->name )
  109. __string( pname, parent ? parent->name : "none" )
  110. ),
  111. TP_fast_assign(
  112. __assign_str(name, core->name);
  113. __assign_str(pname, parent ? parent->name : "none");
  114. ),
  115. TP_printk("%s %s", __get_str(name), __get_str(pname))
  116. );
  117. DEFINE_EVENT(clk_parent, clk_set_parent,
  118. TP_PROTO(struct clk_core *core, struct clk_core *parent),
  119. TP_ARGS(core, parent)
  120. );
  121. DEFINE_EVENT(clk_parent, clk_set_parent_complete,
  122. TP_PROTO(struct clk_core *core, struct clk_core *parent),
  123. TP_ARGS(core, parent)
  124. );
  125. DECLARE_EVENT_CLASS(clk_phase,
  126. TP_PROTO(struct clk_core *core, int phase),
  127. TP_ARGS(core, phase),
  128. TP_STRUCT__entry(
  129. __string( name, core->name )
  130. __field( int, phase )
  131. ),
  132. TP_fast_assign(
  133. __assign_str(name, core->name);
  134. __entry->phase = phase;
  135. ),
  136. TP_printk("%s %d", __get_str(name), (int)__entry->phase)
  137. );
  138. DEFINE_EVENT(clk_phase, clk_set_phase,
  139. TP_PROTO(struct clk_core *core, int phase),
  140. TP_ARGS(core, phase)
  141. );
  142. DEFINE_EVENT(clk_phase, clk_set_phase_complete,
  143. TP_PROTO(struct clk_core *core, int phase),
  144. TP_ARGS(core, phase)
  145. );
  146. DECLARE_EVENT_CLASS(clk_duty_cycle,
  147. TP_PROTO(struct clk_core *core, struct clk_duty *duty),
  148. TP_ARGS(core, duty),
  149. TP_STRUCT__entry(
  150. __string( name, core->name )
  151. __field( unsigned int, num )
  152. __field( unsigned int, den )
  153. ),
  154. TP_fast_assign(
  155. __assign_str(name, core->name);
  156. __entry->num = duty->num;
  157. __entry->den = duty->den;
  158. ),
  159. TP_printk("%s %u/%u", __get_str(name), (unsigned int)__entry->num,
  160. (unsigned int)__entry->den)
  161. );
  162. DEFINE_EVENT(clk_duty_cycle, clk_set_duty_cycle,
  163. TP_PROTO(struct clk_core *core, struct clk_duty *duty),
  164. TP_ARGS(core, duty)
  165. );
  166. DEFINE_EVENT(clk_duty_cycle, clk_set_duty_cycle_complete,
  167. TP_PROTO(struct clk_core *core, struct clk_duty *duty),
  168. TP_ARGS(core, duty)
  169. );
  170. #endif /* _TRACE_CLK_H */
  171. /* This part must be outside protection */
  172. #include <trace/define_trace.h>