Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 158307
b: refs/heads/master
c: 596da17
h: refs/heads/master
i:
  158305: 5ccb3bb
  158303: 0809c0f
v: v3
  • Loading branch information
markus.t.metzger@intel.com authored and Ingo Molnar committed Sep 4, 2009
1 parent 3ac1c2a commit 94e3020
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 747b50aaf728987732e6ff3ba10aba4acc4e0277
refs/heads/master: 596da17f94c103348ebe04129c00d536ea0e80e2
24 changes: 12 additions & 12 deletions trunk/arch/x86/kernel/cpu/perf_counter.c
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,8 @@ static inline void init_debug_store_on_cpu(int cpu)
return;

wrmsr_on_cpu(cpu, MSR_IA32_DS_AREA,
(u32)((u64)(long)ds), (u32)((u64)(long)ds >> 32));
(u32)((u64)(unsigned long)ds),
(u32)((u64)(unsigned long)ds >> 32));
}

static inline void fini_debug_store_on_cpu(int cpu)
Expand Down Expand Up @@ -757,7 +758,7 @@ static void release_bts_hardware(void)

per_cpu(cpu_hw_counters, cpu).ds = NULL;

kfree((void *)(long)ds->bts_buffer_base);
kfree((void *)(unsigned long)ds->bts_buffer_base);
kfree(ds);
}

Expand Down Expand Up @@ -788,7 +789,7 @@ static int reserve_bts_hardware(void)
break;
}

ds->bts_buffer_base = (u64)(long)buffer;
ds->bts_buffer_base = (u64)(unsigned long)buffer;
ds->bts_index = ds->bts_buffer_base;
ds->bts_absolute_maximum =
ds->bts_buffer_base + BTS_BUFFER_SIZE;
Expand Down Expand Up @@ -1491,27 +1492,26 @@ static void intel_pmu_drain_bts_buffer(struct cpu_hw_counters *cpuc,
};
struct perf_counter *counter = cpuc->counters[X86_PMC_IDX_FIXED_BTS];
unsigned long orig_ip = data->regs->ip;
u64 at;
struct bts_record *at, *top;

if (!counter)
return;

if (!ds)
return;

for (at = ds->bts_buffer_base;
at < ds->bts_index;
at += sizeof(struct bts_record)) {
struct bts_record *rec = (struct bts_record *)(long)at;
at = (struct bts_record *)(unsigned long)ds->bts_buffer_base;
top = (struct bts_record *)(unsigned long)ds->bts_index;

data->regs->ip = rec->from;
data->addr = rec->to;
ds->bts_index = ds->bts_buffer_base;

for (; at < top; at++) {
data->regs->ip = at->from;
data->addr = at->to;

perf_counter_output(counter, 1, data);
}

ds->bts_index = ds->bts_buffer_base;

data->regs->ip = orig_ip;
data->addr = 0;

Expand Down

0 comments on commit 94e3020

Please sign in to comment.