diff options
-rw-r--r-- | kernel/perf_counter.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/kernel/perf_counter.c b/kernel/perf_counter.c index 539fa8283a06..16396e9406fa 100644 --- a/kernel/perf_counter.c +++ b/kernel/perf_counter.c | |||
@@ -1273,8 +1273,19 @@ __perf_counter_exit_task(struct task_struct *child, | |||
1273 | local_irq_disable(); | 1273 | local_irq_disable(); |
1274 | perf_flags = hw_perf_save_disable(); | 1274 | perf_flags = hw_perf_save_disable(); |
1275 | 1275 | ||
1276 | if (child_counter->state == PERF_COUNTER_STATE_ACTIVE) | 1276 | if (child_counter->state == PERF_COUNTER_STATE_ACTIVE) { |
1277 | struct perf_cpu_context *cpuctx; | ||
1278 | |||
1279 | cpuctx = &__get_cpu_var(perf_cpu_context); | ||
1280 | |||
1277 | child_counter->hw_ops->hw_perf_counter_disable(child_counter); | 1281 | child_counter->hw_ops->hw_perf_counter_disable(child_counter); |
1282 | child_counter->state = PERF_COUNTER_STATE_INACTIVE; | ||
1283 | child_counter->oncpu = -1; | ||
1284 | |||
1285 | cpuctx->active_oncpu--; | ||
1286 | child_ctx->nr_active--; | ||
1287 | } | ||
1288 | |||
1278 | list_del_init(&child_counter->list_entry); | 1289 | list_del_init(&child_counter->list_entry); |
1279 | 1290 | ||
1280 | hw_perf_restore(perf_flags); | 1291 | hw_perf_restore(perf_flags); |
@@ -1539,4 +1550,3 @@ static int __init perf_counter_sysfs_init(void) | |||
1539 | &perfclass_attr_group); | 1550 | &perfclass_attr_group); |
1540 | } | 1551 | } |
1541 | device_initcall(perf_counter_sysfs_init); | 1552 | device_initcall(perf_counter_sysfs_init); |
1542 | |||