From patchwork Sun Dec 8 04:17:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Wang X-Patchwork-Id: 3305551 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id F3B9B9F392 for ; Sun, 8 Dec 2013 04:26:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EC31420351 for ; Sun, 8 Dec 2013 04:26:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 246A420320 for ; Sun, 8 Dec 2013 04:26:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754164Ab3LHE0F (ORCPT ); Sat, 7 Dec 2013 23:26:05 -0500 Received: from mail-pb0-f49.google.com ([209.85.160.49]:36184 "EHLO mail-pb0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751532Ab3LHE0D (ORCPT ); Sat, 7 Dec 2013 23:26:03 -0500 Received: by mail-pb0-f49.google.com with SMTP id jt11so3354786pbb.36 for ; Sat, 07 Dec 2013 20:26:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=k20CDqxDF10QzDEuTYGBIaJKB+9zoLqrpOq0yN/c+Zo=; b=dYrZGujujt3kudq6VucWuUSIckOxuhEJWDtT8wfw/+yw2M6UErnyg4z/ql65jPh9Ar rFWTL2zLtiFvp/ce283CUD5YRKnLy+DWqxvP46pe8XfPPZqzWZKIYYqHMQsfG9ILV1ou Wzn8rnuqG8zqYf8LyhgV+yhh31yeUPac5rFVCgRYf6lOAnLmxXU6Fgquxmtuy3oS2FMu l7tlqEMpjT7mey5Kgcwj6qRL1FrVkBV13iyrvFVDw5c4/83ooKndSmX9Q8Jd5Kk4E5/q 5QMSVqJJ39TjMrn5A54Aw0fDWryv4vZG1G4uS+M5Ap8TlTctL4QDwIok789lR1F0564T fuGg== X-Received: by 10.66.219.233 with SMTP id pr9mr13308897pac.45.1386476761306; Sat, 07 Dec 2013 20:26:01 -0800 (PST) Received: from localhost.localdomain (shzdmzpr02-ext.sh.intel.com. [192.102.204.37]) by mx.google.com with ESMTPSA id z10sm11464773pas.6.2013.12.07.20.25.54 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 07 Dec 2013 20:25:59 -0800 (PST) From: Rui Wang To: bp@alien8.de Cc: lance.ortiz@hp.com, bhelgaas@google.com, lance_ortiz@hotmail.com, jiang.liu@intel.com, tony.luck@intel.com, rostedt@goodmis.org, linux-acpi@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, gong.chen@linux.intel.com, m.chehab@samsung.com, Rui Wang Subject: [PATCH] aerdrv: Fix severity usage in aer trace event Date: Sun, 8 Dec 2013 12:17:53 +0800 Message-Id: <1386476273-2418-1-git-send-email-rui.y.wang@intel.com> X-Mailer: git-send-email 1.7.5.4 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP There's inconsistency between dmesg and the trace event output. When dmesg says "severity=Corrected", the trace event says "severity=Fatal". What happens is that HW_EVENT_ERR_CORRECTED is defined in edac.h: enum hw_event_mc_err_type { HW_EVENT_ERR_CORRECTED, HW_EVENT_ERR_UNCORRECTED, HW_EVENT_ERR_FATAL, HW_EVENT_ERR_INFO, }; while aer_print_error() uses aer_error_severity_string[] defined as: static const char *aer_error_severity_string[] = { "Uncorrected (Non-Fatal)", "Uncorrected (Fatal)", "Corrected" }; In this case dmesg is correct because info->severity is assigned in aer_isr_one_error() using the definitions in include/linux/ras.h: Signed-off-by: Rui Wang --- include/trace/events/ras.h | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/trace/events/ras.h b/include/trace/events/ras.h index 88b8783..1c875ad 100644 --- a/include/trace/events/ras.h +++ b/include/trace/events/ras.h @@ -5,7 +5,7 @@ #define _TRACE_AER_H #include -#include +#include /* @@ -63,10 +63,10 @@ TRACE_EVENT(aer_event, TP_printk("%s PCIe Bus Error: severity=%s, %s\n", __get_str(dev_name), - __entry->severity == HW_EVENT_ERR_CORRECTED ? "Corrected" : - __entry->severity == HW_EVENT_ERR_FATAL ? - "Fatal" : "Uncorrected", - __entry->severity == HW_EVENT_ERR_CORRECTED ? + __entry->severity == AER_CORRECTABLE ? "Corrected" : + __entry->severity == AER_FATAL ? + "Fatal" : "Uncorrected, non-fatal", + __entry->severity == AER_CORRECTABLE ? __print_flags(__entry->status, "|", aer_correctable_errors) : __print_flags(__entry->status, "|", aer_uncorrectable_errors)) );