aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-10-05 15:04:41 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-10-05 15:04:41 -0400
commit41cb6654eb2cf01476223a3742946b9f65bd1bbd (patch)
tree6874faea173541ef1692173b9984739e8254ffcc /kernel
parente69a9ac59629db81971a9e03048f9a107712947a (diff)
parent1ad0560e8cdb6d5b381220dc2da187691b5ce124 (diff)
Merge branch 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: perf tools: Run generate-cmdlist.sh properly perf_event: Clean up perf_event_init_task() perf_event: Fix event group handling in __perf_event_sched_*() perf timechart: Add a power-only mode perf top: Add poll_idle to the skip list
Diffstat (limited to 'kernel')
-rw-r--r--kernel/perf_event.c34
1 files changed, 9 insertions, 25 deletions
diff --git a/kernel/perf_event.c b/kernel/perf_event.c
index 0f86feb6db0c..e491fb087939 100644
--- a/kernel/perf_event.c
+++ b/kernel/perf_event.c
@@ -1030,14 +1030,10 @@ void __perf_event_sched_out(struct perf_event_context *ctx,
1030 update_context_time(ctx); 1030 update_context_time(ctx);
1031 1031
1032 perf_disable(); 1032 perf_disable();
1033 if (ctx->nr_active) { 1033 if (ctx->nr_active)
1034 list_for_each_entry(event, &ctx->group_list, group_entry) { 1034 list_for_each_entry(event, &ctx->group_list, group_entry)
1035 if (event != event->group_leader) 1035 group_sched_out(event, cpuctx, ctx);
1036 event_sched_out(event, cpuctx, ctx); 1036
1037 else
1038 group_sched_out(event, cpuctx, ctx);
1039 }
1040 }
1041 perf_enable(); 1037 perf_enable();
1042 out: 1038 out:
1043 spin_unlock(&ctx->lock); 1039 spin_unlock(&ctx->lock);
@@ -1258,12 +1254,8 @@ __perf_event_sched_in(struct perf_event_context *ctx,
1258 if (event->cpu != -1 && event->cpu != cpu) 1254 if (event->cpu != -1 && event->cpu != cpu)
1259 continue; 1255 continue;
1260 1256
1261 if (event != event->group_leader) 1257 if (group_can_go_on(event, cpuctx, 1))
1262 event_sched_in(event, cpuctx, ctx, cpu); 1258 group_sched_in(event, cpuctx, ctx, cpu);
1263 else {
1264 if (group_can_go_on(event, cpuctx, 1))
1265 group_sched_in(event, cpuctx, ctx, cpu);
1266 }
1267 1259
1268 /* 1260 /*
1269 * If this pinned group hasn't been scheduled, 1261 * If this pinned group hasn't been scheduled,
@@ -1291,15 +1283,9 @@ __perf_event_sched_in(struct perf_event_context *ctx,
1291 if (event->cpu != -1 && event->cpu != cpu) 1283 if (event->cpu != -1 && event->cpu != cpu)
1292 continue; 1284 continue;
1293 1285
1294 if (event != event->group_leader) { 1286 if (group_can_go_on(event, cpuctx, can_add_hw))
1295 if (event_sched_in(event, cpuctx, ctx, cpu)) 1287 if (group_sched_in(event, cpuctx, ctx, cpu))
1296 can_add_hw = 0; 1288 can_add_hw = 0;
1297 } else {
1298 if (group_can_go_on(event, cpuctx, can_add_hw)) {
1299 if (group_sched_in(event, cpuctx, ctx, cpu))
1300 can_add_hw = 0;
1301 }
1302 }
1303 } 1289 }
1304 perf_enable(); 1290 perf_enable();
1305 out: 1291 out:
@@ -4781,9 +4767,7 @@ int perf_event_init_task(struct task_struct *child)
4781 * We dont have to disable NMIs - we are only looking at 4767 * We dont have to disable NMIs - we are only looking at
4782 * the list, not manipulating it: 4768 * the list, not manipulating it:
4783 */ 4769 */
4784 list_for_each_entry_rcu(event, &parent_ctx->event_list, event_entry) { 4770 list_for_each_entry(event, &parent_ctx->group_list, group_entry) {
4785 if (event != event->group_leader)
4786 continue;
4787 4771
4788 if (!event->attr.inherit) { 4772 if (!event->attr.inherit) {
4789 inherited_all = 0; 4773 inherited_all = 0;