From patchwork Wed Apr 7 07:39:56 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hidetoshi Seto X-Patchwork-Id: 90958 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o377eD52015666 for ; Wed, 7 Apr 2010 07:40:13 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751281Ab0DGHkM (ORCPT ); Wed, 7 Apr 2010 03:40:12 -0400 Received: from fgwmail6.fujitsu.co.jp ([192.51.44.36]:37561 "EHLO fgwmail6.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751033Ab0DGHkL (ORCPT ); Wed, 7 Apr 2010 03:40:11 -0400 Received: from m2.gw.fujitsu.co.jp ([10.0.50.72]) by fgwmail6.fujitsu.co.jp (Fujitsu Gateway) with ESMTP id o377e9EZ010463 for (envelope-from seto.hidetoshi@jp.fujitsu.com); Wed, 7 Apr 2010 16:40:10 +0900 Received: from smail (m2 [127.0.0.1]) by outgoing.m2.gw.fujitsu.co.jp (Postfix) with ESMTP id 9CE3745DE62 for ; Wed, 7 Apr 2010 16:40:09 +0900 (JST) Received: from s2.gw.fujitsu.co.jp (s2.gw.fujitsu.co.jp [10.0.50.92]) by m2.gw.fujitsu.co.jp (Postfix) with ESMTP id 4834445DE4F for ; Wed, 7 Apr 2010 16:40:09 +0900 (JST) Received: from s2.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s2.gw.fujitsu.co.jp (Postfix) with ESMTP id E7960E38005 for ; Wed, 7 Apr 2010 16:40:08 +0900 (JST) Received: from m105.s.css.fujitsu.com (m105.s.css.fujitsu.com [10.249.87.105]) by s2.gw.fujitsu.co.jp (Postfix) with ESMTP id 954711DB803A for ; Wed, 7 Apr 2010 16:40:05 +0900 (JST) Received: from m105.css.fujitsu.com (m105 [127.0.0.1]) by m105.s.css.fujitsu.com (Postfix) with ESMTP id 5C7BF608002; Wed, 7 Apr 2010 16:40:05 +0900 (JST) Received: from [127.0.0.1] (unknown [10.124.100.141]) by m105.s.css.fujitsu.com (Postfix) with ESMTP id E77FD5D8004; Wed, 7 Apr 2010 16:40:04 +0900 (JST) X-SecurityPolicyCheck-FJ: OK by FujitsuOutboundMailChecker v1.3.1 Received: from FMVDA2A041[10.124.100.141] by FMVDA2A041 (FujitsuOutboundMailChecker v1.3.1/9992[10.124.100.141]); Wed, 07 Apr 2010 16:40:04 +0900 (JST) Message-ID: <4BBC36CC.3000709@jp.fujitsu.com> Date: Wed, 07 Apr 2010 16:39:56 +0900 From: Hidetoshi Seto User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; ja; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4 MIME-Version: 1.0 To: linux-pci@vger.kernel.org CC: Jesse Barnes , Ingo Molnar Subject: [PATCH 21/22] trace, pcie, aer: trace_aer_irq to trace receipt of AER message References: <4BBC30C2.7010300@jp.fujitsu.com> In-Reply-To: <4BBC30C2.7010300@jp.fujitsu.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 07 Apr 2010 07:40:18 +0000 (UTC) diff --git a/drivers/pci/pcie/aer/aerdrv.c b/drivers/pci/pcie/aer/aerdrv.c index 0612bd9..9853993 100644 --- a/drivers/pci/pcie/aer/aerdrv.c +++ b/drivers/pci/pcie/aer/aerdrv.c @@ -29,6 +29,8 @@ #include "aerdrv.h" #include "../../pci.h" +#include + /* * Version Information */ @@ -133,6 +135,9 @@ irqreturn_t aer_irq(int irq, void *context) pci_read_config_dword(pdev->port, pos + PCI_ERR_ROOT_ERR_SRC, &id); pci_write_config_dword(pdev->port, pos + PCI_ERR_ROOT_STATUS, status); + /* Emit the trace record */ + trace_aer_irq(pdev->port, status, id); + /* Store error source for later DPC handler */ if (!set_e_source(rpc, status, id)) { /* diff --git a/include/trace/events/pcie_aer.h b/include/trace/events/pcie_aer.h index d1d6497..aceb6d7 100644 --- a/include/trace/events/pcie_aer.h +++ b/include/trace/events/pcie_aer.h @@ -62,6 +62,31 @@ TRACE_EVENT(aer_record, ) ); +TRACE_EVENT(aer_irq, + + TP_PROTO(struct pci_dev *pdev, int status, int id), + + TP_ARGS(pdev, status, id), + + TP_STRUCT__entry( + __field( u32, status ) + __field( u32, id ) + __string( dstr, dev_driver_string(&pdev->dev) ) + __string( name, dev_name(&pdev->dev) ) + ), + + TP_fast_assign( + __entry->status = status; + __entry->id = id; + __assign_str(dstr, dev_driver_string(&pdev->dev)); + __assign_str(name, dev_name(&pdev->dev)); + ), + + TP_printk("%s %s: status=%08xh, id=%08xh", + __get_str(dstr), __get_str(name), __entry->status, __entry->id + ) +); + #endif /* _TRACE_PCIE_AER_H */ /* This part must be outside protection */