summary refs log tree commit diff
path: root/kernel/perf_event.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2011-02-07 08:44:11 +0100
committerIngo Molnar <mingo@elte.hu>2011-02-07 08:44:26 +0100
commitc7f9a6f377fa64e5a74f8c128d4349765c28fab1 (patch)
treee71eaf08c5f9179d6fd6c7e08d8539358dc76ad1 /kernel/perf_event.c
parentfe4b04fa31a6dcf4358aa84cf81e5a7fd079469b (diff)
parent8dbdea8444d303a772bceb1ba963f0e3273bfc5e (diff)
downloadlinux-c7f9a6f377fa64e5a74f8c128d4349765c28fab1.tar.gz
Merge branch 'linus' into perf/core
Merge reason: Pick up perf fixes that are now upstream

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/perf_event.c')
-rw-r--r--kernel/perf_event.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/kernel/perf_event.c b/kernel/perf_event.c
index 7d3faa25e136..a353a4d6d00d 100644
--- a/kernel/perf_event.c
+++ b/kernel/perf_event.c
@@ -1966,11 +1966,12 @@ static void __perf_event_read(void *info)
 		return;
 
 	raw_spin_lock(&ctx->lock);
-	update_context_time(ctx);
+	if (ctx->is_active)
+		update_context_time(ctx);
 	update_event_times(event);
+	if (event->state == PERF_EVENT_STATE_ACTIVE)
+		event->pmu->read(event);
 	raw_spin_unlock(&ctx->lock);
-
-	event->pmu->read(event);
 }
 
 static inline u64 perf_event_count(struct perf_event *event)
@@ -2064,8 +2065,7 @@ static int alloc_callchain_buffers(void)
 	 * accessed from NMI. Use a temporary manual per cpu allocation
 	 * until that gets sorted out.
 	 */
-	size = sizeof(*entries) + sizeof(struct perf_callchain_entry *) *
-		num_possible_cpus();
+	size = offsetof(struct callchain_cpus_entries, cpu_entries[nr_cpu_ids]);
 
 	entries = kzalloc(size, GFP_KERNEL);
 	if (!entries)