regmap.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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. #endif /* _TRACE_REGMAP_H */
  74. /* This part must be outside protection */
  75. #include <trace/define_trace.h>