Update of /cvsroot/alsa/alsa-kernel/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31852/core
Modified Files: pcm.c pcm_lib.c Log Message: - added the support of stack dump at xrun. enabled by writing to /proc/asound/card*/pcm*/xrun_debug proc file. built only when CONFIG_SND_DEBUG is set. Index: pcm.c =================================================================== RCS file: /cvsroot/alsa/alsa-kernel/core/pcm.c,v retrieving revision 1.37 retrieving revision 1.38 diff -u -r1.37 -r1.38 --- pcm.c 20 Jan 2004 13:11:33 -0000 1.37 +++ pcm.c 26 Jan 2004 14:04:35 -0000 1.38 @@ -390,6 +390,22 @@ snd_iprintf(buffer, "appl_ptr : %ld\n", runtime->control->appl_ptr); } +#ifdef CONFIG_SND_DEBUG +static void snd_pcm_xrun_debug_read(snd_info_entry_t *entry, snd_info_buffer_t *buffer) +{ + snd_pcm_str_t *pstr = (snd_pcm_str_t *)entry->private_data; + snd_iprintf(buffer, "%d\n", pstr->xrun_debug); +} + +static void snd_pcm_xrun_debug_write(snd_info_entry_t *entry, snd_info_buffer_t *buffer) +{ + snd_pcm_str_t *pstr = (snd_pcm_str_t *)entry->private_data; + char line[64]; + if (!snd_info_get_line(buffer, line, sizeof(line))) + pstr->xrun_debug = !!simple_strtoul(line, NULL, 10); +} +#endif + static int snd_pcm_stream_proc_init(snd_pcm_str_t *pstr) { snd_pcm_t *pcm = pstr->pcm; @@ -416,11 +432,31 @@ } pstr->proc_info_entry = entry; +#ifdef CONFIG_SND_DEBUG + if ((entry = snd_info_create_card_entry(pcm->card, "xrun_debug", pstr->proc_root)) != NULL) { + entry->c.text.read_size = 64; + entry->c.text.read = snd_pcm_xrun_debug_read; + entry->c.text.write_size = 64; + entry->c.text.write = snd_pcm_xrun_debug_write; + entry->private_data = pstr; + if (snd_info_register(entry) < 0) { + snd_info_free_entry(entry); + entry = NULL; + } + } + pstr->proc_xrun_debug_entry = entry; +#endif return 0; } static int snd_pcm_stream_proc_done(snd_pcm_str_t *pstr) { +#ifdef CONFIG_SND_DEBUG + if (pstr->proc_xrun_debug_entry) { + snd_info_unregister(pstr->proc_xrun_debug_entry); + pstr->proc_xrun_debug_entry = NULL; + } +#endif if (pstr->proc_info_entry) { snd_info_unregister(pstr->proc_info_entry); pstr->proc_info_entry = NULL; Index: pcm_lib.c =================================================================== RCS file: /cvsroot/alsa/alsa-kernel/core/pcm_lib.c,v retrieving revision 1.46 retrieving revision 1.47 diff -u -r1.46 -r1.47 --- pcm_lib.c 22 Oct 2003 09:32:20 -0000 1.46 +++ pcm_lib.c 26 Jan 2004 14:04:35 -0000 1.47 @@ -158,6 +158,15 @@ snd_pcm_stop(substream, runtime->status->state == SNDRV_PCM_STATE_DRAINING ? SNDRV_PCM_STATE_SETUP : SNDRV_PCM_STATE_XRUN); +#ifdef CONFIG_SND_DEBUG + if (substream->pstr->xrun_debug) { + snd_printd(KERN_DEBUG "XRUN: pcmC%dD%d%c\n", + substream->pcm->card->number, + substream->pcm->device, + substream->stream ? 'c' : 'p'); + dump_stack(); + } +#endif return -EPIPE; } if (avail >= runtime->control->avail_min) ------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _______________________________________________ Alsa-cvslog mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/alsa-cvslog