提交 5d5b7d4f 编写于 作者: M Mark Brown

regmap: Add tracepoints for cache only and cache bypass

Useful for figuring out where the hardware interaction went or came from.
Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
上级 a3c37741
...@@ -313,6 +313,7 @@ void regcache_cache_only(struct regmap *map, bool enable) ...@@ -313,6 +313,7 @@ void regcache_cache_only(struct regmap *map, bool enable)
mutex_lock(&map->lock); mutex_lock(&map->lock);
WARN_ON(map->cache_bypass && enable); WARN_ON(map->cache_bypass && enable);
map->cache_only = enable; map->cache_only = enable;
trace_regmap_cache_only(map->dev, enable);
mutex_unlock(&map->lock); mutex_unlock(&map->lock);
} }
EXPORT_SYMBOL_GPL(regcache_cache_only); EXPORT_SYMBOL_GPL(regcache_cache_only);
...@@ -350,6 +351,7 @@ void regcache_cache_bypass(struct regmap *map, bool enable) ...@@ -350,6 +351,7 @@ void regcache_cache_bypass(struct regmap *map, bool enable)
mutex_lock(&map->lock); mutex_lock(&map->lock);
WARN_ON(map->cache_only && enable); WARN_ON(map->cache_only && enable);
map->cache_bypass = enable; map->cache_bypass = enable;
trace_regmap_cache_bypass(map->dev, enable);
mutex_unlock(&map->lock); mutex_unlock(&map->lock);
} }
EXPORT_SYMBOL_GPL(regcache_cache_bypass); EXPORT_SYMBOL_GPL(regcache_cache_bypass);
......
...@@ -139,6 +139,42 @@ TRACE_EVENT(regcache_sync, ...@@ -139,6 +139,42 @@ TRACE_EVENT(regcache_sync,
__get_str(type), __get_str(status)) __get_str(type), __get_str(status))
); );
DECLARE_EVENT_CLASS(regmap_bool,
TP_PROTO(struct device *dev, bool flag),
TP_ARGS(dev, flag),
TP_STRUCT__entry(
__string( name, dev_name(dev) )
__field( int, flag )
),
TP_fast_assign(
__assign_str(name, dev_name(dev));
__entry->flag = flag;
),
TP_printk("%s flag=%d", __get_str(name),
(int)__entry->flag)
);
DEFINE_EVENT(regmap_bool, regmap_cache_only,
TP_PROTO(struct device *dev, bool flag),
TP_ARGS(dev, flag)
);
DEFINE_EVENT(regmap_bool, regmap_cache_bypass,
TP_PROTO(struct device *dev, bool flag),
TP_ARGS(dev, flag)
);
#endif /* _TRACE_REGMAP_H */ #endif /* _TRACE_REGMAP_H */
/* This part must be outside protection */ /* This part must be outside protection */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册