]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ALSA: pcm: Use snd_printd_ratelimit()
authorTim Gardner <tim.gardner@canonical.com>
Fri, 16 Aug 2013 17:19:00 +0000 (11:19 -0600)
committerTakashi Iwai <tiwai@suse.de>
Mon, 19 Aug 2013 13:48:48 +0000 (15:48 +0200)
The use of snd_printd_ratelimit() supresses superfluous output from
printk_ratelimit() when CONFIG_SND_DEBUG is not defined. For example,

[   43.753692] snd_pcm_update_hw_ptr0: 26 callbacks suppressed
[   48.822131] snd_pcm_update_hw_ptr0: 25 callbacks suppressed
[   53.894953] snd_pcm_update_hw_ptr0: 25 callbacks suppressed
[   58.997761] snd_pcm_update_hw_ptr0: 25 callbacks suppressed
[   64.100952] snd_pcm_update_hw_ptr0: 25 callbacks suppressed

fills the log even when no debug output is actually produced.

Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.de>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Yacine Belkadi <yacine.belkadi.1@gmail.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/pcm_lib.c

index 82bb029d4414155e60ae2a01ddd4707d926b83ae..6e03b465e44e3a05f82e93a2d25a61f030cc3cf6 100644 (file)
@@ -184,7 +184,7 @@ static void xrun(struct snd_pcm_substream *substream)
        do {                                                            \
                if (xrun_debug(substream, XRUN_DEBUG_BASIC)) {          \
                        xrun_log_show(substream);                       \
-                       if (printk_ratelimit()) {                       \
+                       if (snd_printd_ratelimit()) {                   \
                                snd_printd("PCM: " fmt, ##args);        \
                        }                                               \
                        dump_stack_on_xrun(substream);                  \
@@ -342,7 +342,7 @@ static int snd_pcm_update_hw_ptr0(struct snd_pcm_substream *substream,
                return -EPIPE;
        }
        if (pos >= runtime->buffer_size) {
-               if (printk_ratelimit()) {
+               if (snd_printd_ratelimit()) {
                        char name[16];
                        snd_pcm_debug_name(substream, name, sizeof(name));
                        xrun_log_show(substream);