Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 234502
b: refs/heads/master
c: 0830937
h: refs/heads/master
v: v3
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Mar 4, 2011
1 parent 021b1b9 commit ed1b69a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 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: 2d0f25201ee210a0666ec9c41538ba05a07f8bc6
refs/heads/master: 08309379b7083a9ceec0f9bb96a629058fb623c4
26 changes: 13 additions & 13 deletions trunk/kernel/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -820,16 +820,8 @@ list_add_event(struct perf_event *event, struct perf_event_context *ctx)
list_add_tail(&event->group_entry, list);
}

if (is_cgroup_event(event)) {
if (is_cgroup_event(event))
ctx->nr_cgroups++;
/*
* one more event:
* - that has cgroup constraint on event->cpu
* - that may need work on context switch
*/
atomic_inc(&per_cpu(perf_cgroup_events, event->cpu));
jump_label_inc(&perf_sched_events);
}

list_add_rcu(&event->event_entry, &ctx->event_list);
if (!ctx->nr_events)
Expand Down Expand Up @@ -957,11 +949,8 @@ list_del_event(struct perf_event *event, struct perf_event_context *ctx)

event->attach_state &= ~PERF_ATTACH_CONTEXT;

if (is_cgroup_event(event)) {
if (is_cgroup_event(event))
ctx->nr_cgroups--;
atomic_dec(&per_cpu(perf_cgroup_events, event->cpu));
jump_label_dec(&perf_sched_events);
}

ctx->nr_events--;
if (event->attr.inherit_stat)
Expand Down Expand Up @@ -2903,6 +2892,10 @@ static void free_event(struct perf_event *event)
atomic_dec(&nr_task_events);
if (event->attr.sample_type & PERF_SAMPLE_CALLCHAIN)
put_callchain_buffers();
if (is_cgroup_event(event)) {
atomic_dec(&per_cpu(perf_cgroup_events, event->cpu));
jump_label_dec(&perf_sched_events);
}
}

if (event->buffer) {
Expand Down Expand Up @@ -6478,6 +6471,13 @@ SYSCALL_DEFINE5(perf_event_open,
err = perf_cgroup_connect(pid, event, &attr, group_leader);
if (err)
goto err_alloc;
/*
* one more event:
* - that has cgroup constraint on event->cpu
* - that may need work on context switch
*/
atomic_inc(&per_cpu(perf_cgroup_events, event->cpu));
jump_label_inc(&perf_sched_events);
}

/*
Expand Down

0 comments on commit ed1b69a

Please sign in to comment.