siox.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #undef TRACE_SYSTEM
  2. #define TRACE_SYSTEM siox
  3. #if !defined(_TRACE_SIOX_H) || defined(TRACE_HEADER_MULTI_READ)
  4. #define _TRACE_SIOX_H
  5. #include <linux/tracepoint.h>
  6. TRACE_EVENT(siox_set_data,
  7. TP_PROTO(const struct siox_master *smaster,
  8. const struct siox_device *sdevice,
  9. unsigned int devno, size_t bufoffset),
  10. TP_ARGS(smaster, sdevice, devno, bufoffset),
  11. TP_STRUCT__entry(
  12. __field(int, busno)
  13. __field(unsigned int, devno)
  14. __field(size_t, inbytes)
  15. __dynamic_array(u8, buf, sdevice->inbytes)
  16. ),
  17. TP_fast_assign(
  18. __entry->busno = smaster->busno;
  19. __entry->devno = devno;
  20. __entry->inbytes = sdevice->inbytes;
  21. memcpy(__get_dynamic_array(buf),
  22. smaster->buf + bufoffset, sdevice->inbytes);
  23. ),
  24. TP_printk("siox-%d-%u [%*phD]",
  25. __entry->busno,
  26. __entry->devno,
  27. (int)__entry->inbytes, __get_dynamic_array(buf)
  28. )
  29. );
  30. TRACE_EVENT(siox_get_data,
  31. TP_PROTO(const struct siox_master *smaster,
  32. const struct siox_device *sdevice,
  33. unsigned int devno, u8 status_clean,
  34. size_t bufoffset),
  35. TP_ARGS(smaster, sdevice, devno, status_clean, bufoffset),
  36. TP_STRUCT__entry(
  37. __field(int, busno)
  38. __field(unsigned int, devno)
  39. __field(u8, status_clean)
  40. __field(size_t, outbytes)
  41. __dynamic_array(u8, buf, sdevice->outbytes)
  42. ),
  43. TP_fast_assign(
  44. __entry->busno = smaster->busno;
  45. __entry->devno = devno;
  46. __entry->status_clean = status_clean;
  47. __entry->outbytes = sdevice->outbytes;
  48. memcpy(__get_dynamic_array(buf),
  49. smaster->buf + bufoffset, sdevice->outbytes);
  50. ),
  51. TP_printk("siox-%d-%u (%02hhx) [%*phD]",
  52. __entry->busno,
  53. __entry->devno,
  54. __entry->status_clean,
  55. (int)__entry->outbytes, __get_dynamic_array(buf)
  56. )
  57. );
  58. #endif /* if !defined(_TRACE_SIOX_H) || defined(TRACE_HEADER_MULTI_READ) */
  59. /* This part must be outside protection */
  60. #include <trace/define_trace.h>