Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 191345
b: refs/heads/master
c: 050735b
h: refs/heads/master
i:
  191343: 24e299f
v: v3
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed May 11, 2010
1 parent 5e36200 commit bcb96f7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 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: e3174cfd2a1e28fff774681f00a0eef3d31da970
refs/heads/master: 050735b08ca8a016bbace4445fa025b88fee770b
19 changes: 16 additions & 3 deletions trunk/kernel/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,6 @@ list_add_event(struct perf_event *event, struct perf_event_context *ctx)
static void
list_del_event(struct perf_event *event, struct perf_event_context *ctx)
{
struct perf_event *sibling, *tmp;

if (list_empty(&event->group_entry))
return;
ctx->nr_events--;
Expand All @@ -333,6 +331,12 @@ list_del_event(struct perf_event *event, struct perf_event_context *ctx)
*/
if (event->state > PERF_EVENT_STATE_OFF)
event->state = PERF_EVENT_STATE_OFF;
}

static void
perf_destroy_group(struct perf_event *event, struct perf_event_context *ctx)
{
struct perf_event *sibling, *tmp;

/*
* If this was a group event with sibling events then
Expand Down Expand Up @@ -1868,6 +1872,12 @@ int perf_event_release_kernel(struct perf_event *event)
{
struct perf_event_context *ctx = event->ctx;

/*
* Remove from the PMU, can't get re-enabled since we got
* here because the last ref went.
*/
perf_event_disable(event);

WARN_ON_ONCE(ctx->parent_ctx);
/*
* There are two ways this annotation is useful:
Expand All @@ -1882,7 +1892,10 @@ int perf_event_release_kernel(struct perf_event *event)
* to trigger the AB-BA case.
*/
mutex_lock_nested(&ctx->mutex, SINGLE_DEPTH_NESTING);
perf_event_remove_from_context(event);
raw_spin_lock_irq(&ctx->lock);
list_del_event(event, ctx);
perf_destroy_group(event, ctx);
raw_spin_unlock_irq(&ctx->lock);
mutex_unlock(&ctx->mutex);

mutex_lock(&event->owner->perf_event_mutex);
Expand Down

0 comments on commit bcb96f7

Please sign in to comment.