mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/3] perfcounters/powerpc: fix oops with multiple counters in a group
@ 2009-03-06  9:35 Paul Mackerras
  2009-03-06  9:41 ` Ingo Molnar
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Mackerras @ 2009-03-06  9:35 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: linux-kernel, Thomas Gleixner, Peter Zijlstra

Impact: fix oops-causing bug

This fixes a bug in the powerpc hw_perf_counter_init where the code
didn't initialize ctrs[n] before passing the ctrs array to check_excludes,
leading to possible oopses and other incorrect behaviour.  This fixes it
by initializing ctrs[n] correctly.

Signed-off-by: Paul Mackerras <paulus@samba.org>
---
Ingo, please pull this series of 3 patches from my perfcounters.git
master branch at:

git://git.kernel.org/pub/scm/linux/kernel/git/paulus/perfcounters.git master

 arch/powerpc/kernel/perf_counter.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/kernel/perf_counter.c b/arch/powerpc/kernel/perf_counter.c
index 112332d..4fec112 100644
--- a/arch/powerpc/kernel/perf_counter.c
+++ b/arch/powerpc/kernel/perf_counter.c
@@ -633,6 +633,7 @@ hw_perf_counter_init(struct perf_counter *counter)
 			return NULL;
 	}
 	events[n] = ev;
+	ctrs[n] = counter;
 	if (check_excludes(ctrs, n, 1))
 		return NULL;
 	if (power_check_constraints(events, n + 1))
-- 
1.5.6.3


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

* Re: [PATCH 1/3] perfcounters/powerpc: fix oops with multiple counters in a group
  2009-03-06  9:35 [PATCH 1/3] perfcounters/powerpc: fix oops with multiple counters in a group Paul Mackerras
@ 2009-03-06  9:41 ` Ingo Molnar
  0 siblings, 0 replies; 2+ messages in thread
From: Ingo Molnar @ 2009-03-06  9:41 UTC (permalink / raw)
  To: Paul Mackerras
  Cc: linux-kernel, Thomas Gleixner, Peter Zijlstra, Mike Galbraith


* Paul Mackerras <paulus@samba.org> wrote:

> Ingo, please pull this series of 3 patches from my perfcounters.git
> master branch at:
> 
> git://git.kernel.org/pub/scm/linux/kernel/git/paulus/perfcounters.git master

Pulled into tip:perfcounters/core, thanks Paul!

Note, Mike Galbraith updated both perfstat.c and kerneltop.c to 
the new ABI, they can be picked up from:

  http://redhat.com/~mingo/perfcounters/perfstat.c
  http://redhat.com/~mingo/perfcounters/kerneltop.c

(I also extended kerneltop.c with the -r0x000 type of event IDs 
to pass in raw event IDs.)

	Ingo

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

end of thread, other threads:[~2009-03-06  9:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-06  9:35 [PATCH 1/3] perfcounters/powerpc: fix oops with multiple counters in a group Paul Mackerras
2009-03-06  9:41 ` Ingo Molnar

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

all inboxes | Powered by JetHome®