Dave,
Ok, I missed that, I am sorry.
I will add this to the patch with a small modification given
that perf_randomize_event_period() modifies last_period.
Thus it needs to be after the assignment to data.period.
Thanks.
On Tue, Mar 2, 2010 at 7:20 AM, David Miller <da...@davemloft.net> wrote:
> From: eran...@google.com
> Date: Mon, 1 Mar 2010 22:07:09 -0800
>
> > 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.
> >
> > The user activates randomization by setting the perf_event_attr.random
> > field to 1 and by passing a bitmask to control the range of variation
> > above the base period. Period will vary from period to period & mask.
> > 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.
> >
> > The patch has been tested on X86. There is also code for PowerPC but
> > I could not test it.
> >
> > Signed-off-by: Stephane Eranian <eran...@google.com>
>
> Please add this, which adds the feature to sparc too.
>
> diff --git a/arch/sparc/kernel/perf_event.c
> b/arch/sparc/kernel/perf_event.c
> index 9f2b2ba..3e28225 100644
> --- a/arch/sparc/kernel/perf_event.c
> +++ b/arch/sparc/kernel/perf_event.c
> @@ -1214,6 +1214,9 @@ static int __kprobes perf_event_nmi_handler(struct
> notifier_block *self,
> if (val & (1ULL << 31))
> continue;
>
> + if (event->attr.random)
> + perf_randomize_event_period(event);
> +
> data.period = event->hw.last_period;
> if (!sparc_perf_event_set_period(event, hwc, idx))
> continue;
>
--
Stephane Eranian | EMEA Software Engineering
Google France | 38 avenue de l'Opéra | 75002 Paris
Tel : +33 (0) 1 42 68 53 00
This email may be confidential or privileged. If you received this
communication by mistake, please
don't forward it to anyone else, please erase all copies and attachments,
and please let me know that
it went to the wrong person. Thanks
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
perfmon2-devel mailing list
perfmon2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perfmon2-devel