diff options
Diffstat (limited to 'drivers/oprofile/oprofile_files.c')
-rw-r--r-- | drivers/oprofile/oprofile_files.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/drivers/oprofile/oprofile_files.c b/drivers/oprofile/oprofile_files.c index ef953ba5ab6b..cc106d503ace 100644 --- a/drivers/oprofile/oprofile_files.c +++ b/drivers/oprofile/oprofile_files.c | |||
@@ -13,18 +13,18 @@ | |||
13 | #include "event_buffer.h" | 13 | #include "event_buffer.h" |
14 | #include "oprofile_stats.h" | 14 | #include "oprofile_stats.h" |
15 | #include "oprof.h" | 15 | #include "oprof.h" |
16 | 16 | ||
17 | unsigned long fs_buffer_size = 131072; | 17 | unsigned long fs_buffer_size = 131072; |
18 | unsigned long fs_cpu_buffer_size = 8192; | 18 | unsigned long fs_cpu_buffer_size = 8192; |
19 | unsigned long fs_buffer_watershed = 32768; /* FIXME: tune */ | 19 | unsigned long fs_buffer_watershed = 32768; /* FIXME: tune */ |
20 | 20 | ||
21 | static ssize_t depth_read(struct file * file, char __user * buf, size_t count, loff_t * offset) | 21 | static ssize_t depth_read(struct file *file, char __user *buf, size_t count, loff_t *offset) |
22 | { | 22 | { |
23 | return oprofilefs_ulong_to_user(backtrace_depth, buf, count, offset); | 23 | return oprofilefs_ulong_to_user(backtrace_depth, buf, count, offset); |
24 | } | 24 | } |
25 | 25 | ||
26 | 26 | ||
27 | static ssize_t depth_write(struct file * file, char const __user * buf, size_t count, loff_t * offset) | 27 | static ssize_t depth_write(struct file *file, char const __user *buf, size_t count, loff_t *offset) |
28 | { | 28 | { |
29 | unsigned long val; | 29 | unsigned long val; |
30 | int retval; | 30 | int retval; |
@@ -49,8 +49,8 @@ static const struct file_operations depth_fops = { | |||
49 | .write = depth_write | 49 | .write = depth_write |
50 | }; | 50 | }; |
51 | 51 | ||
52 | 52 | ||
53 | static ssize_t pointer_size_read(struct file * file, char __user * buf, size_t count, loff_t * offset) | 53 | static ssize_t pointer_size_read(struct file *file, char __user *buf, size_t count, loff_t *offset) |
54 | { | 54 | { |
55 | return oprofilefs_ulong_to_user(sizeof(void *), buf, count, offset); | 55 | return oprofilefs_ulong_to_user(sizeof(void *), buf, count, offset); |
56 | } | 56 | } |
@@ -61,24 +61,24 @@ static const struct file_operations pointer_size_fops = { | |||
61 | }; | 61 | }; |
62 | 62 | ||
63 | 63 | ||
64 | static ssize_t cpu_type_read(struct file * file, char __user * buf, size_t count, loff_t * offset) | 64 | static ssize_t cpu_type_read(struct file *file, char __user *buf, size_t count, loff_t *offset) |
65 | { | 65 | { |
66 | return oprofilefs_str_to_user(oprofile_ops.cpu_type, buf, count, offset); | 66 | return oprofilefs_str_to_user(oprofile_ops.cpu_type, buf, count, offset); |
67 | } | 67 | } |
68 | 68 | ||
69 | 69 | ||
70 | static const struct file_operations cpu_type_fops = { | 70 | static const struct file_operations cpu_type_fops = { |
71 | .read = cpu_type_read, | 71 | .read = cpu_type_read, |
72 | }; | 72 | }; |
73 | 73 | ||
74 | 74 | ||
75 | static ssize_t enable_read(struct file * file, char __user * buf, size_t count, loff_t * offset) | 75 | static ssize_t enable_read(struct file *file, char __user *buf, size_t count, loff_t *offset) |
76 | { | 76 | { |
77 | return oprofilefs_ulong_to_user(oprofile_started, buf, count, offset); | 77 | return oprofilefs_ulong_to_user(oprofile_started, buf, count, offset); |
78 | } | 78 | } |
79 | 79 | ||
80 | 80 | ||
81 | static ssize_t enable_write(struct file * file, char const __user * buf, size_t count, loff_t * offset) | 81 | static ssize_t enable_write(struct file *file, char const __user *buf, size_t count, loff_t *offset) |
82 | { | 82 | { |
83 | unsigned long val; | 83 | unsigned long val; |
84 | int retval; | 84 | int retval; |
@@ -89,7 +89,7 @@ static ssize_t enable_write(struct file * file, char const __user * buf, size_t | |||
89 | retval = oprofilefs_ulong_from_user(&val, buf, count); | 89 | retval = oprofilefs_ulong_from_user(&val, buf, count); |
90 | if (retval) | 90 | if (retval) |
91 | return retval; | 91 | return retval; |
92 | 92 | ||
93 | if (val) | 93 | if (val) |
94 | retval = oprofile_start(); | 94 | retval = oprofile_start(); |
95 | else | 95 | else |
@@ -100,14 +100,14 @@ static ssize_t enable_write(struct file * file, char const __user * buf, size_t | |||
100 | return count; | 100 | return count; |
101 | } | 101 | } |
102 | 102 | ||
103 | 103 | ||
104 | static const struct file_operations enable_fops = { | 104 | static const struct file_operations enable_fops = { |
105 | .read = enable_read, | 105 | .read = enable_read, |
106 | .write = enable_write, | 106 | .write = enable_write, |
107 | }; | 107 | }; |
108 | 108 | ||
109 | 109 | ||
110 | static ssize_t dump_write(struct file * file, char const __user * buf, size_t count, loff_t * offset) | 110 | static ssize_t dump_write(struct file *file, char const __user *buf, size_t count, loff_t *offset) |
111 | { | 111 | { |
112 | wake_up_buffer_waiter(); | 112 | wake_up_buffer_waiter(); |
113 | return count; | 113 | return count; |
@@ -117,8 +117,8 @@ static ssize_t dump_write(struct file * file, char const __user * buf, size_t co | |||
117 | static const struct file_operations dump_fops = { | 117 | static const struct file_operations dump_fops = { |
118 | .write = dump_write, | 118 | .write = dump_write, |
119 | }; | 119 | }; |
120 | 120 | ||
121 | void oprofile_create_files(struct super_block * sb, struct dentry * root) | 121 | void oprofile_create_files(struct super_block *sb, struct dentry *root) |
122 | { | 122 | { |
123 | oprofilefs_create_file(sb, root, "enable", &enable_fops); | 123 | oprofilefs_create_file(sb, root, "enable", &enable_fops); |
124 | oprofilefs_create_file_perm(sb, root, "dump", &dump_fops, 0666); | 124 | oprofilefs_create_file_perm(sb, root, "dump", &dump_fops, 0666); |
@@ -126,7 +126,7 @@ void oprofile_create_files(struct super_block * sb, struct dentry * root) | |||
126 | oprofilefs_create_ulong(sb, root, "buffer_size", &fs_buffer_size); | 126 | oprofilefs_create_ulong(sb, root, "buffer_size", &fs_buffer_size); |
127 | oprofilefs_create_ulong(sb, root, "buffer_watershed", &fs_buffer_watershed); | 127 | oprofilefs_create_ulong(sb, root, "buffer_watershed", &fs_buffer_watershed); |
128 | oprofilefs_create_ulong(sb, root, "cpu_buffer_size", &fs_cpu_buffer_size); | 128 | oprofilefs_create_ulong(sb, root, "cpu_buffer_size", &fs_cpu_buffer_size); |
129 | oprofilefs_create_file(sb, root, "cpu_type", &cpu_type_fops); | 129 | oprofilefs_create_file(sb, root, "cpu_type", &cpu_type_fops); |
130 | oprofilefs_create_file(sb, root, "backtrace_depth", &depth_fops); | 130 | oprofilefs_create_file(sb, root, "backtrace_depth", &depth_fops); |
131 | oprofilefs_create_file(sb, root, "pointer_size", &pointer_size_fops); | 131 | oprofilefs_create_file(sb, root, "pointer_size", &pointer_size_fops); |
132 | oprofile_create_stats_files(sb, root); | 132 | oprofile_create_stats_files(sb, root); |