Commit c358e640 authored by Dimitris Papastamos's avatar Dimitris Papastamos Committed by Mark Brown

ASoC: soc-cache: Add trace event for snd_soc_cache_sync()

This patch makes it easy to see when the syncing process begins and
ends.  You can also enable the snd_soc_reg_write tracepoint to see
which registers are being synced.
Signed-off-by: default avatarDimitris Papastamos <dp@opensource.wolfsonmicro.com>
Acked-by: default avatarLiam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 67b22517
...@@ -229,6 +229,31 @@ TRACE_EVENT(snd_soc_jack_notify, ...@@ -229,6 +229,31 @@ TRACE_EVENT(snd_soc_jack_notify,
TP_printk("jack=%s %x", __get_str(name), (int)__entry->val) TP_printk("jack=%s %x", __get_str(name), (int)__entry->val)
); );
TRACE_EVENT(snd_soc_cache_sync,
TP_PROTO(struct snd_soc_codec *codec, const char *type,
const char *status),
TP_ARGS(codec, type, status),
TP_STRUCT__entry(
__string( name, codec->name )
__string( status, status )
__string( type, type )
__field( int, id )
),
TP_fast_assign(
__assign_str(name, codec->name);
__assign_str(status, status);
__assign_str(type, type);
__entry->id = codec->id;
),
TP_printk("codec=%s.%d type=%s status=%s", __get_str(name),
(int)__entry->id, __get_str(type), __get_str(status))
);
#endif /* _TRACE_ASOC_H */ #endif /* _TRACE_ASOC_H */
/* This part must be outside protection */ /* This part must be outside protection */
......
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
#include <linux/bitmap.h> #include <linux/bitmap.h>
#include <linux/rbtree.h> #include <linux/rbtree.h>
#include <trace/events/asoc.h>
static unsigned int snd_soc_4_12_read(struct snd_soc_codec *codec, static unsigned int snd_soc_4_12_read(struct snd_soc_codec *codec,
unsigned int reg) unsigned int reg)
{ {
...@@ -1601,18 +1603,26 @@ EXPORT_SYMBOL_GPL(snd_soc_cache_write); ...@@ -1601,18 +1603,26 @@ EXPORT_SYMBOL_GPL(snd_soc_cache_write);
int snd_soc_cache_sync(struct snd_soc_codec *codec) int snd_soc_cache_sync(struct snd_soc_codec *codec)
{ {
int ret; int ret;
const char *name;
if (!codec->cache_sync) { if (!codec->cache_sync) {
return 0; return 0;
} }
if (codec->cache_ops->name)
name = codec->cache_ops->name;
else
name = "unknown";
if (codec->cache_ops && codec->cache_ops->sync) { if (codec->cache_ops && codec->cache_ops->sync) {
if (codec->cache_ops->name) if (codec->cache_ops->name)
dev_dbg(codec->dev, "Syncing %s cache for %s codec\n", dev_dbg(codec->dev, "Syncing %s cache for %s codec\n",
codec->cache_ops->name, codec->name); codec->cache_ops->name, codec->name);
trace_snd_soc_cache_sync(codec, name, "start");
ret = codec->cache_ops->sync(codec); ret = codec->cache_ops->sync(codec);
if (!ret) if (!ret)
codec->cache_sync = 0; codec->cache_sync = 0;
trace_snd_soc_cache_sync(codec, name, "end");
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment