Merge branch 'linus' into perf/core
authorIngo Molnar <mingo@kernel.org>
Fri, 19 Jul 2013 07:34:42 +0000 (09:34 +0200)
committerIngo Molnar <mingo@kernel.org>
Fri, 19 Jul 2013 07:34:42 +0000 (09:34 +0200)
Merge in a v3.11-rc1-ish branch to go from v3.10 based development
to a v3.11 based one.

Signed-off-by: Ingo Molnar <mingo@kernel.org>
1  2 
kernel/events/core.c

diff --combined kernel/events/core.c
index 708ab70ca442dbf2aa39132ed84d0dcffde9a4ae,f86599e8c12371c7d78248e0c6b2a6869b9122ee..5e2bce90b4776784ee8971bebd4291d0179455af
@@@ -4680,10 -4680,12 +4680,10 @@@ perf_event_read_event(struct perf_even
        perf_output_end(&handle);
  }
  
 -typedef int  (perf_event_aux_match_cb)(struct perf_event *event, void *data);
  typedef void (perf_event_aux_output_cb)(struct perf_event *event, void *data);
  
  static void
  perf_event_aux_ctx(struct perf_event_context *ctx,
 -                 perf_event_aux_match_cb match,
                   perf_event_aux_output_cb output,
                   void *data)
  {
                        continue;
                if (!event_filter_match(event))
                        continue;
 -              if (match(event, data))
 -                      output(event, data);
 +              output(event, data);
        }
  }
  
  static void
 -perf_event_aux(perf_event_aux_match_cb match,
 -             perf_event_aux_output_cb output,
 -             void *data,
 +perf_event_aux(perf_event_aux_output_cb output, void *data,
               struct perf_event_context *task_ctx)
  {
        struct perf_cpu_context *cpuctx;
                cpuctx = get_cpu_ptr(pmu->pmu_cpu_context);
                if (cpuctx->unique_pmu != pmu)
                        goto next;
 -              perf_event_aux_ctx(&cpuctx->ctx, match, output, data);
 +              perf_event_aux_ctx(&cpuctx->ctx, output, data);
                if (task_ctx)
                        goto next;
                ctxn = pmu->task_ctx_nr;
                        goto next;
                ctx = rcu_dereference(current->perf_event_ctxp[ctxn]);
                if (ctx)
 -                      perf_event_aux_ctx(ctx, match, output, data);
 +                      perf_event_aux_ctx(ctx, output, data);
  next:
                put_cpu_ptr(pmu->pmu_cpu_context);
        }
  
        if (task_ctx) {
                preempt_disable();
 -              perf_event_aux_ctx(task_ctx, match, output, data);
 +              perf_event_aux_ctx(task_ctx, output, data);
                preempt_enable();
        }
        rcu_read_unlock();
@@@ -4754,12 -4759,6 +4754,12 @@@ struct perf_task_event 
        } event_id;
  };
  
 +static int perf_event_task_match(struct perf_event *event)
 +{
 +      return event->attr.comm || event->attr.mmap ||
 +             event->attr.mmap_data || event->attr.task;
 +}
 +
  static void perf_event_task_output(struct perf_event *event,
                                   void *data)
  {
        struct task_struct *task = task_event->task;
        int ret, size = task_event->event_id.header.size;
  
 +      if (!perf_event_task_match(event))
 +              return;
 +
        perf_event_header__init_id(&task_event->event_id.header, &sample, event);
  
        ret = perf_output_begin(&handle, event,
@@@ -4794,6 -4790,13 +4794,6 @@@ out
        task_event->event_id.header.size = size;
  }
  
 -static int perf_event_task_match(struct perf_event *event,
 -                               void *data __maybe_unused)
 -{
 -      return event->attr.comm || event->attr.mmap ||
 -             event->attr.mmap_data || event->attr.task;
 -}
 -
  static void perf_event_task(struct task_struct *task,
                              struct perf_event_context *task_ctx,
                              int new)
                },
        };
  
 -      perf_event_aux(perf_event_task_match,
 -                     perf_event_task_output,
 +      perf_event_aux(perf_event_task_output,
                       &task_event,
                       task_ctx);
  }
