diff options
author | Robert Richter <robert.richter@amd.com> | 2009-06-12 11:58:48 -0400 |
---|---|---|
committer | Robert Richter <robert.richter@amd.com> | 2009-06-12 11:58:48 -0400 |
commit | 1241eb8f136bf3ea409f61590e7663465906d158 (patch) | |
tree | c8384237f19bb1094d9c90825a74e28393b60d00 /arch/x86/oprofile | |
parent | 51563a0e5650d0d76539625388d72d62b34c726e (diff) | |
parent | 940010c5a314a7bd9b498593bc6ba1718ac5aec5 (diff) |
Merge commit 'tip/perfcounters-for-linus' into oprofile/master
Conflicts:
arch/x86/oprofile/op_model_ppro.c
Signed-off-by: Robert Richter <robert.richter@amd.com>
Diffstat (limited to 'arch/x86/oprofile')
-rw-r--r-- | arch/x86/oprofile/nmi_int.c | 7 | ||||
-rw-r--r-- | arch/x86/oprofile/op_model_ppro.c | 8 | ||||
-rw-r--r-- | arch/x86/oprofile/op_x86_model.h | 2 |
3 files changed, 13 insertions, 4 deletions
diff --git a/arch/x86/oprofile/nmi_int.c b/arch/x86/oprofile/nmi_int.c index 80b63d5db509..7826dfcc8428 100644 --- a/arch/x86/oprofile/nmi_int.c +++ b/arch/x86/oprofile/nmi_int.c | |||
@@ -60,8 +60,9 @@ static int profile_exceptions_notify(struct notifier_block *self, | |||
60 | 60 | ||
61 | switch (val) { | 61 | switch (val) { |
62 | case DIE_NMI: | 62 | case DIE_NMI: |
63 | if (model->check_ctrs(args->regs, &per_cpu(cpu_msrs, cpu))) | 63 | case DIE_NMI_IPI: |
64 | ret = NOTIFY_STOP; | 64 | model->check_ctrs(args->regs, &per_cpu(cpu_msrs, cpu)); |
65 | ret = NOTIFY_STOP; | ||
65 | break; | 66 | break; |
66 | default: | 67 | default: |
67 | break; | 68 | break; |
@@ -146,7 +147,7 @@ static void nmi_cpu_setup(void *dummy) | |||
146 | static struct notifier_block profile_exceptions_nb = { | 147 | static struct notifier_block profile_exceptions_nb = { |
147 | .notifier_call = profile_exceptions_notify, | 148 | .notifier_call = profile_exceptions_notify, |
148 | .next = NULL, | 149 | .next = NULL, |
149 | .priority = 0 | 150 | .priority = 2 |
150 | }; | 151 | }; |
151 | 152 | ||
152 | static int nmi_setup(void) | 153 | static int nmi_setup(void) |
diff --git a/arch/x86/oprofile/op_model_ppro.c b/arch/x86/oprofile/op_model_ppro.c index 0a261a5c696e..cd72d5c73b49 100644 --- a/arch/x86/oprofile/op_model_ppro.c +++ b/arch/x86/oprofile/op_model_ppro.c | |||
@@ -118,6 +118,13 @@ static int ppro_check_ctrs(struct pt_regs * const regs, | |||
118 | u64 val; | 118 | u64 val; |
119 | int i; | 119 | int i; |
120 | 120 | ||
121 | /* | ||
122 | * This can happen if perf counters are in use when | ||
123 | * we steal the die notifier NMI. | ||
124 | */ | ||
125 | if (unlikely(!reset_value)) | ||
126 | goto out; | ||
127 | |||
121 | for (i = 0 ; i < num_counters; ++i) { | 128 | for (i = 0 ; i < num_counters; ++i) { |
122 | if (!reset_value[i]) | 129 | if (!reset_value[i]) |
123 | continue; | 130 | continue; |
@@ -128,6 +135,7 @@ static int ppro_check_ctrs(struct pt_regs * const regs, | |||
128 | wrmsrl(msrs->counters[i].addr, -reset_value[i]); | 135 | wrmsrl(msrs->counters[i].addr, -reset_value[i]); |
129 | } | 136 | } |
130 | 137 | ||
138 | out: | ||
131 | /* Only P6 based Pentium M need to re-unmask the apic vector but it | 139 | /* Only P6 based Pentium M need to re-unmask the apic vector but it |
132 | * doesn't hurt other P6 variant */ | 140 | * doesn't hurt other P6 variant */ |
133 | apic_write(APIC_LVTPC, apic_read(APIC_LVTPC) & ~APIC_LVT_MASKED); | 141 | apic_write(APIC_LVTPC, apic_read(APIC_LVTPC) & ~APIC_LVT_MASKED); |
diff --git a/arch/x86/oprofile/op_x86_model.h b/arch/x86/oprofile/op_x86_model.h index fda52b4c1b95..505489873b9d 100644 --- a/arch/x86/oprofile/op_x86_model.h +++ b/arch/x86/oprofile/op_x86_model.h | |||
@@ -13,7 +13,7 @@ | |||
13 | #define OP_X86_MODEL_H | 13 | #define OP_X86_MODEL_H |
14 | 14 | ||
15 | #include <asm/types.h> | 15 | #include <asm/types.h> |
16 | #include <asm/intel_arch_perfmon.h> | 16 | #include <asm/perf_counter.h> |
17 | 17 | ||
18 | struct op_msr { | 18 | struct op_msr { |
19 | unsigned long addr; | 19 | unsigned long addr; |