lkml.org 
[lkml]   [2011]   [Jul]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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


\
 
 \ /
  Last update: 2011-07-05 12:23    [W:0.087 / U:0.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site