Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753710Ab3HVOQx (ORCPT ); Thu, 22 Aug 2013 10:16:53 -0400 Received: from mail-bk0-f49.google.com ([209.85.214.49]:61882 "EHLO mail-bk0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753138Ab3HVOOp (ORCPT ); Thu, 22 Aug 2013 10:14:45 -0400 From: Robert Richter To: Peter Zijlstra Cc: Ingo Molnar , Arnaldo Carvalho de Melo , Borislav Petkov , Jiri Olsa , linux-kernel@vger.kernel.org, Borislav Petkov , Robert Richter Subject: [PATCH v3 06/12] mce, x86: Enable persistent events Date: Thu, 22 Aug 2013 16:13:21 +0200 Message-Id: <1377180807-12758-7-git-send-email-rric@kernel.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1377180807-12758-1-git-send-email-rric@kernel.org> References: <1377180807-12758-1-git-send-email-rric@kernel.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1393 Lines: 51 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 87a65c9..ffa227b 100644 --- a/arch/x86/kernel/cpu/mcheck/mce.c +++ b/arch/x86/kernel/cpu/mcheck/mce.c @@ -1990,6 +1990,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 */ -- 1.8.3.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/