oprofile: Rename variable timeout_jiffies and move to oprofile_files.c
authorRobert Richter <robert.richter@amd.com>
Wed, 15 Jul 2009 13:19:29 +0000 (15:19 +0200)
committerRobert Richter <robert.richter@amd.com>
Mon, 20 Jul 2009 14:43:19 +0000 (16:43 +0200)
This patch renames timeout_jiffies into an oprofile specific name. The
macro MULTIPLEXING_TIMER_DEFAULT is changed too.

Also, since this variable is controlled using oprofilefs, its
definition is moved to oprofile_files.c.

Signed-off-by: Robert Richter <robert.richter@amd.com>
drivers/oprofile/oprof.c
drivers/oprofile/oprof.h
drivers/oprofile/oprofile_files.c

index 42c9c765f9f16bfe49b7d34905f95b933dda47ef..2b33de7164123956b852461510a2901df376f17e 100644 (file)
@@ -33,8 +33,7 @@ static DEFINE_MUTEX(start_mutex);
 
 static void switch_worker(struct work_struct *work);
 static DECLARE_DELAYED_WORK(switch_work, switch_worker);
-unsigned long timeout_jiffies;
-#define MULTIPLEXING_TIMER_DEFAULT 1
+#define TIME_SLICE_DEFAULT             1
 
 #endif
 
@@ -102,7 +101,7 @@ out:
 
 static void start_switch_worker(void)
 {
-       schedule_delayed_work(&switch_work, timeout_jiffies);
+       schedule_delayed_work(&switch_work, oprofile_time_slice);
 }
 
 static void switch_worker(struct work_struct *work)
@@ -216,7 +215,7 @@ int oprofile_set_timeout(unsigned long val_msec)
                goto out;
        }
 
-       timeout_jiffies = time_slice;
+       oprofile_time_slice = time_slice;
 
 out:
        mutex_unlock(&start_mutex);
@@ -253,7 +252,7 @@ out:
 
 static void __init oprofile_multiplexing_init(void)
 {
-       timeout_jiffies = msecs_to_jiffies(MULTIPLEXING_TIMER_DEFAULT);
+       oprofile_time_slice = msecs_to_jiffies(TIME_SLICE_DEFAULT);
 }
 
 #endif
index ee38abcc74f390bd5b6da4dc1a7fc7c78761114a..cb92f5c98c1abc2f4207b94ce205b6c6848ee3cd 100644 (file)
@@ -24,10 +24,11 @@ struct oprofile_operations;
 extern unsigned long oprofile_buffer_size;
 extern unsigned long oprofile_cpu_buffer_size;
 extern unsigned long oprofile_buffer_watershed;
+extern unsigned long oprofile_time_slice;
+
 extern struct oprofile_operations oprofile_ops;
 extern unsigned long oprofile_started;
 extern unsigned long oprofile_backtrace_depth;
-extern unsigned long timeout_jiffies;
 
 struct super_block;
 struct dentry;
index 468ec3e4f8568f676adc7d4c54bd3f0c5dbc36e4..4c5b9477584441c4e23315de24e95242a911e968 100644 (file)
 unsigned long oprofile_buffer_size;
 unsigned long oprofile_cpu_buffer_size;
 unsigned long oprofile_buffer_watershed;
+unsigned long oprofile_time_slice;
 
 #ifdef CONFIG_OPROFILE_EVENT_MULTIPLEX
 
 static ssize_t timeout_read(struct file *file, char __user *buf,
                size_t count, loff_t *offset)
 {
-       return oprofilefs_ulong_to_user(jiffies_to_msecs(timeout_jiffies),
-                               buf, count, offset);
+       return oprofilefs_ulong_to_user(jiffies_to_msecs(oprofile_time_slice),
+                                       buf, count, offset);
 }