Andi,

Thanks for the fast reply! So is an interrupt generated somehow when the sample size is met in the counter register (i.e. 10k), and then the counter value is reset to zero?

Is this how it is done in timer mode also?

Thanks again,

Jeff

From: Andi Kleen <andi@firstfloor.org>
To: oprofile-list@lists.sf.net
Cc: jefrey99@yahoo.com
Sent: Saturday, September 17, 2011 10:44 PM
Subject: Re: oprofile sample rate

Jeff Eastlack <jefrey99@yahoo.com> writes:

> This sets the sample rate at 10k.
> 1) does this mean it samples at 10k clock cycles or 10k ticks or
> other?

It samples every 10k events.

> 2) what does a sample mean. The way I understand performance counters
> is

A sample means 10k events occurred.

> that they count the occurrence of a specific event regardless of what
> program caused it ... right? How does oprofile "sample" an event that
> might have occurred several times in between the sample rate and assign
> that sample to a program?

It's all statistical with an sampling error and the hope that large
numbers fix it up. In addition there's usually some "skid": samples
somewhat later than the actual event. In many cases that's fine, in
others it can cause systematic mis-sampling.

-Andi
--
ak@linux.intel.com -- Speaking for myself only