Messages in this thread | | | Date | Tue, 5 Jul 2011 12:20:17 +0200 | From | Ingo Molnar <> | Subject | Re: [PATCH -tip, final] perf, x86: Add hw_watchdog_set_attr() in a sake of nmi-watchdog on P4 |
| |
* Cyrill Gorcunov <gorcunov@gmail.com> wrote:
> +static void p4_hw_watchdog_set_attr(struct perf_event_attr *wd_attr) > +{ > + /* > + * Watchdog ticks are special on Netburst, we use > + * that named "non-sleeping" ticks as recommended > + * by Intel SDM Vol3b. > + */ > + WARN_ON_ONCE(wd_attr->type != PERF_TYPE_HARDWARE || > + wd_attr->config != PERF_COUNT_HW_CPU_CYCLES); > + > + wd_attr->type = PERF_TYPE_RAW; > + wd_attr->config = > + p4_config_pack_escr(P4_ESCR_EVENT(P4_EVENT_EXECUTION_EVENT) | > + P4_ESCR_EMASK_BIT(P4_EVENT_EXECUTION_EVENT, NBOGUS0) | > + P4_ESCR_EMASK_BIT(P4_EVENT_EXECUTION_EVENT, NBOGUS1) | > + P4_ESCR_EMASK_BIT(P4_EVENT_EXECUTION_EVENT, NBOGUS2) | > + P4_ESCR_EMASK_BIT(P4_EVENT_EXECUTION_EVENT, NBOGUS3) | > + P4_ESCR_EMASK_BIT(P4_EVENT_EXECUTION_EVENT, BOGUS0) | > + P4_ESCR_EMASK_BIT(P4_EVENT_EXECUTION_EVENT, BOGUS1) | > + P4_ESCR_EMASK_BIT(P4_EVENT_EXECUTION_EVENT, BOGUS2) | > + P4_ESCR_EMASK_BIT(P4_EVENT_EXECUTION_EVENT, BOGUS3)) | > + p4_config_pack_cccr(P4_CCCR_THRESHOLD(15) | P4_CCCR_COMPLEMENT | > + P4_CCCR_COMPARE); > +}
So why don't we simply set this for all PERF_COUNT_HW_CPU_CYCLES events in the P4 PMU driver? That would remove half of the patch AFAICS.
Thanks,
Ingo
| |