trace_msm_low_power.h 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. /* Copyright (c) 2012, 2014-2018, The Linux Foundation. All rights reserved.
  2. *
  3. * This program is free software; you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License version 2 and
  5. * only version 2 as published by the Free Software Foundation.
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. */
  12. #undef TRACE_SYSTEM
  13. #define TRACE_SYSTEM msm_low_power
  14. #if !defined(_TRACE_MSM_LOW_POWER_H_) || defined(TRACE_HEADER_MULTI_READ)
  15. #define _TRACE_MSM_LOW_POWER_H_
  16. #include <linux/tracepoint.h>
  17. TRACE_EVENT(cpu_power_select,
  18. TP_PROTO(int index, u32 sleep_us, u32 latency, u32 next_event_us),
  19. TP_ARGS(index, sleep_us, latency, next_event_us),
  20. TP_STRUCT__entry(
  21. __field(int, index)
  22. __field(u32, sleep_us)
  23. __field(u32, latency)
  24. __field(u32, next_event_us)
  25. ),
  26. TP_fast_assign(
  27. __entry->index = index;
  28. __entry->sleep_us = sleep_us;
  29. __entry->latency = latency;
  30. __entry->next_event_us = next_event_us;
  31. ),
  32. TP_printk("idx:%d sleep_time:%u latency:%u next_event:%u",
  33. __entry->index, __entry->sleep_us, __entry->latency,
  34. __entry->next_event_us)
  35. );
  36. TRACE_EVENT(cpu_pred_select,
  37. TP_PROTO(u32 predtype, u64 predicted, u32 tmr_time),
  38. TP_ARGS(predtype, predicted, tmr_time),
  39. TP_STRUCT__entry(
  40. __field(u32, predtype)
  41. __field(u64, predicted)
  42. __field(u32, tmr_time)
  43. ),
  44. TP_fast_assign(
  45. __entry->predtype = predtype;
  46. __entry->predicted = predicted;
  47. __entry->tmr_time = tmr_time;
  48. ),
  49. TP_printk("pred:%u time:%lu tmr_time:%u",
  50. __entry->predtype, (unsigned long)__entry->predicted,
  51. __entry->tmr_time)
  52. );
  53. TRACE_EVENT(cpu_pred_hist,
  54. TP_PROTO(int idx, u32 resi, u32 sample, u32 tmr),
  55. TP_ARGS(idx, resi, sample, tmr),
  56. TP_STRUCT__entry(
  57. __field(int, idx)
  58. __field(u32, resi)
  59. __field(u32, sample)
  60. __field(u32, tmr)
  61. ),
  62. TP_fast_assign(
  63. __entry->idx = idx;
  64. __entry->resi = resi;
  65. __entry->sample = sample;
  66. __entry->tmr = tmr;
  67. ),
  68. TP_printk("idx:%d resi:%u sample:%u tmr:%u",
  69. __entry->idx, __entry->resi,
  70. __entry->sample, __entry->tmr)
  71. );
  72. TRACE_EVENT(cpu_idle_enter,
  73. TP_PROTO(int index),
  74. TP_ARGS(index),
  75. TP_STRUCT__entry(
  76. __field(int, index)
  77. ),
  78. TP_fast_assign(
  79. __entry->index = index;
  80. ),
  81. TP_printk("idx:%d",
  82. __entry->index)
  83. );
  84. TRACE_EVENT(cpu_idle_exit,
  85. TP_PROTO(int index, bool success),
  86. TP_ARGS(index, success),
  87. TP_STRUCT__entry(
  88. __field(int, index)
  89. __field(bool, success)
  90. ),
  91. TP_fast_assign(
  92. __entry->index = index;
  93. __entry->success = success;
  94. ),
  95. TP_printk("idx:%d success:%d",
  96. __entry->index,
  97. __entry->success)
  98. );
  99. TRACE_EVENT(cluster_enter,
  100. TP_PROTO(const char *name, int index, unsigned long sync_cpus,
  101. unsigned long child_cpus, bool from_idle),
  102. TP_ARGS(name, index, sync_cpus, child_cpus, from_idle),
  103. TP_STRUCT__entry(
  104. __field(const char *, name)
  105. __field(int, index)
  106. __field(unsigned long, sync_cpus)
  107. __field(unsigned long, child_cpus)
  108. __field(bool, from_idle)
  109. ),
  110. TP_fast_assign(
  111. __entry->name = name;
  112. __entry->index = index;
  113. __entry->sync_cpus = sync_cpus;
  114. __entry->child_cpus = child_cpus;
  115. __entry->from_idle = from_idle;
  116. ),
  117. TP_printk("cluster_name:%s idx:%d sync:0x%lx child:0x%lx idle:%d",
  118. __entry->name,
  119. __entry->index,
  120. __entry->sync_cpus,
  121. __entry->child_cpus,
  122. __entry->from_idle)
  123. );
  124. TRACE_EVENT(cluster_exit,
  125. TP_PROTO(const char *name, int index, unsigned long sync_cpus,
  126. unsigned long child_cpus, bool from_idle),
  127. TP_ARGS(name, index, sync_cpus, child_cpus, from_idle),
  128. TP_STRUCT__entry(
  129. __field(const char *, name)
  130. __field(int, index)
  131. __field(unsigned long, sync_cpus)
  132. __field(unsigned long, child_cpus)
  133. __field(bool, from_idle)
  134. ),
  135. TP_fast_assign(
  136. __entry->name = name;
  137. __entry->index = index;
  138. __entry->sync_cpus = sync_cpus;
  139. __entry->child_cpus = child_cpus;
  140. __entry->from_idle = from_idle;
  141. ),
  142. TP_printk("cluster_name:%s idx:%d sync:0x%lx child:0x%lx idle:%d",
  143. __entry->name,
  144. __entry->index,
  145. __entry->sync_cpus,
  146. __entry->child_cpus,
  147. __entry->from_idle)
  148. );
  149. TRACE_EVENT(cluster_pred_select,
  150. TP_PROTO(const char *name, int index, u32 sleep_us,
  151. u32 latency, int pred, u32 pred_us),
  152. TP_ARGS(name, index, sleep_us, latency, pred, pred_us),
  153. TP_STRUCT__entry(
  154. __field(const char *, name)
  155. __field(int, index)
  156. __field(u32, sleep_us)
  157. __field(u32, latency)
  158. __field(int, pred)
  159. __field(u32, pred_us)
  160. ),
  161. TP_fast_assign(
  162. __entry->name = name;
  163. __entry->index = index;
  164. __entry->sleep_us = sleep_us;
  165. __entry->latency = latency;
  166. __entry->pred = pred;
  167. __entry->pred_us = pred_us;
  168. ),
  169. TP_printk("name:%s idx:%d sleep_time:%u latency:%u pred:%d pred_us:%u",
  170. __entry->name, __entry->index, __entry->sleep_us,
  171. __entry->latency, __entry->pred, __entry->pred_us)
  172. );
  173. TRACE_EVENT(cluster_pred_hist,
  174. TP_PROTO(const char *name, int idx, u32 resi,
  175. u32 sample, u32 tmr),
  176. TP_ARGS(name, idx, resi, sample, tmr),
  177. TP_STRUCT__entry(
  178. __field(const char *, name)
  179. __field(int, idx)
  180. __field(u32, resi)
  181. __field(u32, sample)
  182. __field(u32, tmr)
  183. ),
  184. TP_fast_assign(
  185. __entry->name = name;
  186. __entry->idx = idx;
  187. __entry->resi = resi;
  188. __entry->sample = sample;
  189. __entry->tmr = tmr;
  190. ),
  191. TP_printk("name:%s idx:%d resi:%u sample:%u tmr:%u",
  192. __entry->name, __entry->idx, __entry->resi,
  193. __entry->sample, __entry->tmr)
  194. );
  195. TRACE_EVENT(pre_pc_cb,
  196. TP_PROTO(int tzflag),
  197. TP_ARGS(tzflag),
  198. TP_STRUCT__entry(
  199. __field(int, tzflag)
  200. ),
  201. TP_fast_assign(
  202. __entry->tzflag = tzflag;
  203. ),
  204. TP_printk("tzflag:%d",
  205. __entry->tzflag
  206. )
  207. );
  208. #endif
  209. #define TRACE_INCLUDE_FILE trace_msm_low_power
  210. #include <trace/define_trace.h>