diff options
Diffstat (limited to 'drivers/oprofile/oprof.c')
-rw-r--r-- | drivers/oprofile/oprof.c | 32 |
1 files changed, 8 insertions, 24 deletions
diff --git a/drivers/oprofile/oprof.c b/drivers/oprofile/oprof.c index b336cd9ee7a1..f9bda64fcd1b 100644 --- a/drivers/oprofile/oprof.c +++ b/drivers/oprofile/oprof.c | |||
@@ -225,26 +225,17 @@ post_sync: | |||
225 | mutex_unlock(&start_mutex); | 225 | mutex_unlock(&start_mutex); |
226 | } | 226 | } |
227 | 227 | ||
228 | int oprofile_set_backtrace(unsigned long val) | 228 | int oprofile_set_ulong(unsigned long *addr, unsigned long val) |
229 | { | 229 | { |
230 | int err = 0; | 230 | int err = -EBUSY; |
231 | 231 | ||
232 | mutex_lock(&start_mutex); | 232 | mutex_lock(&start_mutex); |
233 | 233 | if (!oprofile_started) { | |
234 | if (oprofile_started) { | 234 | *addr = val; |
235 | err = -EBUSY; | 235 | err = 0; |
236 | goto out; | ||
237 | } | ||
238 | |||
239 | if (!oprofile_ops.backtrace) { | ||
240 | err = -EINVAL; | ||
241 | goto out; | ||
242 | } | 236 | } |
243 | |||
244 | oprofile_backtrace_depth = val; | ||
245 | |||
246 | out: | ||
247 | mutex_unlock(&start_mutex); | 237 | mutex_unlock(&start_mutex); |
238 | |||
248 | return err; | 239 | return err; |
249 | } | 240 | } |
250 | 241 | ||
@@ -257,16 +248,9 @@ static int __init oprofile_init(void) | |||
257 | printk(KERN_INFO "oprofile: using timer interrupt.\n"); | 248 | printk(KERN_INFO "oprofile: using timer interrupt.\n"); |
258 | err = oprofile_timer_init(&oprofile_ops); | 249 | err = oprofile_timer_init(&oprofile_ops); |
259 | if (err) | 250 | if (err) |
260 | goto out_arch; | 251 | return err; |
261 | } | 252 | } |
262 | err = oprofilefs_register(); | 253 | return oprofilefs_register(); |
263 | if (err) | ||
264 | goto out_arch; | ||
265 | return 0; | ||
266 | |||
267 | out_arch: | ||
268 | oprofile_arch_exit(); | ||
269 | return err; | ||
270 | } | 254 | } |
271 | 255 | ||
272 | 256 | ||