Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 147446
b: refs/heads/master
c: e758a33
h: refs/heads/master
v: v3
  • Loading branch information
Paul Mackerras authored and Ingo Molnar committed May 12, 2009
1 parent 0e16560 commit fe12851
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 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: 615a3f1e055ac9b0ae74e1f935a12ea2cfe2a2ad
refs/heads/master: e758a33d6fc5b9d6a3ae489863d04fcecad8120b
19 changes: 12 additions & 7 deletions trunk/kernel/perf_counter.c
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,7 @@ static void __perf_counter_enable(void *info)
struct perf_cpu_context *cpuctx = &__get_cpu_var(perf_cpu_context);
struct perf_counter_context *ctx = counter->ctx;
struct perf_counter *leader = counter->group_leader;
unsigned long pmuflags;
unsigned long flags;
int err;

Expand All @@ -689,14 +690,18 @@ static void __perf_counter_enable(void *info)
if (leader != counter && leader->state != PERF_COUNTER_STATE_ACTIVE)
goto unlock;

if (!group_can_go_on(counter, cpuctx, 1))
if (!group_can_go_on(counter, cpuctx, 1)) {
err = -EEXIST;
else if (counter == leader)
err = group_sched_in(counter, cpuctx, ctx,
smp_processor_id());
else
err = counter_sched_in(counter, cpuctx, ctx,
smp_processor_id());
} else {
pmuflags = hw_perf_save_disable();
if (counter == leader)
err = group_sched_in(counter, cpuctx, ctx,
smp_processor_id());
else
err = counter_sched_in(counter, cpuctx, ctx,
smp_processor_id());
hw_perf_restore(pmuflags);
}

if (err) {
/*
Expand Down

0 comments on commit fe12851

Please sign in to comment.