From patchwork Fri Jun 12 12:33:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?UTF-8?B?Wm9sdMOhbiBLxZF2w6Fnw7M=?= X-Patchwork-Id: 483544 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 86E4D1402B4 for ; Fri, 12 Jun 2015 22:38:36 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=azl0cWl5; dkim-atps=neutral Received: from localhost ([::1]:51076 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z3OEE-0006nf-HT for incoming@patchwork.ozlabs.org; Fri, 12 Jun 2015 08:38:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40386) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z3O97-0007KZ-6F for qemu-devel@nongnu.org; Fri, 12 Jun 2015 08:33:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z3O96-0004FP-3M for qemu-devel@nongnu.org; Fri, 12 Jun 2015 08:33:17 -0400 Received: from mail-wg0-x234.google.com ([2a00:1450:400c:c00::234]:34359) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z3O95-0004FC-TZ for qemu-devel@nongnu.org; Fri, 12 Jun 2015 08:33:16 -0400 Received: by wgv5 with SMTP id 5so23870060wgv.1 for ; Fri, 12 Jun 2015 05:33:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=5YkOBwO9SiCk0uCHjdVYzTc3Kl6GLaYSIsdOUDvK320=; b=azl0cWl53U748RkXHzVLyDdwrCNM11CZLiNnytydzyRxMx2Pfv3spK6/jaFTkoRDAp KzYFj/Zh51aZFii/I4GrlO+TXSecbS2IYmLnSH+eO70AzGz/jCR4hYmZWPE5Xl4H1bZd dX5leFjXva40SbecoSjwWii0Ps/CHGvPSqimUY/rNynXyMwJFu03f3H3XAIp6rfNGEGU rA4L2dTq9pNu7fOCdtuWuJ1WFsPKbly0/AnTAmVbSeGp7Swdzk9Iz1iKppnF3lhubEXa RmgRmiFmWgcdK9h448j9qxtjtnfE7fyQDk6n6jnNvi61F8cSjgc+FLONoHr07JXvpTW9 t0/g== X-Received: by 10.180.88.72 with SMTP id be8mr6644666wib.42.1434112395323; Fri, 12 Jun 2015 05:33:15 -0700 (PDT) Received: from nullptr.home.dirty-ice.org (94-21-76-230.pool.digikabel.hu. [94.21.76.230]) by mx.google.com with ESMTPSA id m2sm2569153wiy.7.2015.06.12.05.33.14 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 12 Jun 2015 05:33:14 -0700 (PDT) From: "=?UTF-8?q?K=C5=91v=C3=A1g=C3=B3=2C=20Zolt=C3=A1n?=" X-Google-Original-From: =?UTF-8?q?K=C5=91v=C3=A1g=C3=B3=2C=20Zolt=C3=A1n?= To: qemu-devel@nongnu.org Date: Fri, 12 Jun 2015 14:33:07 +0200 Message-Id: <2d3b08c498400412413b1e9a7f8d571c2afe2971.1434111578.git.DirtY.iCE.hu@gmail.com> X-Mailer: git-send-email 2.4.2 In-Reply-To: References: MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c00::234 Cc: Gerd Hoffmann Subject: [Qemu-devel] [PATCH 06/12] ossaudio: use trace events instead of debug config flag X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Kővágó, Zoltán --- 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 d247969..d5362ab 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" #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; if (!oss_get_version (fd, &version, typ)) { - if (conf->debug) { - dolog ("OSS version = %#x\n", version); - } + trace_oss_version(version); if (version >= 0x040000) { int policy = 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 = oss->conf; bufsize = hw->samples << hw->info.shift; @@ -452,19 +449,12 @@ static int oss_run_out (HWVoiceOut *hw, int live) } if (abinfo.bytes > bufsize) { - if (conf->debug) { - dolog ("warning: Invalid available size, size=%d bufsize=%d\n" - "please report your OS/audio hw to av1474@comtv.ru\n", - abinfo.bytes, bufsize); - } + trace_oss_invalid_available_size(abinfo.bytes, bufsize); abinfo.bytes = bufsize; } if (abinfo.bytes < 0) { - if (conf->debug) { - dolog ("warning: Invalid available size, size=%d bufsize=%d\n", - abinfo.bytes, bufsize); - } + trace_oss_invalid_available_size(abinfo.bytes, bufsize); return 0; } @@ -850,7 +840,6 @@ static OSSConf glob_conf = { .fragsize = 4096, .devpath_out = "/dev/dsp", .devpath_in = "/dev/dsp", - .debug = 0, .exclusive = 0, .policy = 5 }; @@ -917,12 +906,6 @@ static struct audio_option oss_options[] = { .descr = "Set the timing policy of the device, -1 to use fragment mode", }, #endif - { - .name = "DEBUG", - .tag = AUD_OPT_BOOL, - .valp = &glob_conf.debug, - .descr = "Turn on some debugging messages" - }, { /* End of list */ } }; diff --git a/trace-events b/trace-events index 0f372bb..2be8e09 100644 --- a/trace-events +++ b/trace-events @@ -1638,3 +1638,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 = %#x" +oss_invalid_available_size(int size, int bufsize) "Invalid available size, size=%d bufsize=%d"