Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 257021
b: refs/heads/master
c: dce5855
h: refs/heads/master
i:
  257019: ee20f3c
v: v3
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed May 28, 2011
1 parent 95f429b commit 1e7ce25
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: db24d33e08b88e990991760a44d72006a5dc6102
refs/heads/master: dce5855bba5df9e87bb04584d505c1f1b103c652
27 changes: 15 additions & 12 deletions trunk/kernel/events/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1476,6 +1476,18 @@ ctx_sched_in(struct perf_event_context *ctx,
enum event_type_t event_type,
struct task_struct *task);

static void perf_event_sched_in(struct perf_cpu_context *cpuctx,
struct perf_event_context *ctx,
struct task_struct *task)
{
cpu_ctx_sched_in(cpuctx, EVENT_PINNED, task);
if (ctx)
ctx_sched_in(ctx, cpuctx, EVENT_PINNED, task);
cpu_ctx_sched_in(cpuctx, EVENT_FLEXIBLE, task);
if (ctx)
ctx_sched_in(ctx, cpuctx, EVENT_FLEXIBLE, task);
}

/*
* Cross CPU call to install and enable a performance event
*
Expand Down Expand Up @@ -1523,12 +1535,7 @@ static int __perf_install_in_context(void *info)
/*
* Schedule everything back in
*/
cpu_ctx_sched_in(cpuctx, EVENT_PINNED, task);
if (task_ctx)
ctx_sched_in(task_ctx, cpuctx, EVENT_PINNED, task);
cpu_ctx_sched_in(cpuctx, EVENT_FLEXIBLE, task);
if (task_ctx)
ctx_sched_in(task_ctx, cpuctx, EVENT_FLEXIBLE, task);
perf_event_sched_in(cpuctx, task_ctx, task);

perf_pmu_enable(cpuctx->ctx.pmu);
perf_ctx_unlock(cpuctx, task_ctx);
Expand Down Expand Up @@ -2107,9 +2114,7 @@ static void perf_event_context_sched_in(struct perf_event_context *ctx,
*/
cpu_ctx_sched_out(cpuctx, EVENT_FLEXIBLE);

ctx_sched_in(ctx, cpuctx, EVENT_PINNED, task);
cpu_ctx_sched_in(cpuctx, EVENT_FLEXIBLE, task);
ctx_sched_in(ctx, cpuctx, EVENT_FLEXIBLE, task);
perf_event_sched_in(cpuctx, ctx, task);

cpuctx->task_ctx = ctx;

Expand Down Expand Up @@ -2347,9 +2352,7 @@ static void perf_rotate_context(struct perf_cpu_context *cpuctx)
if (ctx)
rotate_ctx(ctx);

cpu_ctx_sched_in(cpuctx, EVENT_FLEXIBLE, current);
if (ctx)
ctx_sched_in(ctx, cpuctx, EVENT_FLEXIBLE, current);
perf_event_sched_in(cpuctx, ctx, current);

done:
if (remove)
Expand Down

0 comments on commit 1e7ce25

Please sign in to comment.