14 #include <linux/kernel.h>
15 #include <linux/compiler.h>
20 #include <linux/types.h>
27 #include <asm/barrier.h>
30 static void notrace pstore_ftrace_call(
unsigned long ip,
31 unsigned long parent_ip)
51 .func = pstore_ftrace_call,
55 static bool pstore_ftrace_enabled;
57 static ssize_t pstore_ftrace_knob_write(
struct file *
f,
const char __user *
buf,
58 size_t count, loff_t *ppos)
69 if (!on ^ pstore_ftrace_enabled)
77 pr_err(
"%s: unable to %sregister ftrace ops: %zd\n",
78 __func__, on ?
"" :
"un", ret);
82 pstore_ftrace_enabled = on;
91 static ssize_t pstore_ftrace_knob_read(
struct file *f,
char __user *buf,
92 size_t count, loff_t *ppos)
94 char val[] = {
'0' + pstore_ftrace_enabled,
'\n' };
101 .read = pstore_ftrace_knob_read,
102 .write = pstore_ftrace_knob_write,
115 pr_err(
"%s: unable to create pstore directory\n", __func__);
122 pr_err(
"%s: unable to create record_ftrace file\n", __func__);