fsi.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #undef TRACE_SYSTEM
  3. #define TRACE_SYSTEM fsi
  4. #if !defined(_TRACE_FSI_H) || defined(TRACE_HEADER_MULTI_READ)
  5. #define _TRACE_FSI_H
  6. #include <linux/tracepoint.h>
  7. TRACE_EVENT(fsi_master_read,
  8. TP_PROTO(const struct fsi_master *master, int link, int id,
  9. uint32_t addr, size_t size),
  10. TP_ARGS(master, link, id, addr, size),
  11. TP_STRUCT__entry(
  12. __field(int, master_idx)
  13. __field(int, link)
  14. __field(int, id)
  15. __field(__u32, addr)
  16. __field(size_t, size)
  17. ),
  18. TP_fast_assign(
  19. __entry->master_idx = master->idx;
  20. __entry->link = link;
  21. __entry->id = id;
  22. __entry->addr = addr;
  23. __entry->size = size;
  24. ),
  25. TP_printk("fsi%d:%02d:%02d %08x[%zd]",
  26. __entry->master_idx,
  27. __entry->link,
  28. __entry->id,
  29. __entry->addr,
  30. __entry->size
  31. )
  32. );
  33. TRACE_EVENT(fsi_master_write,
  34. TP_PROTO(const struct fsi_master *master, int link, int id,
  35. uint32_t addr, size_t size, const void *data),
  36. TP_ARGS(master, link, id, addr, size, data),
  37. TP_STRUCT__entry(
  38. __field(int, master_idx)
  39. __field(int, link)
  40. __field(int, id)
  41. __field(__u32, addr)
  42. __field(size_t, size)
  43. __field(__u32, data)
  44. ),
  45. TP_fast_assign(
  46. __entry->master_idx = master->idx;
  47. __entry->link = link;
  48. __entry->id = id;
  49. __entry->addr = addr;
  50. __entry->size = size;
  51. __entry->data = 0;
  52. memcpy(&__entry->data, data, size);
  53. ),
  54. TP_printk("fsi%d:%02d:%02d %08x[%zd] <= {%*ph}",
  55. __entry->master_idx,
  56. __entry->link,
  57. __entry->id,
  58. __entry->addr,
  59. __entry->size,
  60. (int)__entry->size, &__entry->data
  61. )
  62. );
  63. TRACE_EVENT(fsi_master_rw_result,
  64. TP_PROTO(const struct fsi_master *master, int link, int id,
  65. uint32_t addr, size_t size,
  66. bool write, const void *data, int ret),
  67. TP_ARGS(master, link, id, addr, size, write, data, ret),
  68. TP_STRUCT__entry(
  69. __field(int, master_idx)
  70. __field(int, link)
  71. __field(int, id)
  72. __field(__u32, addr)
  73. __field(size_t, size)
  74. __field(bool, write)
  75. __field(__u32, data)
  76. __field(int, ret)
  77. ),
  78. TP_fast_assign(
  79. __entry->master_idx = master->idx;
  80. __entry->link = link;
  81. __entry->id = id;
  82. __entry->addr = addr;
  83. __entry->size = size;
  84. __entry->write = write;
  85. __entry->data = 0;
  86. __entry->ret = ret;
  87. if (__entry->write || !__entry->ret)
  88. memcpy(&__entry->data, data, size);
  89. ),
  90. TP_printk("fsi%d:%02d:%02d %08x[%zd] %s {%*ph} ret %d",
  91. __entry->master_idx,
  92. __entry->link,
  93. __entry->id,
  94. __entry->addr,
  95. __entry->size,
  96. __entry->write ? "<=" : "=>",
  97. (int)__entry->size, &__entry->data,
  98. __entry->ret
  99. )
  100. );
  101. TRACE_EVENT(fsi_master_break,
  102. TP_PROTO(const struct fsi_master *master, int link),
  103. TP_ARGS(master, link),
  104. TP_STRUCT__entry(
  105. __field(int, master_idx)
  106. __field(int, link)
  107. ),
  108. TP_fast_assign(
  109. __entry->master_idx = master->idx;
  110. __entry->link = link;
  111. ),
  112. TP_printk("fsi%d:%d",
  113. __entry->master_idx,
  114. __entry->link
  115. )
  116. );
  117. #endif /* _TRACE_FSI_H */
  118. #include <trace/define_trace.h>