Skip to content

Commit 879d927

Browse files
Christoph Lameterhtejun
authored andcommitted
drivers/oprofile: Replace __get_cpu_var uses for address calculation
Replace the uses of __get_cpu_var for address calculation with this_cpu_ptr. Cc: Robert Richter <rric@kernel.org> Cc: oprofile-list@lists.sf.net Signed-off-by: Christoph Lameter <cl@linux.com> Signed-off-by: Tejun Heo <tj@kernel.org>
1 parent 229b686 commit 879d927

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

drivers/oprofile/cpu_buffer.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ unsigned long oprofile_get_cpu_buffer_size(void)
4545

4646
void oprofile_cpu_buffer_inc_smpl_lost(void)
4747
{
48-
struct oprofile_cpu_buffer *cpu_buf = &__get_cpu_var(op_cpu_buffer);
48+
struct oprofile_cpu_buffer *cpu_buf = this_cpu_ptr(&op_cpu_buffer);
4949

5050
cpu_buf->sample_lost_overflow++;
5151
}
@@ -297,7 +297,7 @@ __oprofile_add_ext_sample(unsigned long pc, struct pt_regs * const regs,
297297
unsigned long event, int is_kernel,
298298
struct task_struct *task)
299299
{
300-
struct oprofile_cpu_buffer *cpu_buf = &__get_cpu_var(op_cpu_buffer);
300+
struct oprofile_cpu_buffer *cpu_buf = this_cpu_ptr(&op_cpu_buffer);
301301
unsigned long backtrace = oprofile_backtrace_depth;
302302

303303
/*
@@ -357,7 +357,7 @@ oprofile_write_reserve(struct op_entry *entry, struct pt_regs * const regs,
357357
{
358358
struct op_sample *sample;
359359
int is_kernel = !user_mode(regs);
360-
struct oprofile_cpu_buffer *cpu_buf = &__get_cpu_var(op_cpu_buffer);
360+
struct oprofile_cpu_buffer *cpu_buf = this_cpu_ptr(&op_cpu_buffer);
361361

362362
cpu_buf->sample_received++;
363363

@@ -412,13 +412,13 @@ int oprofile_write_commit(struct op_entry *entry)
412412

413413
void oprofile_add_pc(unsigned long pc, int is_kernel, unsigned long event)
414414
{
415-
struct oprofile_cpu_buffer *cpu_buf = &__get_cpu_var(op_cpu_buffer);
415+
struct oprofile_cpu_buffer *cpu_buf = this_cpu_ptr(&op_cpu_buffer);
416416
log_sample(cpu_buf, pc, 0, is_kernel, event, NULL);
417417
}
418418

419419
void oprofile_add_trace(unsigned long pc)
420420
{
421-
struct oprofile_cpu_buffer *cpu_buf = &__get_cpu_var(op_cpu_buffer);
421+
struct oprofile_cpu_buffer *cpu_buf = this_cpu_ptr(&op_cpu_buffer);
422422

423423
if (!cpu_buf->tracing)
424424
return;

drivers/oprofile/timer_int.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ static enum hrtimer_restart oprofile_hrtimer_notify(struct hrtimer *hrtimer)
3232

3333
static void __oprofile_hrtimer_start(void *unused)
3434
{
35-
struct hrtimer *hrtimer = &__get_cpu_var(oprofile_hrtimer);
35+
struct hrtimer *hrtimer = this_cpu_ptr(&oprofile_hrtimer);
3636

3737
if (!ctr_running)
3838
return;

0 commit comments

Comments
 (0)