]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - kernel/trace/ftrace.c
tracing: do not allow modifying the ftrace events via the event files
[linux-2.6-omap-h63xx.git] / kernel / trace / ftrace.c
index 5a3a06b21eeee97fd8c527deaf1bd57887402b7b..d33d306bdcf4648ab9daabeabb803828c4864cb1 100644 (file)
@@ -218,10 +218,8 @@ static void ftrace_update_pid_func(void)
 {
        ftrace_func_t func;
 
-       mutex_lock(&ftrace_lock);
-
        if (ftrace_trace_function == ftrace_stub)
-               goto out;
+               return;
 
        func = ftrace_trace_function;
 
@@ -238,9 +236,6 @@ static void ftrace_update_pid_func(void)
 #else
        __ftrace_trace_function = func;
 #endif
-
- out:
-       mutex_unlock(&ftrace_lock);
 }
 
 /* set when tracing only a pid */
@@ -1869,21 +1864,21 @@ ftrace_notrace_release(struct inode *inode, struct file *file)
        return ftrace_regex_release(inode, file, 0);
 }
 
-static struct file_operations ftrace_avail_fops = {
+static const struct file_operations ftrace_avail_fops = {
        .open = ftrace_avail_open,
        .read = seq_read,
        .llseek = seq_lseek,
        .release = ftrace_avail_release,
 };
 
-static struct file_operations ftrace_failures_fops = {
+static const struct file_operations ftrace_failures_fops = {
        .open = ftrace_failures_open,
        .read = seq_read,
        .llseek = seq_lseek,
        .release = ftrace_avail_release,
 };
 
-static struct file_operations ftrace_filter_fops = {
+static const struct file_operations ftrace_filter_fops = {
        .open = ftrace_filter_open,
        .read = ftrace_regex_read,
        .write = ftrace_filter_write,
@@ -1891,7 +1886,7 @@ static struct file_operations ftrace_filter_fops = {
        .release = ftrace_filter_release,
 };
 
-static struct file_operations ftrace_notrace_fops = {
+static const struct file_operations ftrace_notrace_fops = {
        .open = ftrace_notrace_open,
        .read = ftrace_regex_read,
        .write = ftrace_notrace_write,
@@ -2423,7 +2418,7 @@ ftrace_pid_write(struct file *filp, const char __user *ubuf,
        return cnt;
 }
 
-static struct file_operations ftrace_pid_fops = {
+static const struct file_operations ftrace_pid_fops = {
        .read = ftrace_pid_read,
        .write = ftrace_pid_write,
 };