rmnet_trace.h 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /* Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
  3. */
  4. #ifdef CONFIG_FTRACE
  5. #undef TRACE_SYSTEM
  6. #define TRACE_SYSTEM rmnet
  7. #undef TRACE_INCLUDE_PATH
  8. #ifdef RMNET_LA_PLATFORM
  9. #define TRACE_INCLUDE_PATH ../../../../vendor/qcom/opensource/datarmnet/core
  10. #elif RMNET_TRACE_INCLUDE_LE
  11. #define TRACE_INCLUDE_PATH ../../../../../../../datarmnet/core
  12. #else
  13. #define TRACE_INCLUDE_PATH ../../../../../../../src/datarmnet/core
  14. #endif
  15. #define TRACE_INCLUDE_FILE rmnet_trace
  16. #if !defined(_TRACE_RMNET_H) || defined(TRACE_HEADER_MULTI_READ)
  17. #define _TRACE_RMNET_H
  18. #include <linux/skbuff.h>
  19. #include <linux/tracepoint.h>
  20. /*****************************************************************************/
  21. /* Trace events for rmnet module */
  22. /*****************************************************************************/
  23. TRACE_EVENT(rmnet_xmit_skb,
  24. TP_PROTO(struct sk_buff *skb),
  25. TP_ARGS(skb),
  26. TP_STRUCT__entry(
  27. __string(dev_name, skb->dev->name)
  28. __field(unsigned int, len)
  29. ),
  30. TP_fast_assign(
  31. __assign_str(dev_name, skb->dev->name);
  32. __entry->len = skb->len;
  33. ),
  34. TP_printk("dev_name=%s len=%u", __get_str(dev_name), __entry->len)
  35. );
  36. DECLARE_EVENT_CLASS
  37. (rmnet_mod_template,
  38. TP_PROTO(u8 func, u8 evt, u32 uint1, u32 uint2,
  39. u64 ulong1, u64 ulong2, void *ptr1, void *ptr2),
  40. TP_ARGS(func, evt, uint1, uint2, ulong1, ulong2, ptr1, ptr2),
  41. TP_STRUCT__entry(__field(u8, func)
  42. __field(u8, evt)
  43. __field(u32, uint1)
  44. __field(u32, uint2)
  45. __field(u64, ulong1)
  46. __field(u64, ulong2)
  47. __field(void *, ptr1)
  48. __field(void *, ptr2)
  49. ),
  50. TP_fast_assign(__entry->func = func;
  51. __entry->evt = evt;
  52. __entry->uint1 = uint1;
  53. __entry->uint2 = uint2;
  54. __entry->ulong1 = ulong1;
  55. __entry->ulong2 = ulong2;
  56. __entry->ptr1 = ptr1;
  57. __entry->ptr2 = ptr2;
  58. ),
  59. TP_printk("fun:%u ev:%u u1:%u u2:%u ul1:%llu ul2:%llu p1:0x%pK p2:0x%pK",
  60. __entry->func, __entry->evt,
  61. __entry->uint1, __entry->uint2,
  62. __entry->ulong1, __entry->ulong2,
  63. __entry->ptr1, __entry->ptr2)
  64. )
  65. DEFINE_EVENT
  66. (rmnet_mod_template, rmnet_low,
  67. TP_PROTO(u8 func, u8 evt, u32 uint1, u32 uint2,
  68. u64 ulong1, u64 ulong2, void *ptr1, void *ptr2),
  69. TP_ARGS(func, evt, uint1, uint2, ulong1, ulong2, ptr1, ptr2)
  70. );
  71. DEFINE_EVENT
  72. (rmnet_mod_template, rmnet_high,
  73. TP_PROTO(u8 func, u8 evt, u32 uint1, u32 uint2,
  74. u64 ulong1, u64 ulong2, void *ptr1, void *ptr2),
  75. TP_ARGS(func, evt, uint1, uint2, ulong1, ulong2, ptr1, ptr2)
  76. );
  77. DEFINE_EVENT
  78. (rmnet_mod_template, rmnet_err,
  79. TP_PROTO(u8 func, u8 evt, u32 uint1, u32 uint2,
  80. u64 ulong1, u64 ulong2, void *ptr1, void *ptr2),
  81. TP_ARGS(func, evt, uint1, uint2, ulong1, ulong2, ptr1, ptr2)
  82. );
  83. TRACE_EVENT(print_skb_gso,
  84. TP_PROTO(struct sk_buff *skb, __be16 src, __be16 dest),
  85. TP_ARGS(skb, src, dest),
  86. TP_STRUCT__entry(
  87. __field(void *, skbaddr)
  88. __field(int, len)
  89. __field(int, data_len)
  90. __field(__be16, src)
  91. __field(__be16, dest)
  92. ),
  93. TP_fast_assign(
  94. __entry->skbaddr = skb;
  95. __entry->len = skb->len;
  96. __entry->data_len = skb->data_len;
  97. __entry->src = src;
  98. __entry->dest = dest;
  99. ),
  100. TP_printk("GSO: skbaddr=%pK, len=%d, data_len=%d, src=%u, dest=%u",
  101. __entry->skbaddr, __entry->len, __entry->data_len,
  102. be16_to_cpu(__entry->src), be16_to_cpu(__entry->dest))
  103. );
  104. /*****************************************************************************/
  105. /* Trace events for rmnet_perf module */
  106. /*****************************************************************************/
  107. DEFINE_EVENT
  108. (rmnet_mod_template, rmnet_perf_low,
  109. TP_PROTO(u8 func, u8 evt, u32 uint1, u32 uint2,
  110. u64 ulong1, u64 ulong2, void *ptr1, void *ptr2),
  111. TP_ARGS(func, evt, uint1, uint2, ulong1, ulong2, ptr1, ptr2)
  112. );
  113. DEFINE_EVENT
  114. (rmnet_mod_template, rmnet_perf_high,
  115. TP_PROTO(u8 func, u8 evt, u32 uint1, u32 uint2,
  116. u64 ulong1, u64 ulong2, void *ptr1, void *ptr2),
  117. TP_ARGS(func, evt, uint1, uint2, ulong1, ulong2, ptr1, ptr2)
  118. );
  119. DEFINE_EVENT
  120. (rmnet_mod_template, rmnet_perf_err,
  121. TP_PROTO(u8 func, u8 evt, u32 uint1, u32 uint2,
  122. u64 ulong1, u64 ulong2, void *ptr1, void *ptr2),
  123. TP_ARGS(func, evt, uint1, uint2, ulong1, ulong2, ptr1, ptr2)
  124. );
  125. /*****************************************************************************/
  126. /* Trace events for rmnet_shs module */
  127. /*****************************************************************************/
  128. DEFINE_EVENT
  129. (rmnet_mod_template, rmnet_shs_low,
  130. TP_PROTO(u8 func, u8 evt, u32 uint1, u32 uint2,
  131. u64 ulong1, u64 ulong2, void *ptr1, void *ptr2),
  132. TP_ARGS(func, evt, uint1, uint2, ulong1, ulong2, ptr1, ptr2)
  133. );
  134. DEFINE_EVENT
  135. (rmnet_mod_template, rmnet_shs_high,
  136. TP_PROTO(u8 func, u8 evt, u32 uint1, u32 uint2,
  137. u64 ulong1, u64 ulong2, void *ptr1, void *ptr2),
  138. TP_ARGS(func, evt, uint1, uint2, ulong1, ulong2, ptr1, ptr2)
  139. );
  140. DEFINE_EVENT
  141. (rmnet_mod_template, rmnet_shs_err,
  142. TP_PROTO(u8 func, u8 evt, u32 uint1, u32 uint2,
  143. u64 ulong1, u64 ulong2, void *ptr1, void *ptr2),
  144. TP_ARGS(func, evt, uint1, uint2, ulong1, ulong2, ptr1, ptr2)
  145. );
  146. DEFINE_EVENT
  147. (rmnet_mod_template, rmnet_shs_wq_low,
  148. TP_PROTO(u8 func, u8 evt, u32 uint1, u32 uint2,
  149. u64 ulong1, u64 ulong2, void *ptr1, void *ptr2),
  150. TP_ARGS(func, evt, uint1, uint2, ulong1, ulong2, ptr1, ptr2)
  151. );
  152. DEFINE_EVENT
  153. (rmnet_mod_template, rmnet_shs_wq_high,
  154. TP_PROTO(u8 func, u8 evt, u32 uint1, u32 uint2,
  155. u64 ulong1, u64 ulong2, void *ptr1, void *ptr2),
  156. TP_ARGS(func, evt, uint1, uint2, ulong1, ulong2, ptr1, ptr2)
  157. );
  158. DEFINE_EVENT
  159. (rmnet_mod_template, rmnet_shs_wq_err,
  160. TP_PROTO(u8 func, u8 evt, u32 uint1, u32 uint2,
  161. u64 ulong1, u64 ulong2, void *ptr1, void *ptr2),
  162. TP_ARGS(func, evt, uint1, uint2, ulong1, ulong2, ptr1, ptr2)
  163. );
  164. DECLARE_EVENT_CLASS
  165. (rmnet_freq_template,
  166. TP_PROTO(u8 core, u32 newfreq),
  167. TP_ARGS(core, newfreq),
  168. TP_STRUCT__entry(__field(u8, core)
  169. __field(u32, newfreq)
  170. ),
  171. TP_fast_assign(__entry->core = core;
  172. __entry->newfreq = newfreq;
  173. ),
  174. TP_printk("freq policy core:%u freq floor :%u",
  175. __entry->core, __entry->newfreq)
  176. );
  177. DEFINE_EVENT
  178. (rmnet_freq_template, rmnet_freq_boost,
  179. TP_PROTO(u8 core, u32 newfreq),
  180. TP_ARGS(core, newfreq)
  181. );
  182. DEFINE_EVENT
  183. (rmnet_freq_template, rmnet_freq_reset,
  184. TP_PROTO(u8 core, u32 newfreq),
  185. TP_ARGS(core, newfreq)
  186. );
  187. TRACE_EVENT
  188. (rmnet_freq_update,
  189. TP_PROTO(u8 core, u32 lowfreq, u32 highfreq),
  190. TP_ARGS(core, lowfreq, highfreq),
  191. TP_STRUCT__entry(__field(u8, core)
  192. __field(u32, lowfreq)
  193. __field(u32, highfreq)
  194. ),
  195. TP_fast_assign(__entry->core = core;
  196. __entry->lowfreq = lowfreq;
  197. __entry->highfreq = highfreq;
  198. ),
  199. TP_printk("freq policy update core:%u policy freq floor :%u freq ceil :%u",
  200. __entry->core, __entry->lowfreq, __entry->highfreq)
  201. );
  202. #endif /* _TRACE_RMNET_H */
  203. #include <trace/define_trace.h>
  204. #endif