[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100304085256.GN13205@erda.amd.com>
Date: Thu, 4 Mar 2010 09:52:56 +0100
From: Robert Richter <robert.richter@....com>
To: eranian@...gle.com
CC: linux-kernel@...r.kernel.org, peterz@...radead.org, mingo@...e.hu,
paulus@...ba.org, fweisbec@...il.com, perfmon2-devel@...ts.sf.net,
eranian@...il.com, davem@...emloft.net
Subject: Re: [PATCH] perf_events: add sampling period randomization support
(v2)
On 02.03.10 16:21:45, eranian@...gle.com wrote:
> This patch adds support for randomizing the sampling period. Randomization
> is very useful to mitigate the bias that exists with sampling. The random
> number generator does not need to be sophisticated. This patch uses the
> builtin random32() generator.
>
> Randomization is activated by setting perf_event_attr.random_period_width
> to a non-zero value. It represents the width of the mask to apply to the
> random value, i.e, maximum range of variation. The random value is applied
> AROUND the period, i.e., period may be longer or shorter with a maximum
> variation of half the bit width. Thus, on average the sampling period remains
> equal to the initial period passed in perf_event_attr.sample_period.
>
> Note that randomization is not available when a target interrupt rate
> (freq) is enabled.
>
> The last used period can be collected using the PERF_SAMPLE_PERIOD flag
> in sample_type.
>
> Randomization is implemented in generic code thus it applies to all
> PMU models and software events.
>
> Signed-off-by: Stephane Eranian <eranian@...gle.com>
>
> --
> include/linux/perf_event.h | 3 +++
> kernel/perf_event.c | 44 ++++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 47 insertions(+)
Reviewed-by: Robert Richter <robert.richter@....com>
--
Advanced Micro Devices, Inc.
Operating System Research Center
email: robert.richter@....com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists