aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2013-02-21 14:05:48 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-03-03 21:28:29 -0500
commitfe7d4ccd1d7748bc9919c1bdee1e8286776f75ff (patch)
tree0d55a8de27712c409441c9b20844163c295ad07b /drivers/base
parent6dbe51c251a327e012439c4772097a13df43c5b8 (diff)
regmap: async: Add tracepoints for async I/O
Trace when we start and complete async writes, and when we start and finish blocking for their completion. This is useful for performance analysis of the resulting I/O patterns. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/regmap/regmap.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
index 3d2367501fd0..7c6d3be137ba 100644
--- a/drivers/base/regmap/regmap.c
+++ b/drivers/base/regmap/regmap.c
@@ -999,6 +999,8 @@ static int _regmap_raw_write(struct regmap *map, unsigned int reg,
999 if (!async) 999 if (!async)
1000 return -ENOMEM; 1000 return -ENOMEM;
1001 1001
1002 trace_regmap_async_write_start(map->dev, reg, val_len);
1003
1002 async->work_buf = kzalloc(map->format.buf_size, 1004 async->work_buf = kzalloc(map->format.buf_size,
1003 GFP_KERNEL | GFP_DMA); 1005 GFP_KERNEL | GFP_DMA);
1004 if (!async->work_buf) { 1006 if (!async->work_buf) {
@@ -1640,6 +1642,8 @@ void regmap_async_complete_cb(struct regmap_async *async, int ret)
1640 struct regmap *map = async->map; 1642 struct regmap *map = async->map;
1641 bool wake; 1643 bool wake;
1642 1644
1645 trace_regmap_async_io_complete(map->dev);
1646
1643 spin_lock(&map->async_lock); 1647 spin_lock(&map->async_lock);
1644 1648
1645 list_del(&async->list); 1649 list_del(&async->list);
@@ -1686,6 +1690,8 @@ int regmap_async_complete(struct regmap *map)
1686 if (!map->bus->async_write) 1690 if (!map->bus->async_write)
1687 return 0; 1691 return 0;
1688 1692
1693 trace_regmap_async_complete_start(map->dev);
1694
1689 wait_event(map->async_waitq, regmap_async_is_done(map)); 1695 wait_event(map->async_waitq, regmap_async_is_done(map));
1690 1696
1691 spin_lock_irqsave(&map->async_lock, flags); 1697 spin_lock_irqsave(&map->async_lock, flags);
@@ -1693,6 +1699,8 @@ int regmap_async_complete(struct regmap *map)
1693 map->async_ret = 0; 1699 map->async_ret = 0;
1694 spin_unlock_irqrestore(&map->async_lock, flags); 1700 spin_unlock_irqrestore(&map->async_lock, flags);
1695 1701
1702 trace_regmap_async_complete_done(map->dev);
1703
1696 return ret; 1704 return ret;
1697} 1705}
1698EXPORT_SYMBOL_GPL(regmap_async_complete); 1706EXPORT_SYMBOL_GPL(regmap_async_complete);