* [PATCH] regmap: Add tracepoints for cache only and cache bypass
@ 2012-02-23 22:03 Mark Brown
0 siblings, 0 replies; only message in thread
From: Mark Brown @ 2012-02-23 22:03 UTC (permalink / raw
To: linux-kernel; +Cc: patches, Mark Brown
Useful for figuring out where the hardware interaction went or came from.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
drivers/base/regmap/regcache.c | 2 ++
include/trace/events/regmap.h | 36 ++++++++++++++++++++++++++++++++++++
2 files changed, 38 insertions(+), 0 deletions(-)
diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c
index 6cd0398..1124abc 100644
--- a/drivers/base/regmap/regcache.c
+++ b/drivers/base/regmap/regcache.c
@@ -360,6 +360,7 @@ void regcache_cache_only(struct regmap *map, bool enable)
mutex_lock(&map->lock);
WARN_ON(map->cache_bypass && enable);
map->cache_only = enable;
+ trace_regmap_cache_only(map->dev, enable);
mutex_unlock(&map->lock);
}
EXPORT_SYMBOL_GPL(regcache_cache_only);
@@ -397,6 +398,7 @@ void regcache_cache_bypass(struct regmap *map, bool enable)
mutex_lock(&map->lock);
WARN_ON(map->cache_only && enable);
map->cache_bypass = enable;
+ trace_regmap_cache_bypass(map->dev, enable);
mutex_unlock(&map->lock);
}
EXPORT_SYMBOL_GPL(regcache_cache_bypass);
diff --git a/include/trace/events/regmap.h b/include/trace/events/regmap.h
index 12fbf43..d697382 100644
--- a/include/trace/events/regmap.h
+++ b/include/trace/events/regmap.h
@@ -139,6 +139,42 @@ TRACE_EVENT(regcache_sync,
__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 */
/* This part must be outside protection */
--
1.7.9.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2012-02-23 22:03 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-23 22:03 [PATCH] regmap: Add tracepoints for cache only and cache bypass Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).