Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 177469
b: refs/heads/master
c: f4c4176
h: refs/heads/master
i:
  177467: 8ed8a69
v: v3
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Dec 16, 2009
1 parent b0c476e commit 1dd5b61
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 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: 9b33827de63539c7c3314ddf890fb216e4acf3d8
refs/heads/master: f4c4176f21533e22bcc292030da72bcfa105f5b8
11 changes: 7 additions & 4 deletions trunk/kernel/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -782,6 +782,9 @@ static void __perf_install_in_context(void *info)

add_event_to_ctx(event, ctx);

if (event->cpu != -1 && event->cpu != smp_processor_id())
goto unlock;

/*
* Don't put the event on if it is disabled or if
* it is in a group and the group isn't on.
Expand Down Expand Up @@ -925,6 +928,9 @@ static void __perf_event_enable(void *info)
goto unlock;
__perf_event_mark_enabled(event, ctx);

if (event->cpu != -1 && event->cpu != smp_processor_id())
goto unlock;

/*
* If the event is in a group and isn't the group leader,
* then don't put it on unless the group is on.
Expand Down Expand Up @@ -1595,10 +1601,7 @@ static struct perf_event_context *find_get_context(pid_t pid, int cpu)
unsigned long flags;
int err;

/*
* If cpu is not a wildcard then this is a percpu event:
*/
if (cpu != -1) {
if (pid == -1 && cpu != -1) {
/* Must be root to operate on a CPU event: */
if (perf_paranoid_cpu() && !capable(CAP_SYS_ADMIN))
return ERR_PTR(-EACCES);
Expand Down

0 comments on commit 1dd5b61

Please sign in to comment.