clk.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. /*
  2. * Copyright (c) 2014-2015, The Linux Foundation. All rights reserved.
  3. *
  4. * This software is licensed under the terms of the GNU General Public
  5. * License version 2, as published by the Free Software Foundation, and
  6. * may be copied, distributed, and modified under those terms.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. */
  13. #undef TRACE_SYSTEM
  14. #define TRACE_SYSTEM clk
  15. #if !defined(_TRACE_CLK_H) || defined(TRACE_HEADER_MULTI_READ)
  16. #define _TRACE_CLK_H
  17. #include <linux/tracepoint.h>
  18. struct clk_core;
  19. DECLARE_EVENT_CLASS(clk,
  20. TP_PROTO(struct clk_core *core),
  21. TP_ARGS(core),
  22. TP_STRUCT__entry(
  23. __string( name, core->name )
  24. ),
  25. TP_fast_assign(
  26. __assign_str(name, core->name);
  27. ),
  28. TP_printk("%s", __get_str(name))
  29. );
  30. DEFINE_EVENT(clk, clk_enable,
  31. TP_PROTO(struct clk_core *core),
  32. TP_ARGS(core)
  33. );
  34. DEFINE_EVENT(clk, clk_enable_complete,
  35. TP_PROTO(struct clk_core *core),
  36. TP_ARGS(core)
  37. );
  38. DEFINE_EVENT(clk, clk_disable,
  39. TP_PROTO(struct clk_core *core),
  40. TP_ARGS(core)
  41. );
  42. DEFINE_EVENT(clk, clk_disable_complete,
  43. TP_PROTO(struct clk_core *core),
  44. TP_ARGS(core)
  45. );
  46. DEFINE_EVENT(clk, clk_prepare,
  47. TP_PROTO(struct clk_core *core),
  48. TP_ARGS(core)
  49. );
  50. DEFINE_EVENT(clk, clk_prepare_complete,
  51. TP_PROTO(struct clk_core *core),
  52. TP_ARGS(core)
  53. );
  54. DEFINE_EVENT(clk, clk_unprepare,
  55. TP_PROTO(struct clk_core *core),
  56. TP_ARGS(core)
  57. );
  58. DEFINE_EVENT(clk, clk_unprepare_complete,
  59. TP_PROTO(struct clk_core *core),
  60. TP_ARGS(core)
  61. );
  62. DECLARE_EVENT_CLASS(clk_rate,
  63. TP_PROTO(struct clk_core *core, unsigned long rate),
  64. TP_ARGS(core, rate),
  65. TP_STRUCT__entry(
  66. __string( name, core->name )
  67. __field(unsigned long, rate )
  68. ),
  69. TP_fast_assign(
  70. __assign_str(name, core->name);
  71. __entry->rate = rate;
  72. ),
  73. TP_printk("%s %lu", __get_str(name), (unsigned long)__entry->rate)
  74. );
  75. DEFINE_EVENT(clk_rate, clk_set_rate,
  76. TP_PROTO(struct clk_core *core, unsigned long rate),
  77. TP_ARGS(core, rate)
  78. );
  79. DEFINE_EVENT(clk_rate, clk_set_rate_complete,
  80. TP_PROTO(struct clk_core *core, unsigned long rate),
  81. TP_ARGS(core, rate)
  82. );
  83. DECLARE_EVENT_CLASS(clk_parent,
  84. TP_PROTO(struct clk_core *core, struct clk_core *parent),
  85. TP_ARGS(core, parent),
  86. TP_STRUCT__entry(
  87. __string( name, core->name )
  88. __string( pname, parent ? parent->name : "none" )
  89. ),
  90. TP_fast_assign(
  91. __assign_str(name, core->name);
  92. __assign_str(pname, parent ? parent->name : "none");
  93. ),
  94. TP_printk("%s %s", __get_str(name), __get_str(pname))
  95. );
  96. DEFINE_EVENT(clk_parent, clk_set_parent,
  97. TP_PROTO(struct clk_core *core, struct clk_core *parent),
  98. TP_ARGS(core, parent)
  99. );
  100. DEFINE_EVENT(clk_parent, clk_set_parent_complete,
  101. TP_PROTO(struct clk_core *core, struct clk_core *parent),
  102. TP_ARGS(core, parent)
  103. );
  104. DECLARE_EVENT_CLASS(clk_phase,
  105. TP_PROTO(struct clk_core *core, int phase),
  106. TP_ARGS(core, phase),
  107. TP_STRUCT__entry(
  108. __string( name, core->name )
  109. __field( int, phase )
  110. ),
  111. TP_fast_assign(
  112. __assign_str(name, core->name);
  113. __entry->phase = phase;
  114. ),
  115. TP_printk("%s %d", __get_str(name), (int)__entry->phase)
  116. );
  117. DEFINE_EVENT(clk_phase, clk_set_phase,
  118. TP_PROTO(struct clk_core *core, int phase),
  119. TP_ARGS(core, phase)
  120. );
  121. DEFINE_EVENT(clk_phase, clk_set_phase_complete,
  122. TP_PROTO(struct clk_core *core, int phase),
  123. TP_ARGS(core, phase)
  124. );
  125. DECLARE_EVENT_CLASS(clk_duty_cycle,
  126. TP_PROTO(struct clk_core *core, struct clk_duty *duty),
  127. TP_ARGS(core, duty),
  128. TP_STRUCT__entry(
  129. __string( name, core->name )
  130. __field( unsigned int, num )
  131. __field( unsigned int, den )
  132. ),
  133. TP_fast_assign(
  134. __assign_str(name, core->name);
  135. __entry->num = duty->num;
  136. __entry->den = duty->den;
  137. ),
  138. TP_printk("%s %u/%u", __get_str(name), (unsigned int)__entry->num,
  139. (unsigned int)__entry->den)
  140. );
  141. DEFINE_EVENT(clk_duty_cycle, clk_set_duty_cycle,
  142. TP_PROTO(struct clk_core *core, struct clk_duty *duty),
  143. TP_ARGS(core, duty)
  144. );
  145. DEFINE_EVENT(clk_duty_cycle, clk_set_duty_cycle_complete,
  146. TP_PROTO(struct clk_core *core, struct clk_duty *duty),
  147. TP_ARGS(core, duty)
  148. );
  149. #endif /* _TRACE_CLK_H */
  150. /* This part must be outside protection */
  151. #include <trace/define_trace.h>