Skip to content

Commit

Permalink
oprofile: Rename variable timeout_jiffies and move to oprofile_files.c
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Robert Richter committed Jul 20, 2009
1 parent 2051cad commit afe1b50
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
9 changes: 4 additions & 5 deletions drivers/oprofile/oprof.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -102,7 +101,7 @@ int oprofile_setup(void)

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)
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -253,7 +252,7 @@ int oprofile_set_backtrace(unsigned long val)

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
Expand Down
3 changes: 2 additions & 1 deletion drivers/oprofile/oprof.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 3 additions & 2 deletions drivers/oprofile/oprofile_files.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@
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);
}


Expand Down

0 comments on commit afe1b50

Please sign in to comment.