Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 158234
b: refs/heads/master
c: 48fb4b4
h: refs/heads/master
v: v3
  • Loading branch information
Robert Richter committed Jul 20, 2009
1 parent 86ea220 commit f237f81
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 27 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: 6ab82f958a5dca591a6ea17a3ca6f2aca06f4f2f
refs/heads/master: 48fb4b46712c7d3e8adc79826311abd9ccbf7f1d
45 changes: 19 additions & 26 deletions trunk/arch/x86/oprofile/nmi_int.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,30 @@ static int nmi_setup_mux(void)
return 1;
}

static void nmi_cpu_setup_mux(int cpu, struct op_msrs const * const msrs)
{
int i;
struct op_msr *multiplex = msrs->multiplex;

for (i = 0; i < model->num_virt_counters; ++i) {
if (counter_config[i].enabled) {
multiplex[i].saved = -(u64)counter_config[i].count;
} else {
multiplex[i].addr = 0;
multiplex[i].saved = 0;
}
}

per_cpu(switch_index, cpu) = 0;
}

#else

inline int op_x86_phys_to_virt(int phys) { return phys; }
static inline void nmi_shutdown_mux(void) { }
static inline int nmi_setup_mux(void) { return 1; }
static inline void
nmi_cpu_setup_mux(int cpu, struct op_msrs const * const msrs) { }

#endif

Expand Down Expand Up @@ -169,32 +188,6 @@ static int allocate_msrs(void)
return 1;
}

#ifdef CONFIG_OPROFILE_EVENT_MULTIPLEX

static void nmi_cpu_setup_mux(int cpu, struct op_msrs const * const msrs)
{
int i;
struct op_msr *multiplex = msrs->multiplex;

for (i = 0; i < model->num_virt_counters; ++i) {
if (counter_config[i].enabled) {
multiplex[i].saved = -(u64)counter_config[i].count;
} else {
multiplex[i].addr = 0;
multiplex[i].saved = 0;
}
}

per_cpu(switch_index, cpu) = 0;
}

#else

static inline void
nmi_cpu_setup_mux(int cpu, struct op_msrs const * const msrs) { }

#endif

static void nmi_cpu_setup(void *dummy)
{
int cpu = smp_processor_id();
Expand Down

0 comments on commit f237f81

Please sign in to comment.