Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 182380
b: refs/heads/master
c: e286417
h: refs/heads/master
v: v3
  • Loading branch information
Frederic Weisbecker committed Jan 16, 2010
1 parent a3aec35 commit d9470ad
Show file tree
Hide file tree
Showing 2 changed files with 5 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: 5908cdc85eb30f8d07f2cb11d4a62334d7229048
refs/heads/master: e286417378b4f9ce6e473b556193465ab22e12ab
17 changes: 4 additions & 13 deletions trunk/kernel/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -1454,25 +1454,16 @@ static void perf_ctx_adjust_freq(struct perf_event_context *ctx)
*/
static void rotate_ctx(struct perf_event_context *ctx)
{
struct perf_event *event;

if (!ctx->nr_events)
return;

raw_spin_lock(&ctx->lock);
/*
* Rotate the first entry last (works just fine for group events too):
*/

/* Rotate the first entry last of non-pinned groups */
perf_disable();
list_for_each_entry(event, &ctx->pinned_groups, group_entry) {
list_move_tail(&event->group_entry, &ctx->pinned_groups);
break;
}

list_for_each_entry(event, &ctx->flexible_groups, group_entry) {
list_move_tail(&event->group_entry, &ctx->flexible_groups);
break;
}
list_rotate_left(&ctx->flexible_groups);

perf_enable();

raw_spin_unlock(&ctx->lock);
Expand Down

0 comments on commit d9470ad

Please sign in to comment.