perf_event: Allocate children's perf_event_ctxp at the right time
authorXiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Wed, 9 Dec 2009 03:29:44 +0000 (11:29 +0800)
committerIngo Molnar <mingo@elte.hu>
Wed, 9 Dec 2009 08:56:27 +0000 (09:56 +0100)
commitb93f7978ad6b46133e9453b90ccc057dc2429e75
treef3420ebd5fa80ddb1a4c3e302a64861146104385
parentaa5452d70c0d559310598b243b8b1033c10056e7
perf_event: Allocate children's perf_event_ctxp at the right time

In current code, children task will allocate memory for
'child->perf_event_ctxp' if the parent is counted, we can
do it only if the parent allowed children inherit it.

It can save memory and reduce overhead.

Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Reviewed-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <4B1F19A8.5040805@cn.fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/perf_event.c