Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorIngo Molnar <mingo@kernel.org>
Wed, 18 Dec 2013 10:10:03 +0000 (11:10 +0100)
committerIngo Molnar <mingo@kernel.org>
Wed, 18 Dec 2013 13:07:26 +0000 (14:07 +0100)
Pull perf/core improvements and refactorings from Arnaldo Carvalho de Melo:

New features:

. In perf timechart:
- Add backtrace support to CPU info
. Print pid along the name
. Add support for CPU topology
. Add new option --highlight'ing threads, be it by name or,
  if a numeric value is provided, that run more than given duration.
  From Stanislav Fomichev.

Refactorings:

. Rename some struct DSO binary_type related members and methods,
  to clarify its purpose and need for differentiation from symtab_type,
  i.e. one is about the files .text, CFI, etc, i.e. its binary contents,
  and the other is about where the symbol table came from.

. Convert to new topic libraries, starting with an API one (sysfs, debugfs,
  etc), renaming liblk in the process, from Borislav Petkov.

. Get rid of some more panic() like error handling in libtraceevent,
  from Namhyung Kim.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/arm/kernel/perf_event.c
arch/x86/kernel/cpu/perf_event_intel_rapl.c
kernel/events/core.c

index bc3f2ef..789d846 100644 (file)
@@ -99,10 +99,6 @@ int armpmu_event_set_period(struct perf_event *event)
        s64 period = hwc->sample_period;
        int ret = 0;
 
-       /* The period may have been changed by PERF_EVENT_IOC_PERIOD */
-       if (unlikely(period != hwc->last_period))
-               left = period - (hwc->last_period - left);
-
        if (unlikely(left <= -period)) {
                left = period;
                local64_set(&hwc->period_left, left);
index bf8e4a7..0e3754e 100644 (file)
@@ -615,6 +615,7 @@ static int __init rapl_pmu_init(void)
        case 42: /* Sandy Bridge */
        case 58: /* Ivy Bridge */
        case 60: /* Haswell */
+       case 69: /* Haswell-Celeron */
                rapl_cntr_mask = RAPL_IDX_CLN;
                rapl_pmu_events_group.attrs = rapl_events_cln_attr;
                break;
index 403b781..89d34f9 100644 (file)
@@ -3527,7 +3527,7 @@ static void perf_event_for_each(struct perf_event *event,
 static int perf_event_period(struct perf_event *event, u64 __user *arg)
 {
        struct perf_event_context *ctx = event->ctx;
-       int ret = 0;
+       int ret = 0, active;
        u64 value;
 
        if (!is_sampling_event(event))
@@ -3551,6 +3551,20 @@ static int perf_event_period(struct perf_event *event, u64 __user *arg)
                event->attr.sample_period = value;
                event->hw.sample_period = value;
        }
+
+       active = (event->state == PERF_EVENT_STATE_ACTIVE);
+       if (active) {
+               perf_pmu_disable(ctx->pmu);
+               event->pmu->stop(event, PERF_EF_UPDATE);
+       }
+
+       local64_set(&event->hw.period_left, 0);
+
+       if (active) {
+               event->pmu->start(event, PERF_EF_RELOAD);
+               perf_pmu_enable(ctx->pmu);
+       }
+
 unlock:
        raw_spin_unlock_irq(&ctx->lock);