Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 178069
b: refs/heads/master
c: 5d27c23
h: refs/heads/master
i:
  178067: 3761650
v: v3
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Dec 17, 2009
1 parent 895fd82 commit 5c471f9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 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: 06d65bda75341485d32f33da474b0664819ad497
refs/heads/master: 5d27c23df09b702868d9a3bff86ec6abd22963ac
32 changes: 18 additions & 14 deletions trunk/kernel/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -1381,6 +1381,9 @@ static void perf_ctx_adjust_freq(struct perf_event_context *ctx)
if (event->state != PERF_EVENT_STATE_ACTIVE)
continue;

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

hwc = &event->hw;

interrupts = hwc->interrupts;
Expand Down Expand Up @@ -3265,6 +3268,9 @@ static void perf_event_task_output(struct perf_event *event,

static int perf_event_task_match(struct perf_event *event)
{
if (event->cpu != -1 && event->cpu != smp_processor_id())
return 0;

if (event->attr.comm || event->attr.mmap || event->attr.task)
return 1;

Expand All @@ -3290,12 +3296,11 @@ static void perf_event_task_event(struct perf_task_event *task_event)
rcu_read_lock();
cpuctx = &get_cpu_var(perf_cpu_context);
perf_event_task_ctx(&cpuctx->ctx, task_event);
put_cpu_var(perf_cpu_context);

if (!ctx)
ctx = rcu_dereference(task_event->task->perf_event_ctxp);
if (ctx)
perf_event_task_ctx(ctx, task_event);
put_cpu_var(perf_cpu_context);
rcu_read_unlock();
}

Expand Down Expand Up @@ -3372,6 +3377,9 @@ static void perf_event_comm_output(struct perf_event *event,

static int perf_event_comm_match(struct perf_event *event)
{
if (event->cpu != -1 && event->cpu != smp_processor_id())
return 0;

if (event->attr.comm)
return 1;

Expand Down Expand Up @@ -3408,15 +3416,10 @@ static void perf_event_comm_event(struct perf_comm_event *comm_event)
rcu_read_lock();
cpuctx = &get_cpu_var(perf_cpu_context);
perf_event_comm_ctx(&cpuctx->ctx, comm_event);
put_cpu_var(perf_cpu_context);

/*
* doesn't really matter which of the child contexts the
* events ends up in.
*/
ctx = rcu_dereference(current->perf_event_ctxp);
if (ctx)
perf_event_comm_ctx(ctx, comm_event);
put_cpu_var(perf_cpu_context);
rcu_read_unlock();
}

Expand Down Expand Up @@ -3491,6 +3494,9 @@ static void perf_event_mmap_output(struct perf_event *event,
static int perf_event_mmap_match(struct perf_event *event,
struct perf_mmap_event *mmap_event)
{
if (event->cpu != -1 && event->cpu != smp_processor_id())
return 0;

if (event->attr.mmap)
return 1;

Expand Down Expand Up @@ -3564,15 +3570,10 @@ static void perf_event_mmap_event(struct perf_mmap_event *mmap_event)
rcu_read_lock();
cpuctx = &get_cpu_var(perf_cpu_context);
perf_event_mmap_ctx(&cpuctx->ctx, mmap_event);
put_cpu_var(perf_cpu_context);

/*
* doesn't really matter which of the child contexts the
* events ends up in.
*/
ctx = rcu_dereference(current->perf_event_ctxp);
if (ctx)
perf_event_mmap_ctx(ctx, mmap_event);
put_cpu_var(perf_cpu_context);
rcu_read_unlock();

kfree(buf);
Expand Down Expand Up @@ -3863,6 +3864,9 @@ static int perf_swevent_match(struct perf_event *event,
struct perf_sample_data *data,
struct pt_regs *regs)
{
if (event->cpu != -1 && event->cpu != smp_processor_id())
return 0;

if (!perf_swevent_is_counting(event))
return 0;

Expand Down

0 comments on commit 5c471f9

Please sign in to comment.