regmap.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  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/ktime.h>
  6. #include <linux/tracepoint.h>
  7. struct device;
  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. DEFINE_EVENT(regmap_reg, regmap_reg_read_cache,
  41. TP_PROTO(struct device *dev, unsigned int reg,
  42. unsigned int val),
  43. TP_ARGS(dev, reg, val)
  44. );
  45. DECLARE_EVENT_CLASS(regmap_block,
  46. TP_PROTO(struct device *dev, unsigned int reg, int count),
  47. TP_ARGS(dev, reg, count),
  48. TP_STRUCT__entry(
  49. __string( name, dev_name(dev) )
  50. __field( unsigned int, reg )
  51. __field( int, count )
  52. ),
  53. TP_fast_assign(
  54. __assign_str(name, dev_name(dev));
  55. __entry->reg = reg;
  56. __entry->count = count;
  57. ),
  58. TP_printk("%s reg=%x count=%d", __get_str(name),
  59. (unsigned int)__entry->reg,
  60. (int)__entry->count)
  61. );
  62. DEFINE_EVENT(regmap_block, regmap_hw_read_start,
  63. TP_PROTO(struct device *dev, unsigned int reg, int count),
  64. TP_ARGS(dev, reg, count)
  65. );
  66. DEFINE_EVENT(regmap_block, regmap_hw_read_done,
  67. TP_PROTO(struct device *dev, unsigned int reg, int count),
  68. TP_ARGS(dev, reg, count)
  69. );
  70. DEFINE_EVENT(regmap_block, regmap_hw_write_start,
  71. TP_PROTO(struct device *dev, unsigned int reg, int count),
  72. TP_ARGS(dev, reg, count)
  73. );
  74. DEFINE_EVENT(regmap_block, regmap_hw_write_done,
  75. TP_PROTO(struct device *dev, unsigned int reg, int count),
  76. TP_ARGS(dev, reg, count)
  77. );
  78. TRACE_EVENT(regcache_sync,
  79. TP_PROTO(struct device *dev, const char *type,
  80. const char *status),
  81. TP_ARGS(dev, type, status),
  82. TP_STRUCT__entry(
  83. __string( name, dev_name(dev) )
  84. __string( status, status )
  85. __string( type, type )
  86. __field( int, type )
  87. ),
  88. TP_fast_assign(
  89. __assign_str(name, dev_name(dev));
  90. __assign_str(status, status);
  91. __assign_str(type, type);
  92. ),
  93. TP_printk("%s type=%s status=%s", __get_str(name),
  94. __get_str(type), __get_str(status))
  95. );
  96. DECLARE_EVENT_CLASS(regmap_bool,
  97. TP_PROTO(struct device *dev, bool flag),
  98. TP_ARGS(dev, flag),
  99. TP_STRUCT__entry(
  100. __string( name, dev_name(dev) )
  101. __field( int, flag )
  102. ),
  103. TP_fast_assign(
  104. __assign_str(name, dev_name(dev));
  105. __entry->flag = flag;
  106. ),
  107. TP_printk("%s flag=%d", __get_str(name),
  108. (int)__entry->flag)
  109. );
  110. DEFINE_EVENT(regmap_bool, regmap_cache_only,
  111. TP_PROTO(struct device *dev, bool flag),
  112. TP_ARGS(dev, flag)
  113. );
  114. DEFINE_EVENT(regmap_bool, regmap_cache_bypass,
  115. TP_PROTO(struct device *dev, bool flag),
  116. TP_ARGS(dev, flag)
  117. );
  118. #endif /* _TRACE_REGMAP_H */
  119. /* This part must be outside protection */
  120. #include <trace/define_trace.h>