Merge branch 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 19 Dec 2009 17:48:42 +0000 (09:48 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 19 Dec 2009 17:48:42 +0000 (09:48 -0800)
* 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  perf session: Make events_stats u64 to avoid overflow on 32-bit arches
  hw-breakpoints: Fix hardware breakpoints -> perf events dependency
  perf events: Dont report side-band events on each cpu for per-task-per-cpu events
  perf events, x86/stacktrace: Fix performance/softlockup by providing a special frame pointer-only stack walker
  perf events, x86/stacktrace: Make stack walking optional
  perf events: Remove unused perf_counter.h header file
  perf probe: Check new event name
  kprobe-tracer: Check new event/group name
  perf probe: Check whether debugfs path is correct
  perf probe: Fix libdwarf include path for Debian

1  2 
kernel/perf_event.c

diff --combined kernel/perf_event.c
index 97d1a3dd7a597a763eaa18509d58dd2ccabeedba,03cc061398d1a8c784cc6f868c60f2186e24db23..e0eb4a2fe1833e9de3b5ff10f6959358d31e2806
@@@ -1381,6 -1381,9 +1381,9 @@@ static void perf_ctx_adjust_freq(struc
                if (event->state != PERF_EVENT_STATE_ACTIVE)
                        continue;
  
+               if (event->cpu != -1 && event->cpu != smp_processor_id())
+                       continue;
                hwc = &event->hw;
  
                interrupts = hwc->interrupts;
@@@ -1614,7 -1617,7 +1617,7 @@@ static struct perf_event_context *find_
                 * offline CPU and activate it when the CPU comes up, but
                 * that's for later.
                 */
 -              if (!cpu_isset(cpu, cpu_online_map))
 +              if (!cpu_online(cpu))
                        return ERR_PTR(-ENODEV);
  
                cpuctx = &per_cpu(perf_cpu_context, cpu);
@@@ -3265,6 -3268,9 +3268,9 @@@ static void perf_event_task_output(stru
  
  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;
  
@@@ -3290,12 -3296,11 +3296,11 @@@ static void perf_event_task_event(struc
        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();
  }
  
@@@ -3372,6 -3377,9 +3377,9 @@@ static void perf_event_comm_output(stru
  
  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;
  
@@@ -3408,15 -3416,10 +3416,10 @@@ static void perf_event_comm_event(struc
        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();
  }
  
@@@ -3491,6 -3494,9 +3494,9 @@@ static void perf_event_mmap_output(stru
  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;
  
@@@ -3564,15 -3570,10 +3570,10 @@@ got_name
        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);
@@@ -3863,6 -3864,9 +3864,9 @@@ static int perf_swevent_match(struct pe
                                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;