diff options
| -rw-r--r-- | drivers/oprofile/oprof.c | 9 | ||||
| -rw-r--r-- | drivers/oprofile/oprof.h | 3 | ||||
| -rw-r--r-- | drivers/oprofile/oprofile_files.c | 5 |
3 files changed, 9 insertions, 8 deletions
diff --git a/drivers/oprofile/oprof.c b/drivers/oprofile/oprof.c index 42c9c765f9f1..2b33de716412 100644 --- a/drivers/oprofile/oprof.c +++ b/drivers/oprofile/oprof.c | |||
| @@ -33,8 +33,7 @@ static DEFINE_MUTEX(start_mutex); | |||
| 33 | 33 | ||
| 34 | static void switch_worker(struct work_struct *work); | 34 | static void switch_worker(struct work_struct *work); |
| 35 | static DECLARE_DELAYED_WORK(switch_work, switch_worker); | 35 | static DECLARE_DELAYED_WORK(switch_work, switch_worker); |
| 36 | unsigned long timeout_jiffies; | 36 | #define TIME_SLICE_DEFAULT 1 |
| 37 | #define MULTIPLEXING_TIMER_DEFAULT 1 | ||
| 38 | 37 | ||
| 39 | #endif | 38 | #endif |
| 40 | 39 | ||
| @@ -102,7 +101,7 @@ out: | |||
| 102 | 101 | ||
| 103 | static void start_switch_worker(void) | 102 | static void start_switch_worker(void) |
| 104 | { | 103 | { |
| 105 | schedule_delayed_work(&switch_work, timeout_jiffies); | 104 | schedule_delayed_work(&switch_work, oprofile_time_slice); |
| 106 | } | 105 | } |
| 107 | 106 | ||
| 108 | static void switch_worker(struct work_struct *work) | 107 | static void switch_worker(struct work_struct *work) |
| @@ -216,7 +215,7 @@ int oprofile_set_timeout(unsigned long val_msec) | |||
| 216 | goto out; | 215 | goto out; |
| 217 | } | 216 | } |
| 218 | 217 | ||
| 219 | timeout_jiffies = time_slice; | 218 | oprofile_time_slice = time_slice; |
| 220 | 219 | ||
| 221 | out: | 220 | out: |
| 222 | mutex_unlock(&start_mutex); | 221 | mutex_unlock(&start_mutex); |
| @@ -253,7 +252,7 @@ out: | |||
| 253 | 252 | ||
| 254 | static void __init oprofile_multiplexing_init(void) | 253 | static void __init oprofile_multiplexing_init(void) |
| 255 | { | 254 | { |
| 256 | timeout_jiffies = msecs_to_jiffies(MULTIPLEXING_TIMER_DEFAULT); | 255 | oprofile_time_slice = msecs_to_jiffies(TIME_SLICE_DEFAULT); |
| 257 | } | 256 | } |
| 258 | 257 | ||
| 259 | #endif | 258 | #endif |
diff --git a/drivers/oprofile/oprof.h b/drivers/oprofile/oprof.h index ee38abcc74f3..cb92f5c98c1a 100644 --- a/drivers/oprofile/oprof.h +++ b/drivers/oprofile/oprof.h | |||
| @@ -24,10 +24,11 @@ struct oprofile_operations; | |||
| 24 | extern unsigned long oprofile_buffer_size; | 24 | extern unsigned long oprofile_buffer_size; |
| 25 | extern unsigned long oprofile_cpu_buffer_size; | 25 | extern unsigned long oprofile_cpu_buffer_size; |
| 26 | extern unsigned long oprofile_buffer_watershed; | 26 | extern unsigned long oprofile_buffer_watershed; |
| 27 | extern unsigned long oprofile_time_slice; | ||
| 28 | |||
| 27 | extern struct oprofile_operations oprofile_ops; | 29 | extern struct oprofile_operations oprofile_ops; |
| 28 | extern unsigned long oprofile_started; | 30 | extern unsigned long oprofile_started; |
| 29 | extern unsigned long oprofile_backtrace_depth; | 31 | extern unsigned long oprofile_backtrace_depth; |
| 30 | extern unsigned long timeout_jiffies; | ||
| 31 | 32 | ||
| 32 | struct super_block; | 33 | struct super_block; |
| 33 | struct dentry; | 34 | struct dentry; |
diff --git a/drivers/oprofile/oprofile_files.c b/drivers/oprofile/oprofile_files.c index 468ec3e4f856..4c5b94775844 100644 --- a/drivers/oprofile/oprofile_files.c +++ b/drivers/oprofile/oprofile_files.c | |||
| @@ -22,14 +22,15 @@ | |||
| 22 | unsigned long oprofile_buffer_size; | 22 | unsigned long oprofile_buffer_size; |
| 23 | unsigned long oprofile_cpu_buffer_size; | 23 | unsigned long oprofile_cpu_buffer_size; |
| 24 | unsigned long oprofile_buffer_watershed; | 24 | unsigned long oprofile_buffer_watershed; |
| 25 | unsigned long oprofile_time_slice; | ||
| 25 | 26 | ||
| 26 | #ifdef CONFIG_OPROFILE_EVENT_MULTIPLEX | 27 | #ifdef CONFIG_OPROFILE_EVENT_MULTIPLEX |
| 27 | 28 | ||
| 28 | static ssize_t timeout_read(struct file *file, char __user *buf, | 29 | static ssize_t timeout_read(struct file *file, char __user *buf, |
| 29 | size_t count, loff_t *offset) | 30 | size_t count, loff_t *offset) |
| 30 | { | 31 | { |
| 31 | return oprofilefs_ulong_to_user(jiffies_to_msecs(timeout_jiffies), | 32 | return oprofilefs_ulong_to_user(jiffies_to_msecs(oprofile_time_slice), |
| 32 | buf, count, offset); | 33 | buf, count, offset); |
| 33 | } | 34 | } |
| 34 | 35 | ||
| 35 | 36 | ||
