rmnet_trace.h 6.8 KB

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