Hi,
Thanks very much for your reply.
Even in fixed period mode, I still see a little randomization for the
sampling period. For example, here is the result on my box:
$ ./task_smpl -p 200000 ls
period=200000 freq=0
17 PERF_COUNT_HW_CPU_CYCLES
18 PERF_COUNT_HW_INSTRUCTIONS
IIP:0xffffffff81306980 PID:26702 TID:26702 TIME:717452755229999
STREAM_ID:17 PERIOD:200000 ENA=0 RUN=0 NR=2
200244 PERF_COUNT_HW_CPU_CYCLES (17)
86619 PERF_COUNT_HW_INSTRUCTIONS (18)
IIP:0x0000003b49005c91 PID:26702 TID:26702 TIME:717452755484619
STREAM_ID:17 PERIOD:200000 ENA=0 RUN=0 NR=2
400375 PERF_COUNT_HW_CPU_CYCLES (17)
186010 PERF_COUNT_HW_INSTRUCTIONS (18)
IIP:0x00000000004039f4 PID:26702 TID:26702 TIME:717452755716217
STREAM_ID:17 PERIOD:200000 ENA=0 RUN=0 NR=2
600267 PERF_COUNT_HW_CPU_CYCLES (17)
352344 PERF_COUNT_HW_INSTRUCTIONS (18)
3 samples collected in 0 poll events, 0 lost samples
avg period=0
I expect a sampling for every 200k CPU cycles. And please note the
PERF_COUNT_HW_CPU_CYCLES(17) counter in each sampling entry, it was not
exactly 200000, 400000 and 600000, but in fact 200244, 400375 and 600267.
And I think it was caused by "expected" sampling periods randomization (as
stated in the header of the source code). Am I right?
Thank you!
> Hi,
>
> On Wed, Oct 20, 2010 at 12:09 PM, xudi <x...@ict.ac.cn> wrote:
>> hi all,
>>
>> ��I am new to libpfm v4.�� I read the example code "task_smpl.c", which
>> uses
>> random sampling periods, but��I didn't find any explicit statement to
>> turn
>> this feature on.
>>
>
> There is no sampling randomization support in perf_events. What you have
> is two modes:
> 1- fixed period
> 2- target average sample rate
>
> In the first mode, you set the period and it is used for each sample.
> In the second mode, you set a target frequency, e.g., 1000Hz, which means
> you'd like to get about 1000 samples/sec. The kernel will adjust the
> sampling
> period dynamically to achieve the target average frequency. The frequency
> is adjusted every timer tick.
>
> In task_smpl, you can select either mode:
> fixed period: task_smpl -p 2400000000 .......
> frequency: task_smpl -p 1000 -f ......
>
>
>
>> So, how to turn off sampling��period��randomization?
>>
>> I am using the official Linux 2.6.35 kernel.
>>
>> Thanks.
>>
>> 2010-10-20
>> ________________________________
>> Di Xu
>> ICT, CAS
>> ------------------------------------------------------------------------------
>> Download new Adobe(R) Flash(R) Builder(TM) 4
>> The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
>> Flex(R) Builder(TM)) enable the development of rich applications that
>> run
>> across multiple browsers and platforms. Download your free trials today!
>> http://p.sf.net/sfu/adobe-dev2dev
>> _______________________________________________
>> perfmon2-devel mailing list
>> perfmon2-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/perfmon2-devel
>>
>>
>
>
------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
perfmon2-devel mailing list
perfmon2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perfmon2-devel