public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/perf_count: update x86_pmu after WARN
@ 2009-06-28 21:03 Yinghai Lu
  2009-06-28 21:04 ` [PATCH] x86/perf_count: make perf_count_mask to local Yinghai Lu
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Yinghai Lu @ 2009-06-28 21:03 UTC (permalink / raw)
  To: Ingo Molnar, Peter Zijlstra; +Cc: linux-kernel@vger.kernel.org


should print out before changing the value

[Impact: get right print when clipping num_conunters]

Signed-off-by: Yinghai Lu <yinghai@kernel.org>

---
 arch/x86/kernel/cpu/perf_counter.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: linux-2.6/arch/x86/kernel/cpu/perf_counter.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/cpu/perf_counter.c
+++ linux-2.6/arch/x86/kernel/cpu/perf_counter.c
@@ -1496,17 +1496,17 @@ void __init init_hw_perf_counters(void)
     pr_cont("%s PMU driver.\n", x86_pmu.name);
 
     if (x86_pmu.num_counters > X86_PMC_MAX_GENERIC) {
-        x86_pmu.num_counters = X86_PMC_MAX_GENERIC;
         WARN(1, KERN_ERR "hw perf counters %d > max(%d), clipping!",
              x86_pmu.num_counters, X86_PMC_MAX_GENERIC);
+        x86_pmu.num_counters = X86_PMC_MAX_GENERIC;
     }
     perf_counter_mask = (1 << x86_pmu.num_counters) - 1;
     perf_max_counters = x86_pmu.num_counters;
 
     if (x86_pmu.num_counters_fixed > X86_PMC_MAX_FIXED) {
-        x86_pmu.num_counters_fixed = X86_PMC_MAX_FIXED;
         WARN(1, KERN_ERR "hw perf counters fixed %d > max(%d), clipping!",
              x86_pmu.num_counters_fixed, X86_PMC_MAX_FIXED);
+        x86_pmu.num_counters_fixed = X86_PMC_MAX_FIXED;
     }
 
     perf_counter_mask |=

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] x86/perf_count: make perf_count_mask to local
  2009-06-28 21:03 [PATCH] x86/perf_count: update x86_pmu after WARN Yinghai Lu
@ 2009-06-28 21:04 ` Yinghai Lu
  2009-06-28 21:04 ` [PATCH] x86/perf_count: change intel_pmu and amd_pmu to initdata Yinghai Lu
  2009-06-29  7:41 ` [RESEND PATCH] x86/perf_count: update x86_pmu after WARN Yinghai Lu
  2 siblings, 0 replies; 5+ messages in thread
From: Yinghai Lu @ 2009-06-28 21:04 UTC (permalink / raw)
  To: Ingo Molnar, Peter Zijlstra; +Cc: linux-kernel@vger.kernel.org


only used in init_hw_per_counters

[Impact: cleanup]

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
---
 arch/x86/kernel/cpu/perf_counter.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Index: linux-2.6/arch/x86/kernel/cpu/perf_counter.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/cpu/perf_counter.c
+++ linux-2.6/arch/x86/kernel/cpu/perf_counter.c
@@ -25,8 +25,6 @@
 #include <asm/stacktrace.h>
 #include <asm/nmi.h>
 
