Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 158191
b: refs/heads/master
c: e419294
h: refs/heads/master
i:
  158189: aff1fae
  158187: 888ca28
  158183: 063e138
  158175: 77c8a5f
v: v3
  • Loading branch information
Robert Richter committed Jun 10, 2009
1 parent c58502e commit 470f0a4
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 16 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: 849620fab413355eff48232eac5a8c53c57615c5
refs/heads/master: e419294ed3c98cccc145202e4fe165bfd8099d63
21 changes: 9 additions & 12 deletions trunk/arch/x86/oprofile/nmi_int.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ static int __init ppro_init(char **cpu_type)
*cpu_type = "i386/core_2";
break;
case 26:
arch_perfmon_setup_counters();
model = &op_arch_perfmon_spec;
*cpu_type = "i386/core_i7";
break;
case 28:
Expand All @@ -442,16 +442,6 @@ static int __init ppro_init(char **cpu_type)
return 1;
}

static int __init arch_perfmon_init(char **cpu_type)
{
if (!cpu_has_arch_perfmon)
return 0;
*cpu_type = "i386/arch_perfmon";
model = &op_arch_perfmon_spec;
arch_perfmon_setup_counters();
return 1;
}

/* in order to get sysfs right */
static int using_nmi;

Expand Down Expand Up @@ -509,8 +499,15 @@ int __init op_nmi_init(struct oprofile_operations *ops)
break;
}

if (!cpu_type && !arch_perfmon_init(&cpu_type))
if (cpu_type)
break;

if (!cpu_has_arch_perfmon)
return -ENODEV;

/* use arch perfmon as fallback */
cpu_type = "i386/arch_perfmon";
model = &op_arch_perfmon_spec;
break;

default:
Expand Down
9 changes: 8 additions & 1 deletion trunk/arch/x86/oprofile/op_model_ppro.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ struct op_x86_model_spec const op_ppro_spec = {
* the specific CPU.
*/

void arch_perfmon_setup_counters(void)
static void arch_perfmon_setup_counters(void)
{
union cpuid10_eax eax;

Expand All @@ -253,7 +253,14 @@ void arch_perfmon_setup_counters(void)
op_arch_perfmon_spec.num_controls = num_counters;
}

static int arch_perfmon_init(struct oprofile_operations *ignore)
{
arch_perfmon_setup_counters();
return 0;
}

struct op_x86_model_spec op_arch_perfmon_spec = {
.init = &arch_perfmon_init,
/* num_counters/num_controls filled in at runtime */
.fill_in_addresses = &ppro_fill_in_addresses,
/* user space does the cpuid check for available events */
Expand Down
2 changes: 0 additions & 2 deletions trunk/arch/x86/oprofile/op_x86_model.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,4 @@ extern struct op_x86_model_spec const op_p4_ht2_spec;
extern struct op_x86_model_spec const op_amd_spec;
extern struct op_x86_model_spec op_arch_perfmon_spec;

extern void arch_perfmon_setup_counters(void);

#endif /* OP_X86_MODEL_H */

0 comments on commit 470f0a4

Please sign in to comment.