From patchwork Tue May 12 01:43:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yang, Libin" X-Patchwork-Id: 6384881 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1913FBEEE1 for ; Tue, 12 May 2015 01:51:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 354432038D for ; Tue, 12 May 2015 01:51:29 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id F104B20384 for ; Tue, 12 May 2015 01:51:27 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 3DC3C265351; Tue, 12 May 2015 03:51:22 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 30C56261A32; Tue, 12 May 2015 03:51:20 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id CB54526520F; Tue, 12 May 2015 03:51:18 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by alsa0.perex.cz (Postfix) with ESMTP id 7F5C4265062 for ; Tue, 12 May 2015 03:51:09 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP; 11 May 2015 18:51:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,411,1427785200"; d="scan'208";a="569837583" Received: from younglee-grantley.sh.intel.com ([10.239.159.178]) by orsmga003.jf.intel.com with ESMTP; 11 May 2015 18:51:07 -0700 From: libin.yang@intel.com To: alsa-devel@alsa-project.org, tiwai@suse.de Date: Tue, 12 May 2015 09:43:20 +0800 Message-Id: <1431395002-111613-1-git-send-email-libin.yang@intel.com> X-Mailer: git-send-email 1.9.1 Cc: Libin Yang Subject: [alsa-devel] [PATCH 1/3] ALSA: hda - add hdac stream trace X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Libin Yang Add the trace of snd_hdac_stream_start and snd_hdac_stream_stop. Signed-off-by: Libin Yang --- sound/hda/hdac_stream.c | 5 +++++ sound/hda/trace.h | 27 +++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/sound/hda/hdac_stream.c b/sound/hda/hdac_stream.c index 1ba0462..52a894f 100644 --- a/sound/hda/hdac_stream.c +++ b/sound/hda/hdac_stream.c @@ -10,6 +10,7 @@ #include #include #include +#include "trace.h" /** * snd_hdac_stream_init - initialize each stream (aka device) @@ -48,6 +49,8 @@ void snd_hdac_stream_start(struct hdac_stream *azx_dev, bool fresh_start) { struct hdac_bus *bus = azx_dev->bus; + trace_snd_hdac_stream_start(bus, azx_dev); + azx_dev->start_wallclk = snd_hdac_chip_readl(bus, WALLCLK); if (!fresh_start) azx_dev->start_wallclk -= azx_dev->period_wallclk; @@ -82,6 +85,8 @@ EXPORT_SYMBOL_GPL(snd_hdac_stream_clear); */ void snd_hdac_stream_stop(struct hdac_stream *azx_dev) { + trace_snd_hdac_stream_stop(azx_dev->bus, azx_dev); + snd_hdac_stream_clear(azx_dev); /* disable SIE */ snd_hdac_chip_updatel(azx_dev->bus, INTCTL, 1 << azx_dev->index, 0); diff --git a/sound/hda/trace.h b/sound/hda/trace.h index 33a7eb5..e27e2c0 100644 --- a/sound/hda/trace.h +++ b/sound/hda/trace.h @@ -50,6 +50,33 @@ TRACE_EVENT(hda_unsol_event, ), TP_printk("%s", __get_str(msg)) ); + +DECLARE_EVENT_CLASS(hdac_stream, + TP_PROTO(struct hdac_bus *bus, struct hdac_stream *azx_dev), + + TP_ARGS(bus, azx_dev), + + TP_STRUCT__entry( + __field(unsigned char, stream_tag) + ), + + TP_fast_assign( + __entry->stream_tag = (azx_dev)->stream_tag; + ), + + TP_printk("stream_tag: %d", __entry->stream_tag) +); + +DEFINE_EVENT(hdac_stream, snd_hdac_stream_start, + TP_PROTO(struct hdac_bus *bus, struct hdac_stream *azx_dev), + TP_ARGS(bus, azx_dev) +); + +DEFINE_EVENT(hdac_stream, snd_hdac_stream_stop, + TP_PROTO(struct hdac_bus *bus, struct hdac_stream *azx_dev), + TP_ARGS(bus, azx_dev) +); + #endif /* __HDAC_TRACE_H */ /* This part must be outside protection */