Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 182277
b: refs/heads/master
c: 98a2e73
h: refs/heads/master
i:
  182275: c2467f2
v: v3
  • Loading branch information
Robert Richter committed Feb 26, 2010
1 parent 6e21a62 commit 8c312a7
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 3 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: ba52078e1917c5116c0802298d88ad0e54a6728b
refs/heads/master: 98a2e73a0690b3610f049a64154d8145e5771713
11 changes: 10 additions & 1 deletion trunk/arch/x86/oprofile/op_model_amd.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,18 @@ static void op_amd_setup_ctrs(struct op_x86_model_spec const *model,

/* clear all counters */
for (i = 0; i < NUM_CONTROLS; ++i) {
if (unlikely(!msrs->controls[i].addr))
if (unlikely(!msrs->controls[i].addr)) {
if (counter_config[i].enabled && !smp_processor_id())
/*
* counter is reserved, this is on all
* cpus, so report only for cpu #0
*/
op_x86_warn_reserved(i);
continue;
}
rdmsrl(msrs->controls[i].addr, val);
if (val & ARCH_PERFMON_EVENTSEL0_ENABLE)
op_x86_warn_in_use(i);
val &= model->reserved;
wrmsrl(msrs->controls[i].addr, val);
}
Expand Down
11 changes: 10 additions & 1 deletion trunk/arch/x86/oprofile/op_model_ppro.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,18 @@ static void ppro_setup_ctrs(struct op_x86_model_spec const *model,

/* clear all counters */
for (i = 0; i < num_counters; ++i) {
if (unlikely(!msrs->controls[i].addr))
if (unlikely(!msrs->controls[i].addr)) {
if (counter_config[i].enabled && !smp_processor_id())
/*
* counter is reserved, this is on all
* cpus, so report only for cpu #0
*/
op_x86_warn_reserved(i);
continue;
}
rdmsrl(msrs->controls[i].addr, val);
if (val & ARCH_PERFMON_EVENTSEL0_ENABLE)
op_x86_warn_in_use(i);
val &= model->reserved;
wrmsrl(msrs->controls[i].addr, val);
}
Expand Down
11 changes: 11 additions & 0 deletions trunk/arch/x86/oprofile/op_x86_model.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,17 @@ struct op_x86_model_spec {

struct op_counter_config;

static inline void op_x86_warn_in_use(int counter)
{
pr_warning("oprofile: counter #%d on cpu #%d may already be used\n",
counter, smp_processor_id());
}

static inline void op_x86_warn_reserved(int counter)
{
pr_warning("oprofile: counter #%d is already reserved\n", counter);
}

extern u64 op_x86_get_ctrl(struct op_x86_model_spec const *model,
struct op_counter_config *counter_config);
extern int op_x86_phys_to_virt(int phys);
Expand Down

0 comments on commit 8c312a7

Please sign in to comment.