Received: from eggs.gnu.org ([2001:4830:134:3::10]:49211) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4TV1-0006oZ-Rs for qemu-devel@nongnu.org; Mon, 15 Jun 2015 08:28:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z4TUz-00064O-5d for qemu-devel@nongnu.org; Mon, 15 Jun 2015 08:28:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40869) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4TUy-00063o-Tv for qemu-devel@nongnu.org; Mon, 15 Jun 2015 08:28:21 -0400 From: Gerd Hoffmann Date: Mon, 15 Jun 2015 14:28:11 +0200 Message-Id: <1434371291-6994-21-git-send-email-kraxel@redhat.com> In-Reply-To: <1434371291-6994-1-git-send-email-kraxel@redhat.com> References: <1434371291-6994-1-git-send-email-kraxel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL 20/20] ossaudio: use trace events instead of debug config flag List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , =?UTF-8?q?K=C5=91v=C3=A1g=C3=B3=2C=20Zolt=C3=A1n?= From: K=C5=91v=C3=A1g=C3=B3, Zolt=C3=A1n Signed-off-by: K=C5=91v=C3=A1g=C3=B3, Zolt=C3=A1n Signed-off-by: Gerd Hoffmann --- audio/ossaudio.c | 25 ++++--------------------- trace-events | 4 ++++ 2 files changed, 8 insertions(+), 21 deletions(-) diff --git a/audio/ossaudio.c b/audio/ossaudio.c index bdc4b76..11e76a1 100644 --- a/audio/ossaudio.c +++ b/audio/ossaudio.c @@ -30,6 +30,7 @@ #include "qemu/main-loop.h" #include "qemu/host-utils.h" #include "audio.h" +#include "trace.h" =20 #define AUDIO_CAP "oss" #include "audio_int.h" @@ -44,7 +45,6 @@ typedef struct OSSConf { int fragsize; const char *devpath_out; const char *devpath_in; - int debug; int exclusive; int policy; } OSSConf; @@ -314,9 +314,7 @@ static int oss_open (int in, struct oss_params *req, int version; =20 if (!oss_get_version (fd, &version, typ)) { - if (conf->debug) { - dolog ("OSS version =3D %#x\n", version); - } + trace_oss_version(version); =20 if (version >=3D 0x040000) { int policy =3D conf->policy; @@ -427,7 +425,6 @@ static int oss_run_out (HWVoiceOut *hw, int live) struct audio_buf_info abinfo; struct count_info cntinfo; int bufsize; - OSSConf *conf =3D oss->conf; =20 bufsize =3D hw->samples << hw->info.shift; =20 @@ -452,19 +449,12 @@ static int oss_run_out (HWVoiceOut *hw, int live) } =20 if (abinfo.bytes > bufsize) { - if (conf->debug) { - dolog ("warning: Invalid available size, size=3D%d bufsi= ze=3D%d\n" - "please report your OS/audio hw to av1474@comtv.r= u\n", - abinfo.bytes, bufsize); - } + trace_oss_invalid_available_size(abinfo.bytes, bufsize); abinfo.bytes =3D bufsize; } =20 if (abinfo.bytes < 0) { - if (conf->debug) { - dolog ("warning: Invalid available size, size=3D%d bufsi= ze=3D%d\n", - abinfo.bytes, bufsize); - } + trace_oss_invalid_available_size(abinfo.bytes, bufsize); return 0; } =20 @@ -852,7 +842,6 @@ static OSSConf glob_conf =3D { .fragsize =3D 4096, .devpath_out =3D "/dev/dsp", .devpath_in =3D "/dev/dsp", - .debug =3D 0, .exclusive =3D 0, .policy =3D 5 }; @@ -919,12 +908,6 @@ static struct audio_option oss_options[] =3D { .descr =3D "Set the timing policy of the device, -1 to use fragm= ent mode", }, #endif - { - .name =3D "DEBUG", - .tag =3D AUD_OPT_BOOL, - .valp =3D &glob_conf.debug, - .descr =3D "Turn on some debugging messages" - }, { /* End of list */ } }; =20 diff --git a/trace-events b/trace-events index 409a64a..52b7efa 100644 --- a/trace-events +++ b/trace-events @@ -1644,3 +1644,7 @@ alsa_xrun_in(void) "Recovering from capture xrun" alsa_resume_out(void) "Resuming suspended output stream" alsa_resume_in(void) "Resuming suspended input stream" alsa_no_frames(int state) "No frames available and ALSA state is %d" + +# audio/ossaudio.c +oss_version(int version) "OSS version =3D %#x" +oss_invalid_available_size(int size, int bufsize) "Invalid available siz= e, size=3D%d bufsize=3D%d" --=20 1.8.3.1