@@@ -4849,11 -4853,6 +4849,11 @@@ struct perf_comm_event 
        } event_id;
  };
  
 +static int perf_event_comm_match(struct perf_event *event)
 +{
 +      return event->attr.comm;
 +}
 +
  static void perf_event_comm_output(struct perf_event *event,
                                   void *data)
  {
        int size = comm_event->event_id.header.size;
        int ret;
  
 +      if (!perf_event_comm_match(event))
 +              return;
 +
        perf_event_header__init_id(&comm_event->event_id.header, &sample, event);
        ret = perf_output_begin(&handle, event,
                                comm_event->event_id.header.size);
@@@ -4887,6 -4883,12 +4887,6 @@@ out
        comm_event->event_id.header.size = size;
  }
  
 -static int perf_event_comm_match(struct perf_event *event,
 -                               void *data __maybe_unused)
 -{
 -      return event->attr.comm;
 -}
 -
  static void perf_event_comm_event(struct perf_comm_event *comm_event)
  {
        char comm[TASK_COMM_LEN];
  
        comm_event->event_id.header.size = sizeof(comm_event->event_id) + size;
  
 -      perf_event_aux(perf_event_comm_match,
 -                     perf_event_comm_output,
 +      perf_event_aux(perf_event_comm_output,
                       comm_event,
                       NULL);
  }
@@@ -4964,17 -4967,6 +4964,17 @@@ struct perf_mmap_event 
        } event_id;
  };
  
 +static int perf_event_mmap_match(struct perf_event *event,
 +                               void *data)
 +{
 +      struct perf_mmap_event *mmap_event = data;
 +      struct vm_area_struct *vma = mmap_event->vma;
 +      int executable = vma->vm_flags & VM_EXEC;
 +
 +      return (!executable && event->attr.mmap_data) ||
 +             (executable && event->attr.mmap);
 +}
 +
  static void perf_event_mmap_output(struct perf_event *event,
                                   void *data)
  {
        int size = mmap_event->event_id.header.size;
        int ret;
  
 +      if (!perf_event_mmap_match(event, data))
 +              return;
 +
        perf_event_header__init_id(&mmap_event->event_id.header, &sample, event);
        ret = perf_output_begin(&handle, event,
                                mmap_event->event_id.header.size);
@@@ -5007,6 -4996,17 +5007,6 @@@ out
        mmap_event->event_id.header.size = size;
  }
  
 -static int perf_event_mmap_match(struct perf_event *event,
 -                               void *data)
 -{
 -      struct perf_mmap_event *mmap_event = data;
 -      struct vm_area_struct *vma = mmap_event->vma;
 -      int executable = vma->vm_flags & VM_EXEC;
 -
 -      return (!executable && event->attr.mmap_data) ||
 -             (executable && event->attr.mmap);
 -}
 -
  static void perf_event_mmap_event(struct perf_mmap_event *mmap_event)
  {
        struct vm_area_struct *vma = mmap_event->vma;
@@@ -5070,7 -5070,8 +5070,7 @@@ got_name
  
        mmap_event->event_id.header.size = sizeof(mmap_event->event_id) + size;
  
 -      perf_event_aux(perf_event_mmap_match,
 -                     perf_event_mmap_output,
 +      perf_event_aux(perf_event_mmap_output,
                       mmap_event,
                       NULL);
  
@@@ -6233,8 -6234,6 +6233,6 @@@ perf_event_mux_interval_ms_store(struc
        return count;
  }
  
- #define __ATTR_RW(attr) __ATTR(attr, 0644, attr##_show, attr##_store)
  static struct device_attribute pmu_dev_attrs[] = {
        __ATTR_RO(type),
        __ATTR_RW(perf_event_mux_interval_ms),
@@@ -7629,7 -7628,7 +7627,7 @@@ static void __init perf_event_init_all_
        }
  }
  
- static void __cpuinit perf_event_init_cpu(int cpu)
+ static void perf_event_init_cpu(int cpu)
  {
        struct swevent_htable *swhash = &per_cpu(swevent_htable, cpu);
  
@@@ -7718,7 -7717,7 +7716,7 @@@ static struct notifier_block perf_reboo
        .priority = INT_MIN,
  };
  
- static int __cpuinit
+ static int
  perf_cpu_notify(struct notifier_block *self, unsigned long action, void *hcpu)
  {
        unsigned int cpu = (long)hcpu;