From: Thomas Gleixner Date: Fri, 3 Dec 2010 18:24:32 +0000 (-0200) Subject: perf events: Fix event inherit fallout of precalculated headers X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=614b6780eb0c393d2fb49ff62d61f29b877bd07e;p=openwrt%2Fstaging%2Fblogic.git perf events: Fix event inherit fallout of precalculated headers The precalculated header size is not updated when an event is inherited. That results in bogus sample entries for all child events. Bug introduced in c320c7b. Cc: Frederic Weisbecker Cc: Ian Munsie Cc: Ingo Molnar Cc: Mike Galbraith Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Stephane Eranian LKML-Reference: Signed-off-by: Thomas Gleixner Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/kernel/perf_event.c b/kernel/perf_event.c index aede71245e9f..7961b27aceea 100644 --- a/kernel/perf_event.c +++ b/kernel/perf_event.c @@ -6098,6 +6098,11 @@ inherit_event(struct perf_event *parent_event, child_event->ctx = child_ctx; child_event->overflow_handler = parent_event->overflow_handler; + /* + * Precalculate sample_data sizes + */ + perf_event__header_size(child_event); + /* * Link it up in the child's context: */