From patchwork Tue May 12 01:43:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yang, Libin" X-Patchwork-Id: 6384901 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 A7F74BEEE1 for ; Tue, 12 May 2015 01:52:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C89AE203A5 for ; Tue, 12 May 2015 01:52:22 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 7B7892038D for ; Tue, 12 May 2015 01:52:21 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 0A05226549A; Tue, 12 May 2015 03:52:20 +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 17457261A32; Tue, 12 May 2015 03:51:24 +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 D0DE0265275; Tue, 12 May 2015 03:51:20 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by alsa0.perex.cz (Postfix) with ESMTP id E7AD92651D8 for ; Tue, 12 May 2015 03:51:10 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP; 11 May 2015 18:51:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,411,1427785200"; d="scan'208";a="569837595" Received: from younglee-grantley.sh.intel.com ([10.239.159.178]) by orsmga003.jf.intel.com with ESMTP; 11 May 2015 18:51:09 -0700 From: libin.yang@intel.com To: alsa-devel@alsa-project.org, tiwai@suse.de Date: Tue, 12 May 2015 09:43:22 +0800 Message-Id: <1431395002-111613-3-git-send-email-libin.yang@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1431395002-111613-1-git-send-email-libin.yang@intel.com> References: <1431395002-111613-1-git-send-email-libin.yang@intel.com> Cc: Libin Yang Subject: [alsa-devel] [PATCH 3/3] ALSA: hda - add hda_intel_trace.h 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 This patch creates hda_intel_trace.h to add some pm trace functions used in hda_intel.c Signed-off-by: Libin Yang --- sound/pci/hda/Makefile | 1 + sound/pci/hda/hda_intel.c | 9 +++++++ sound/pci/hda/hda_intel_trace.h | 53 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 63 insertions(+) diff --git a/sound/pci/hda/Makefile b/sound/pci/hda/Makefile index c5e6651..9c259ce 100644 --- a/sound/pci/hda/Makefile +++ b/sound/pci/hda/Makefile @@ -11,6 +11,7 @@ snd-hda-codec-$(CONFIG_SND_HDA_INPUT_BEEP) += hda_beep.o # for trace-points CFLAGS_hda_controller.o := -I$(src) +CFLAGS_hda_intel.o := -I$(src) snd-hda-codec-generic-objs := hda_generic.o snd-hda-codec-realtek-objs := patch_realtek.o diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 706879a..5c84d40 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -64,6 +64,9 @@ #include "hda_controller.h" #include "hda_intel.h" +#define CREATE_TRACE_POINTS +#include "hda_intel_trace.h" + /* position fix mode */ enum { POS_FIX_AUTO, @@ -831,6 +834,8 @@ static int azx_suspend(struct device *dev) if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL && hda->need_i915_power) hda_display_power(hda, false); + + trace_azx_suspend(chip); return 0; } @@ -864,6 +869,8 @@ static int azx_resume(struct device *dev) hda_intel_init_chip(chip, true); snd_power_change_state(card, SNDRV_CTL_POWER_D0); + + trace_azx_resume(chip); return 0; } #endif /* CONFIG_PM_SLEEP || SUPPORT_VGA_SWITCHEROO */ @@ -897,6 +904,7 @@ static int azx_runtime_suspend(struct device *dev) && hda->need_i915_power) hda_display_power(hda, false); + trace_azx_runtime_suspend(chip); return 0; } @@ -945,6 +953,7 @@ static int azx_runtime_resume(struct device *dev) azx_writew(chip, WAKEEN, azx_readw(chip, WAKEEN) & ~STATESTS_INT_MASK); + trace_azx_runtime_resume(chip); return 0; } diff --git a/sound/pci/hda/hda_intel_trace.h b/sound/pci/hda/hda_intel_trace.h index e69de29..0922d8b 100644 --- a/sound/pci/hda/hda_intel_trace.h +++ b/sound/pci/hda/hda_intel_trace.h @@ -0,0 +1,53 @@ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM hda_intel +#define TRACE_INCLUDE_FILE hda_intel_trace + +#if !defined(_TRACE_HDA_INTEL_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_HDA_INTEL_H + +#include + +DECLARE_EVENT_CLASS(hda_pm, + TP_PROTO(struct azx *chip), + + TP_ARGS(chip), + + TP_STRUCT__entry( + __field(int, dev_index) + ), + + TP_fast_assign( + __entry->dev_index = (chip)->dev_index; + ), + + TP_printk("card index: %d", __entry->dev_index) +); + +DEFINE_EVENT(hda_pm, azx_suspend, + TP_PROTO(struct azx *chip), + TP_ARGS(chip) +); + +DEFINE_EVENT(hda_pm, azx_resume, + TP_PROTO(struct azx *chip), + TP_ARGS(chip) +); + +#ifdef CONFIG_PM +DEFINE_EVENT(hda_pm, azx_runtime_suspend, + TP_PROTO(struct azx *chip), + TP_ARGS(chip) +); + +DEFINE_EVENT(hda_pm, azx_runtime_resume, + TP_PROTO(struct azx *chip), + TP_ARGS(chip) +); +#endif + +#endif /* _TRACE_HDA_INTEL_H */ + +/* This part must be outside protection */ +#undef TRACE_INCLUDE_PATH +#define TRACE_INCLUDE_PATH . +#include