Message ID | 1426795577-135680-1-git-send-email-david.ahern@oracle.com |
---|---|
State | Accepted |
Delegated to: | David Miller |
Headers | show |
From: David Ahern <david.ahern@oracle.com> Date: Thu, 19 Mar 2015 16:06:17 -0400 > Currently perf-stat (aka, counting mode) does not work: ... > The reason is that state is never reset (stays with PERF_HES_UPTODATE set). > Add a call to sparc_pmu_enable_event during the added_event handling. > Clean up the encoding since pmu_start calls sparc_pmu_enable_event which > does the same. Passing PERF_EF_RELOAD to sparc_pmu_start means the call > to sparc_perf_event_set_period can be removed as well. > > With this patch: ... > Signed-off-by: David Ahern <david.ahern@oracle.com> > Acked-by: Bob Picco <bob.picco@oracle.com> Looks great, applied. -- To unsubscribe from this list: send the line "unsubscribe sparclinux" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/arch/sparc/kernel/perf_event.c b/arch/sparc/kernel/perf_event.c index 6dc4e793df4c..af53c25da2e7 100644 --- a/arch/sparc/kernel/perf_event.c +++ b/arch/sparc/kernel/perf_event.c @@ -960,6 +960,8 @@ static void calculate_single_pcr(struct cpu_hw_events *cpuc) cpuc->pcr[0] |= cpuc->event[0]->hw.config_base; } +static void sparc_pmu_start(struct perf_event *event, int flags); + /* On this PMU each PIC has it's own PCR control register. */ static void calculate_multiple_pcrs(struct cpu_hw_events *cpuc) { @@ -972,20 +974,13 @@ static void calculate_multiple_pcrs(struct cpu_hw_events *cpuc) struct perf_event *cp = cpuc->event[i]; struct hw_perf_event *hwc = &cp->hw; int idx = hwc->idx; - u64 enc; if (cpuc->current_idx[i] != PIC_NO_INDEX) continue; - sparc_perf_event_set_period(cp, hwc, idx); cpuc->current_idx[i] = idx; - enc = perf_event_get_enc(cpuc->events[i]); - cpuc->pcr[idx] &= ~mask_for_index(idx); - if (hwc->state & PERF_HES_STOPPED) - cpuc->pcr[idx] |= nop_for_index(idx); - else - cpuc->pcr[idx] |= event_encoding(enc, idx); + sparc_pmu_start(cp, PERF_EF_RELOAD); } out: for (i = 0; i < cpuc->n_events; i++) {