From patchwork Mon Apr 7 15:04:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean Pihet X-Patchwork-Id: 27899 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yk0-f199.google.com (mail-yk0-f199.google.com [209.85.160.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D263720490 for ; Mon, 7 Apr 2014 15:05:22 +0000 (UTC) Received: by mail-yk0-f199.google.com with SMTP id 200sf14038373ykr.10 for ; Mon, 07 Apr 2014 08:05:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=tmamId72h875X1GXHDHCh+XzxRLV7V4s65qggLPg9LQ=; b=FyseoJWot8rgZa5GBMUwhWJQt+JDDANmWk0WkWFcmj1E5RMs56H2tzGFd1mANa0pAo XNxeEG4azCTGVQ7tmahfSEm1LtwNlhgbTaKhxYtHglqpEIAXFka48/Vlz/ByKLssVTds 0uHVNlOd4ioheS1Ejz/o25qyif+aDVhBRTXBbohfCmomffZyVq8fw4UNlfSxNuu6/k9h 8XNT5r6DFDUxNlXslzrJ+pGzmZcnj8VMKz+gu5TKJE/HcfnjwZ744WZoUwdQT/q1kN76 dmdoBxQJMKMdg3dLBfinypylUwUi7oSj8qF7v5QxhjZn9tfo4EVmt/42IV3rclqAUjBj ihtQ== X-Gm-Message-State: ALoCoQnQgeVCyYH9ycuUdJkOcx6jCDs1SB2qbaTUN/rgTaTamRERYA7h3WzxwRECTJz9FXdWdukZ X-Received: by 10.59.6.202 with SMTP id cw10mr6847013ved.12.1396883122494; Mon, 07 Apr 2014 08:05:22 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.41.169 with SMTP id z38ls1738209qgz.36.gmail; Mon, 07 Apr 2014 08:05:22 -0700 (PDT) X-Received: by 10.220.249.6 with SMTP id mi6mr592729vcb.33.1396883122369; Mon, 07 Apr 2014 08:05:22 -0700 (PDT) Received: from mail-ve0-f175.google.com (mail-ve0-f175.google.com [209.85.128.175]) by mx.google.com with ESMTPS id fn10si3174563vdc.45.2014.04.07.08.05.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 07 Apr 2014 08:05:22 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.175 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.175; Received: by mail-ve0-f175.google.com with SMTP id oz11so3709356veb.34 for ; Mon, 07 Apr 2014 08:05:22 -0700 (PDT) X-Received: by 10.220.2.142 with SMTP id 14mr6135vcj.48.1396883122278; Mon, 07 Apr 2014 08:05:22 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.12.8 with SMTP id v8csp169590vcv; Mon, 7 Apr 2014 08:05:21 -0700 (PDT) X-Received: by 10.66.254.2 with SMTP id ae2mr31736405pad.9.1396883121375; Mon, 07 Apr 2014 08:05:21 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id yl4si8497382pbc.126.2014.04.07.08.05.20; Mon, 07 Apr 2014 08:05:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755351AbaDGPFQ (ORCPT + 27 others); Mon, 7 Apr 2014 11:05:16 -0400 Received: from mail-ee0-f44.google.com ([74.125.83.44]:46420 "EHLO mail-ee0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752575AbaDGPFJ (ORCPT ); Mon, 7 Apr 2014 11:05:09 -0400 Received: by mail-ee0-f44.google.com with SMTP id e49so751139eek.31 for ; Mon, 07 Apr 2014 08:05:07 -0700 (PDT) X-Received: by 10.15.45.130 with SMTP id b2mr3447610eew.28.1396883107771; Mon, 07 Apr 2014 08:05:07 -0700 (PDT) Received: from localhost.localdomain (201-179-62-37.mobileinternet.proximus.be. [37.62.179.201]) by mx.google.com with ESMTPSA id o4sm42287649eef.20.2014.04.07.08.05.05 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 07 Apr 2014 08:05:07 -0700 (PDT) From: Jean Pihet To: Borislav Petkov , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Jiri Olsa , linux-kernel@vger.kernel.org, Robert Richter Cc: Borislav Petkov Subject: [PATCH 06/16] mce, x86: Enable persistent events Date: Mon, 7 Apr 2014 17:04:28 +0200 Message-Id: <1396883078-25320-7-git-send-email-jean.pihet@linaro.org> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1396883078-25320-1-git-send-email-jean.pihet@linaro.org> References: <1396883078-25320-1-git-send-email-jean.pihet@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: jean.pihet@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.175 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Borislav Petkov ... for MCEs collection. Signed-off-by: Borislav Petkov [ rric: Fix build error for no-tracepoints configs ] [ rric: Return proper error code. ] [ rric: No error message if perf is disabled. ] Signed-off-by: Robert Richter --- arch/x86/kernel/cpu/mcheck/mce.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c index 4d5419b..92b0d45 100644 --- a/arch/x86/kernel/cpu/mcheck/mce.c +++ b/arch/x86/kernel/cpu/mcheck/mce.c @@ -2018,6 +2018,25 @@ int __init mcheck_init(void) return 0; } +#ifdef CONFIG_EVENT_TRACING + +int __init mcheck_init_tp(void) +{ + int ret = perf_add_persistent_tp(&event_mce_record); + + if (ret && ret != -ENOENT) + pr_err("Error adding MCE persistent event: %d\n", ret); + + return ret; +} +/* + * We can't run earlier because persistent events uses anon_inode_getfile and + * its anon_inode_mnt gets initialized as a fs_initcall. + */ +fs_initcall_sync(mcheck_init_tp); + +#endif /* CONFIG_EVENT_TRACING */ + /* * mce_syscore: PM support */