From patchwork Thu Aug 22 14:13:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Richter X-Patchwork-Id: 19412 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f197.google.com (mail-vc0-f197.google.com [209.85.220.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3590525E5D for ; Thu, 22 Aug 2013 14:14:47 +0000 (UTC) Received: by mail-vc0-f197.google.com with SMTP id ha11sf1552937vcb.8 for ; Thu, 22 Aug 2013 07:14:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:delivered-to:sender:from:to:cc:subject:date:message-id :in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=boMlQpL48ucMdWGgrc2Vq+jusQbGb0kXrkRe4CKw+ik=; b=m/Smw4Z1jVH9q+j6diSbEtL+sYBSxDcgKKlves2r74kbQn941rS+ea4Au5QLb9q0ac LhhxsIs78A2tLZydmIDwUQS9KWFgQbQjZ+HScSH3zAweZsOo+TwN/jWYe9cBONfQcgWO k8heHVsbvJ+K4c4agkFYgKSnRBAnclxp56ooRnBnRvoRw8cxDr5YojSsq93XUZy+dBW3 /N47DURJ5bmTtFs6xuLiwKCKgve0saKKl9xz8qJaPYowfk9ZCbDK7oKX4LkGAzQ5Xsdu 1nDd2/bIFWWT+suqPFmF15ukX+obSRH23FBvQzdWFY6KmBqyRQ33V0T0p3WXKVY+/7MY 9s4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-gm-message-state:delivered-to:sender:from:to:cc :subject:date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=boMlQpL48ucMdWGgrc2Vq+jusQbGb0kXrkRe4CKw+ik=; b=aBeNB1LqL29zbRElBrQwvunQ177+KhT5LOjR15A8oGuuAO+xFR7hJy0Iz7QqPPyvEA gZiPpsUmW5ZdIg7b8f1fdaSpio5lEPZZgMrgfEYJmN36GbGOmmS9bLcj30cn4xXbYmoB h6X5cJfwtOR3d7asY3j0l9WKiK0EoZDEPiszJi+rInqCAhONek7O37T6RkPrE8ywq1NN HeP+YdvNwJZlPRSAD6fGV2cQjuQkDyH46BMnuy9TKlEv9BgCKa04PZAIuDpMyt6YS0vH CdNx7yGyM0yhGYpPzUoymNgAFqXLo3RBHS1u5+j1KZHjlwCbBBGUQm2+7go8ZbpyPhZy V4mw== X-Received: by 10.236.45.102 with SMTP id o66mr4621897yhb.47.1377180886907; Thu, 22 Aug 2013 07:14:46 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.76.33 with SMTP id h1ls1203752qew.29.gmail; Thu, 22 Aug 2013 07:14:46 -0700 (PDT) X-Received: by 10.220.74.69 with SMTP id t5mr11897430vcj.18.1377180886784; Thu, 22 Aug 2013 07:14:46 -0700 (PDT) Received: from mail-ve0-x22f.google.com (mail-ve0-x22f.google.com [2607:f8b0:400c:c01::22f]) by mx.google.com with ESMTPS id o5si4002234vcj.140.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 22 Aug 2013 07:14:46 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::22f is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c01::22f; Received: by mail-ve0-f175.google.com with SMTP id oy10so1527994veb.6 for ; Thu, 22 Aug 2013 07:14:46 -0700 (PDT) X-Gm-Message-State: ALoCoQkT4NcSTgHueFGSOsKHsYwf8NY3qZoEXYRs1ftJa15HIZ2h9cHp60HlEnw0liL3WLmPB5qY X-Received: by 10.52.249.102 with SMTP id yt6mr9938216vdc.21.1377180886711; Thu, 22 Aug 2013 07:14:46 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp33213vcz; Thu, 22 Aug 2013 07:14:46 -0700 (PDT) X-Received: by 10.205.26.67 with SMTP id rl3mr301665bkb.41.1377180885203; Thu, 22 Aug 2013 07:14:45 -0700 (PDT) Received: from mail-bk0-x22e.google.com (mail-bk0-x22e.google.com [2a00:1450:4008:c01::22e]) by mx.google.com with ESMTPS id qv10si2301877bkb.242.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 22 Aug 2013 07:14:45 -0700 (PDT) Received-SPF: pass (google.com: domain of rric.net@gmail.com designates 2a00:1450:4008:c01::22e as permitted sender) client-ip=2a00:1450:4008:c01::22e; Received: by mail-bk0-f46.google.com with SMTP id 6so713266bkj.33 for ; Thu, 22 Aug 2013 07:14:44 -0700 (PDT) X-Received: by 10.205.14.197 with SMTP id pr5mr7046569bkb.25.1377180884530; Thu, 22 Aug 2013 07:14:44 -0700 (PDT) Received: from rric.localhost (g224195237.adsl.alicedsl.de. [92.224.195.237]) by mx.google.com with ESMTPSA id jh13sm3079991bkb.13.1969.12.31.16.00.00 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 22 Aug 2013 07:14:43 -0700 (PDT) Sender: Robert Richter 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> X-Original-Sender: rric.net@gmail.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::22f 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; dkim=pass header.i=@gmail.com Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: 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 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 */