-static u64 perf_counter_mask __read_mostly;
-
 struct cpu_hw_counters {
 	struct perf_counter	*counters[X86_PMC_IDX_MAX];
 	unsigned long		used_mask[BITS_TO_LONGS(X86_PMC_IDX_MAX)];
@@ -1474,6 +1472,7 @@ static int amd_pmu_init(void)
 
 void __init init_hw_perf_counters(void)
 {
+	u64 perf_counter_mask;
 	int err;
 
 	pr_info("Performance Counters: ");

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] x86/perf_count: change intel_pmu and amd_pmu to initdata
  2009-06-28 21:03 [PATCH] x86/perf_count: update x86_pmu after WARN Yinghai Lu
  2009-06-28 21:04 ` [PATCH] x86/perf_count: make perf_count_mask to local Yinghai Lu
@ 2009-06-28 21:04 ` Yinghai Lu
  2009-06-29  7:41 ` [RESEND PATCH] x86/perf_count: update x86_pmu after WARN Yinghai Lu
  2 siblings, 0 replies; 5+ messages in thread
From: Yinghai Lu @ 2009-06-28 21:04 UTC (permalink / raw)
  To: Ingo Molnar, Peter Zijlstra; +Cc: linux-kernel@vger.kernel.org


it is assigned to x86_pmu aka copied to x86_pmu
so change it to __initdata

[Impact: cleanup]

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
---
 arch/x86/kernel/cpu/perf_counter.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: linux-2.6/arch/x86/kernel/cpu/perf_counter.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/cpu/perf_counter.c
+++ linux-2.6/arch/x86/kernel/cpu/perf_counter.c
@@ -1351,7 +1351,7 @@ static __read_mostly struct notifier_blo
 	.priority		= 1
 };
 
-static struct x86_pmu intel_pmu = {
+static __initdata struct x86_pmu intel_pmu = {
 	.name			= "Intel",
 	.handle_irq		= intel_pmu_handle_irq,
 	.disable_all		= intel_pmu_disable_all,
@@ -1371,7 +1371,7 @@ static struct x86_pmu intel_pmu = {
 	.max_period		= (1ULL << 31) - 1,
 };
 
-static struct x86_pmu amd_pmu = {
+static __initdata struct x86_pmu amd_pmu = {
 	.name			= "AMD",
 	.handle_irq		= amd_pmu_handle_irq,
 	.disable_all		= amd_pmu_disable_all,

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [RESEND PATCH] x86/perf_count: update x86_pmu after WARN
  2009-06-28 21:03 [PATCH] x86/perf_count: update x86_pmu after WARN Yinghai Lu
  2009-06-28 21:04 ` [PATCH] x86/perf_count: make perf_count_mask to local Yinghai Lu
  2009-06-28 21:04 ` [PATCH] x86/perf_count: change intel_pmu and amd_pmu to initdata Yinghai Lu
@ 2009-06-29  7:41 ` Yinghai Lu
  2009-06-29  8:21   ` [tip:perfcounters/urgent] perf_counter, x86: Update x86_pmu after WARN() tip-bot for Yinghai Lu
  2 siblings, 1 reply; 5+ messages in thread
From: Yinghai Lu @ 2009-06-29  7:41 UTC (permalink / raw)
  To: Ingo Molnar, Peter Zijlstra; +Cc: linux-kernel@vger.kernel.org


should print out before changing the value

[Impact: get right print when clipping num_conunters]

Signed-off-by: Yinghai Lu <yinghai@kernel.org>

---
 arch/x86/kernel/cpu/perf_counter.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: linux-2.6/arch/x86/kernel/cpu/perf_counter.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/cpu/perf_counter.c
+++ linux-2.6/arch/x86/kernel/cpu/perf_counter.c
@@ -1496,17 +1496,17 @@ void __init init_hw_perf_counters(void)
 	pr_cont("%s PMU driver.\n", x86_pmu.name);
 
 	if (x86_pmu.num_counters > X86_PMC_MAX_GENERIC) {
-		x86_pmu.num_counters = X86_PMC_MAX_GENERIC;
 		WARN(1, KERN_ERR "hw perf counters %d > max(%d), clipping!",
 		     x86_pmu.num_counters, X86_PMC_MAX_GENERIC);
+		x86_pmu.num_counters = X86_PMC_MAX_GENERIC;
 	}
 	perf_counter_mask = (1 << x86_pmu.num_counters) - 1;
 	perf_max_counters = x86_pmu.num_counters;
 
 	if (x86_pmu.num_counters_fixed > X86_PMC_MAX_FIXED) {
-		x86_pmu.num_counters_fixed = X86_PMC_MAX_FIXED;
 		WARN(1, KERN_ERR "hw perf counters fixed %d > max(%d), clipping!",
 		     x86_pmu.num_counters_fixed, X86_PMC_MAX_FIXED);
+		x86_pmu.num_counters_fixed = X86_PMC_MAX_FIXED;
 	}
 
 	perf_counter_mask |=

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [tip:perfcounters/urgent] perf_counter, x86: Update x86_pmu after WARN()
  2009-06-29  7:41 ` [RESEND PATCH] x86/perf_count: update x86_pmu after WARN Yinghai Lu
@ 2009-06-29  8:21   ` tip-bot for Yinghai Lu
  0 siblings, 0 replies; 5+ messages in thread
From: tip-bot for Yinghai Lu @ 2009-06-29  8:21 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, yinghai, a.p.zijlstra, tglx, mingo

Commit-ID:  4078c444cf667f018c3fc7ebf141131a2b7c9480
Gitweb:     http://git.kernel.org/tip/4078c444cf667f018c3fc7ebf141131a2b7c9480
Author:     Yinghai Lu <yinghai@kernel.org>
AuthorDate: Mon, 29 Jun 2009 00:41:11 -0700
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Mon, 29 Jun 2009 10:19:25 +0200

perf_counter, x86: Update x86_pmu after WARN()

The print out should read the value before changing the value.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <4A487017.4090007@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>


---
 arch/x86/kernel/cpu/perf_counter.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/cpu/perf_counter.c b/arch/x86/kernel/cpu/perf_counter.c
index b83474b..d4cf4ce 100644
--- a/arch/x86/kernel/cpu/perf_counter.c
+++ b/arch/x86/kernel/cpu/perf_counter.c
@@ -1496,17 +1496,17 @@ void __init init_hw_perf_counters(void)
 	pr_cont("%s PMU driver.\n", x86_pmu.name);
 
 	if (x86_pmu.num_counters > X86_PMC_MAX_GENERIC) {
-		x86_pmu.num_counters = X86_PMC_MAX_GENERIC;
 		WARN(1, KERN_ERR "hw perf counters %d > max(%d), clipping!",
 		     x86_pmu.num_counters, X86_PMC_MAX_GENERIC);
+		x86_pmu.num_counters = X86_PMC_MAX_GENERIC;
 	}
 	perf_counter_mask = (1 << x86_pmu.num_counters) - 1;
 	perf_max_counters = x86_pmu.num_counters;
 
 	if (x86_pmu.num_counters_fixed > X86_PMC_MAX_FIXED) {
-		x86_pmu.num_counters_fixed = X86_PMC_MAX_FIXED;
 		WARN(1, KERN_ERR "hw perf counters fixed %d > max(%d), clipping!",
 		     x86_pmu.num_counters_fixed, X86_PMC_MAX_FIXED);
+		x86_pmu.num_counters_fixed = X86_PMC_MAX_FIXED;
 	}
 
 	perf_counter_mask |=

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-06-29  8:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-28 21:03 [PATCH] x86/perf_count: update x86_pmu after WARN Yinghai Lu
2009-06-28 21:04 ` [PATCH] x86/perf_count: make perf_count_mask to local Yinghai Lu
2009-06-28 21:04 ` [PATCH] x86/perf_count: change intel_pmu and amd_pmu to initdata Yinghai Lu
2009-06-29  7:41 ` [RESEND PATCH] x86/perf_count: update x86_pmu after WARN Yinghai Lu
2009-06-29  8:21   ` [tip:perfcounters/urgent] perf_counter, x86: Update x86_pmu after WARN() tip-bot for Yinghai Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox