Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bc7ee556 authored by Mark Brown's avatar Mark Brown
Browse files

regmap: Add trace event for successful cache reads



Currently we only trace physical reads, there's no instrumentation if
the read is satisfied from cache.

Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 018690d3
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -193,13 +193,21 @@ void regcache_exit(struct regmap *map)
int regcache_read(struct regmap *map,
		  unsigned int reg, unsigned int *value)
{
	int ret;

	if (map->cache_type == REGCACHE_NONE)
		return -ENOSYS;

	BUG_ON(!map->cache_ops);

	if (!regmap_volatile(map, reg))
		return map->cache_ops->read(map, reg, value);
	if (!regmap_volatile(map, reg)) {
		ret = map->cache_ops->read(map, reg, value);

		if (ret == 0)
			trace_regmap_reg_read_cache(map->dev, reg, *value);

		return ret;
	}

	return -EINVAL;
}
+9 −0
Original line number Diff line number Diff line
@@ -55,6 +55,15 @@ DEFINE_EVENT(regmap_reg, regmap_reg_read,

);

DEFINE_EVENT(regmap_reg, regmap_reg_read_cache,

	TP_PROTO(struct device *dev, unsigned int reg,
		 unsigned int val),

	TP_ARGS(dev, reg, val)

);

DECLARE_EVENT_CLASS(regmap_block,

	TP_PROTO(struct device *dev, unsigned int reg, int count),