diff options
author | Borislav Petkov <bp@suse.de> | 2014-04-07 17:04:28 +0200 |
---|---|---|
committer | Fu Wei <fu.wei@linaro.org> | 2015-09-07 22:40:33 +0800 |
commit | d52b78505eee85015c9f1cb52882c72599661f7e (patch) | |
tree | deb2c28d96d5a26368223fda8ec31e7709e9fc80 | |
parent | 850643646f9c0a76b15f535d0b8f3dbca06e1dc2 (diff) |
mce, x86: Enable persistent eventsperf-persistent-events
... for MCEs collection.
Signed-off-by: Borislav Petkov <bp@suse.de>
[ 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 <rric@kernel.org>
-rw-r--r-- | arch/x86/kernel/cpu/mcheck/mce.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c index df919ff103c3..73a0f6643add 100644 --- a/arch/x86/kernel/cpu/mcheck/mce.c +++ b/arch/x86/kernel/cpu/mcheck/mce.c @@ -2061,6 +2061,26 @@ 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 */ |