Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 257018
b: refs/heads/master
c: 04dc2db
h: refs/heads/master
v: v3
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed May 28, 2011
1 parent 31d5201 commit 445871d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 21 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: facc43071cc0d4821c176d7d34570714eb348df9
refs/heads/master: 04dc2dbbfe1c6f81b996d4dab255da75f9efbb4a
26 changes: 6 additions & 20 deletions trunk/kernel/events/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1979,8 +1979,7 @@ void __perf_event_task_sched_out(struct task_struct *task,
perf_cgroup_sched_out(task);
}

static void task_ctx_sched_out(struct perf_event_context *ctx,
enum event_type_t event_type)
static void task_ctx_sched_out(struct perf_event_context *ctx)
{
struct perf_cpu_context *cpuctx = __get_cpu_context(ctx);

Expand All @@ -1990,7 +1989,7 @@ static void task_ctx_sched_out(struct perf_event_context *ctx,
if (WARN_ON_ONCE(ctx != cpuctx->task_ctx))
return;

ctx_sched_out(ctx, cpuctx, event_type);
ctx_sched_out(ctx, cpuctx, EVENT_ALL);
cpuctx->task_ctx = NULL;
}

Expand Down Expand Up @@ -2098,19 +2097,6 @@ static void cpu_ctx_sched_in(struct perf_cpu_context *cpuctx,
ctx_sched_in(ctx, cpuctx, event_type, task);
}

static void task_ctx_sched_in(struct perf_event_context *ctx,
enum event_type_t event_type)
{
struct perf_cpu_context *cpuctx;

cpuctx = __get_cpu_context(ctx);
if (cpuctx->task_ctx == ctx)
return;

ctx_sched_in(ctx, cpuctx, event_type, NULL);
cpuctx->task_ctx = ctx;
}

static void perf_event_context_sched_in(struct perf_event_context *ctx,
struct task_struct *task)
{
Expand Down Expand Up @@ -2363,15 +2349,15 @@ static void perf_rotate_context(struct perf_cpu_context *cpuctx)

cpu_ctx_sched_out(cpuctx, EVENT_FLEXIBLE);
if (ctx)
task_ctx_sched_out(ctx, EVENT_FLEXIBLE);
ctx_sched_out(ctx, cpuctx, EVENT_FLEXIBLE);

rotate_ctx(&cpuctx->ctx);
if (ctx)
rotate_ctx(ctx);

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

done:
if (remove)
Expand Down Expand Up @@ -2435,7 +2421,7 @@ static void perf_event_enable_on_exec(struct perf_event_context *ctx)
perf_cgroup_sched_out(current);

raw_spin_lock(&ctx->lock);
task_ctx_sched_out(ctx, EVENT_ALL);
task_ctx_sched_out(ctx);

list_for_each_entry(event, &ctx->pinned_groups, group_entry) {
ret = event_enable_on_exec(event, ctx);
Expand Down Expand Up @@ -6794,7 +6780,7 @@ static void perf_event_exit_task_context(struct task_struct *child, int ctxn)
* incremented the context's refcount before we do put_ctx below.
*/
raw_spin_lock(&child_ctx->lock);
task_ctx_sched_out(child_ctx, EVENT_ALL);
task_ctx_sched_out(child_ctx);
child->perf_event_ctxp[ctxn] = NULL;
/*
* If this context is a clone; unclone it so it can't get
Expand Down

0 comments on commit 445871d

Please sign in to comment.