linux/arch
Paul Mackerras 57fa721433 perf, powerpc: Fix power_pmu_event_init to not use event->ctx
Commit c3f00c70 ("perf: Separate find_get_context() from event
initialization") changed the generic perf_event code to call
perf_event_alloc, which calls the arch-specific event_init code,
before looking up the context for the new event.  Unfortunately,
power_pmu_event_init uses event->ctx->task to see whether the
new event is a per-task event or a system-wide event, and thus
crashes since event->ctx is NULL at the point where
power_pmu_event_init gets called.

(The reason it needs to know whether it is a per-task event is
because there are some hardware events on Power systems which
only count when the processor is not idle, and there are some
fixed-function counters which count such events.  For example,
the "run cycles" event counts cycles when the processor is not
idle.  If the user asks to count cycles, we can use "run cycles"
if this is a per-task event, since the processor is running when
the task is running, by definition.  We can't use "run cycles"
if the user asks for "cycles" on a system-wide counter.)

Fortunately the information we need is in the
event->attach_state field, so we just use that instead.

Signed-off-by: Paul Mackerras <paulus@samba.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <20101019055535.GA10398@drongo>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Reported-by: Alexey Kardashevskiy <aik@au1.ibm.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2010-10-19 09:18:34 +02:00
..
alpha irq_work: Add generic hardirq context callbacks 2010-10-18 19:58:50 +02:00
arm irq_work: Add generic hardirq context callbacks 2010-10-18 19:58:50 +02:00
avr32 modules: Fix module_bug_list list corruption race 2010-10-05 11:29:27 -07:00
blackfin Blackfin: bf52x/bf54x boards: drop unused nand page size 2010-08-27 16:08:43 -04:00
cris Make do_execve() take a const filename pointer 2010-08-17 18:07:43 -07:00
frv irq_work: Add generic hardirq context callbacks 2010-10-18 19:58:50 +02:00
h8300 modules: Fix module_bug_list list corruption race 2010-10-05 11:29:27 -07:00
ia64 Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6 2010-09-16 12:58:44 -07:00
m32r m32r: fix breakage from "m32r: use generic ptrace_resume code" 2010-09-24 13:54:19 -07:00
m68k arch/m68k/mac/macboing.c: use unsigned long for irqflags 2010-10-01 10:50:58 -07:00
m68knommu m68k,m68knommu: Wire up fanotify_init, fanotify_mark, and prlimit64 2010-09-13 20:28:45 +02:00
microblaze Merge branch 'merge-devicetree' of git://git.secretlab.ca/git/linux-2.6 2010-08-18 09:26:17 -07:00
mips MIPS: Octeon: Place cnmips_cu2_setup in __init memory. 2010-10-04 18:34:00 +01:00
mn10300 modules: Fix module_bug_list list corruption race 2010-10-05 11:29:27 -07:00
parisc irq_work: Add generic hardirq context callbacks 2010-10-18 19:58:50 +02:00
powerpc perf, powerpc: Fix power_pmu_event_init to not use event->ctx 2010-10-19 09:18:34 +02:00
s390 irq_work: Add generic hardirq context callbacks 2010-10-18 19:58:50 +02:00
score Make do_execve() take a const filename pointer 2010-08-17 18:07:43 -07:00
sh irq_work: Add generic hardirq context callbacks 2010-10-18 19:58:50 +02:00
sparc irq_work: Add generic hardirq context callbacks 2010-10-18 19:58:50 +02:00
tile Merge branch 'stable' of git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile 2010-09-24 19:08:39 -07:00
um Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 2010-10-04 11:11:01 -07:00
x86 irq_work: Add generic hardirq context callbacks 2010-10-18 19:58:50 +02:00
xtensa Make do_execve() take a const filename pointer 2010-08-17 18:07:43 -07:00
.gitignore
Kconfig Merge branch 'tip/perf/core' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace into perf/core 2010-09-24 09:12:05 +02:00