diff options
Diffstat (limited to 'kernel/perf_event.c')
-rw-r--r-- | kernel/perf_event.c | 10 |
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) | |||
1966 | return; | 1966 | return; |
1967 | 1967 | ||
1968 | raw_spin_lock(&ctx->lock); | 1968 | raw_spin_lock(&ctx->lock); |
1969 | update_context_time(ctx); | 1969 | if (ctx->is_active) |
1970 | update_context_time(ctx); | ||
1970 | update_event_times(event); | 1971 | update_event_times(event); |
1972 | if (event->state == PERF_EVENT_STATE_ACTIVE) | ||
1973 | event->pmu->read(event); | ||
1971 | raw_spin_unlock(&ctx->lock); | 1974 | raw_spin_unlock(&ctx->lock); |
1972 | |||
1973 | event->pmu->read(event); | ||
1974 | } | 1975 | } |
1975 | 1976 | ||
1976 | static inline u64 perf_event_count(struct perf_event *event) | 1977 | static inline u64 perf_event_count(struct perf_event *event) |
@@ -2064,8 +2065,7 @@ static int alloc_callchain_buffers(void) | |||
2064 | * accessed from NMI. Use a temporary manual per cpu allocation | 2065 | * accessed from NMI. Use a temporary manual per cpu allocation |
2065 | * until that gets sorted out. | 2066 | * until that gets sorted out. |
2066 | */ | 2067 | */ |
2067 | size = sizeof(*entries) + sizeof(struct perf_callchain_entry *) * | 2068 | size = offsetof(struct callchain_cpus_entries, cpu_entries[nr_cpu_ids]); |
2068 | num_possible_cpus(); | ||
2069 | 2069 | ||
2070 | entries = kzalloc(size, GFP_KERNEL); | 2070 | entries = kzalloc(size, GFP_KERNEL); |
2071 | if (!entries) | 2071 | if (!entries) |