diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-12-23 06:28:12 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-12-23 06:45:20 -0500 |
commit | 0dff86aa7b9ec65a6d07167b7afb050b5fc98ddc (patch) | |
tree | 1062c2198370b9b50094f6ad406dedcec8a41b36 /arch/x86/kernel/cpu/perf_counter.c | |
parent | 95cdd2e7851cce79ab839cb0b3cbe68d7911d0f1 (diff) |
x86, perfcounters: print out the ->used bitmask
Impact: extend debug printouts
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/cpu/perf_counter.c')
-rw-r--r-- | arch/x86/kernel/cpu/perf_counter.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/x86/kernel/cpu/perf_counter.c b/arch/x86/kernel/cpu/perf_counter.c index 74090a393a7c..f3359c2b3910 100644 --- a/arch/x86/kernel/cpu/perf_counter.c +++ b/arch/x86/kernel/cpu/perf_counter.c | |||
@@ -255,6 +255,7 @@ static int pmc_generic_enable(struct perf_counter *counter) | |||
255 | idx = find_first_zero_bit(cpuc->used, nr_counters_generic); | 255 | idx = find_first_zero_bit(cpuc->used, nr_counters_generic); |
256 | if (idx == nr_counters_generic) | 256 | if (idx == nr_counters_generic) |
257 | return -EAGAIN; | 257 | return -EAGAIN; |
258 | |||
258 | set_bit(idx, cpuc->used); | 259 | set_bit(idx, cpuc->used); |
259 | hwc->idx = idx; | 260 | hwc->idx = idx; |
260 | } | 261 | } |
@@ -274,6 +275,7 @@ static int pmc_generic_enable(struct perf_counter *counter) | |||
274 | void perf_counter_print_debug(void) | 275 | void perf_counter_print_debug(void) |
275 | { | 276 | { |
276 | u64 ctrl, status, overflow, pmc_ctrl, pmc_count, prev_left; | 277 | u64 ctrl, status, overflow, pmc_ctrl, pmc_count, prev_left; |
278 | struct cpu_hw_counters *cpuc; | ||
277 | int cpu, idx; | 279 | int cpu, idx; |
278 | 280 | ||
279 | if (!nr_counters_generic) | 281 | if (!nr_counters_generic) |
@@ -282,6 +284,7 @@ void perf_counter_print_debug(void) | |||
282 | local_irq_disable(); | 284 | local_irq_disable(); |
283 | 285 | ||
284 | cpu = smp_processor_id(); | 286 | cpu = smp_processor_id(); |
287 | cpuc = &per_cpu(cpu_hw_counters, cpu); | ||
285 | 288 | ||
286 | rdmsrl(MSR_CORE_PERF_GLOBAL_CTRL, ctrl); | 289 | rdmsrl(MSR_CORE_PERF_GLOBAL_CTRL, ctrl); |
287 | rdmsrl(MSR_CORE_PERF_GLOBAL_STATUS, status); | 290 | rdmsrl(MSR_CORE_PERF_GLOBAL_STATUS, status); |
@@ -291,6 +294,7 @@ void perf_counter_print_debug(void) | |||
291 | printk(KERN_INFO "CPU#%d: ctrl: %016llx\n", cpu, ctrl); | 294 | printk(KERN_INFO "CPU#%d: ctrl: %016llx\n", cpu, ctrl); |
292 | printk(KERN_INFO "CPU#%d: status: %016llx\n", cpu, status); | 295 | printk(KERN_INFO "CPU#%d: status: %016llx\n", cpu, status); |
293 | printk(KERN_INFO "CPU#%d: overflow: %016llx\n", cpu, overflow); | 296 | printk(KERN_INFO "CPU#%d: overflow: %016llx\n", cpu, overflow); |
297 | printk(KERN_INFO "CPU#%d: used: %016llx\n", cpu, *(u64 *)cpuc->used); | ||
294 | 298 | ||
295 | for (idx = 0; idx < nr_counters_generic; idx++) { | 299 | for (idx = 0; idx < nr_counters_generic; idx++) { |
296 | rdmsrl(MSR_ARCH_PERFMON_EVENTSEL0 + idx, pmc_ctrl); | 300 | rdmsrl(MSR_ARCH_PERFMON_EVENTSEL0 + idx, pmc_ctrl); |