regmap.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. #undef TRACE_SYSTEM
  2. #define TRACE_SYSTEM regmap
  3. #if !defined(_TRACE_REGMAP_H) || defined(TRACE_HEADER_MULTI_READ)
  4. #define _TRACE_REGMAP_H
  5. #include <linux/device.h>
  6. #include <linux/ktime.h>
  7. #include <linux/tracepoint.h>
  8. struct regmap;
  9. /*
  10. * Log register events
  11. */
  12. DECLARE_EVENT_CLASS(regmap_reg,
  13. TP_PROTO(struct device *dev, unsigned int reg,
  14. unsigned int val),
  15. TP_ARGS(dev, reg, val),
  16. TP_STRUCT__entry(
  17. __string( name, dev_name(dev) )
  18. __field( unsigned int, reg )
  19. __field( unsigned int, val )
  20. ),
  21. TP_fast_assign(
  22. __assign_str(name, dev_name(dev));
  23. __entry->reg = reg;
  24. __entry->val = val;
  25. ),
  26. TP_printk("%s reg=%x val=%x", __get_str(name),
  27. (unsigned int)__entry->reg,
  28. (unsigned int)__entry->val)
  29. );
  30. DEFINE_EVENT(regmap_reg, regmap_reg_write,
  31. TP_PROTO(struct device *dev, unsigned int reg,
  32. unsigned int val),
  33. TP_ARGS(dev, reg, val)
  34. );
  35. DEFINE_EVENT(regmap_reg, regmap_reg_read,
  36. TP_PROTO(struct device *dev, unsigned int reg,
  37. unsigned int val),
  38. TP_ARGS(dev, reg, val)
  39. );
  40. DECLARE_EVENT_CLASS(regmap_block,
  41. TP_PROTO(struct device *dev, unsigned int reg, int count),
  42. TP_ARGS(dev, reg, count),
  43. TP_STRUCT__entry(
  44. __string( name, dev_name(dev) )
  45. __field( unsigned int, reg )
  46. __field( int, count )
  47. ),
  48. TP_fast_assign(
  49. __assign_str(name, dev_name(dev));
  50. __entry->reg = reg;
  51. __entry->count = count;
  52. ),
  53. TP_printk("%s reg=%x count=%d", __get_str(name),
  54. (unsigned int)__entry->reg,
  55. (int)__entry->count)
  56. );
  57. DEFINE_EVENT(regmap_block, regmap_hw_read_start,
  58. TP_PROTO(struct device *dev, unsigned int reg, int count),
  59. TP_ARGS(dev, reg, count)
  60. );
  61. DEFINE_EVENT(regmap_block, regmap_hw_read_done,
  62. TP_PROTO(struct device *dev, unsigned int reg, int count),
  63. TP_ARGS(dev, reg, count)
  64. );
  65. DEFINE_EVENT(regmap_block, regmap_hw_write_start,
  66. TP_PROTO(struct device *dev, unsigned int reg, int count),
  67. TP_ARGS(dev, reg, count)
  68. );
  69. DEFINE_EVENT(regmap_block, regmap_hw_write_done,
  70. TP_PROTO(struct device *dev, unsigned int reg, int count),
  71. TP_ARGS(dev, reg, count)
  72. );
  73. TRACE_EVENT(regcache_sync,
  74. TP_PROTO(struct device *dev, const char *type,
  75. const char *status),
  76. TP_ARGS(dev, type, status),
  77. TP_STRUCT__entry(
  78. __string( name, dev_name(dev) )
  79. __string( status, status )
  80. __string( type, type )
  81. __field( int, type )
  82. ),
  83. TP_fast_assign(
  84. __assign_str(name, dev_name(dev));
  85. __assign_str(status, status);
  86. __assign_str(type, type);
  87. ),
  88. TP_printk("%s type=%s status=%s", __get_str(name),
  89. __get_str(type), __get_str(status))
  90. );
  91. #endif /* _TRACE_REGMAP_H */
  92. /* This part must be outside protection */
  93. #include <trace/define_trace.h>