Re: [PATCH 1/9] perf tools: add test for reading object code

From: Arnaldo Carvalho de Melo
Date: Wed Jul 31 2013 - 13:44:10 EST


Em Wed, Jul 31, 2013 at 12:11:13AM +0300, Adrian Hunter escreveu:
> On 29/07/2013 9:28 a.m., Namhyung Kim wrote:
> >>+
> >>+static int do_test_code_reading(void)
> >>+{
> >>+ struct machines machines;
> >>+ struct machine *machine;
> >>+ struct thread *thread;
> >>+ struct perf_record_opts opts = {
> >>+ .mmap_pages = UINT_MAX,
> >>+ .user_freq = UINT_MAX,
> >>+ .user_interval = ULLONG_MAX,
> >>+ .freq = 40000,
> >
> >Is it intended to use the freq of 40000 instead of 4000 (default)?
>
> Yes. The "workload" is small so a higher sampling rate is preferable.

But preferably one that is less than:

[root@zoo ~]# cat /proc/sys/kernel/perf_event_max_sample_rate
25000
[root@zoo ~]#

That is the reason why this test is failing on this Ivy Bridge notebook:

[root@zoo ~]# dmesg | grep perf_event_max_sample_rate
[ 4068.969761] perf samples too long (2552 > 2500), lowering kernel.perf_event_max_sample_rate to 50000
[ 4069.842176] perf samples too long (5039 > 5000), lowering kernel.perf_event_max_sample_rate to 25000
[root@zoo ~]#

Look at kernel/events/core.c.

So keeping it at 4k may not be a bad idea, or at least have code that reads
/proc/sys/kernel/perf_event_max_sample_rate if using the highest freq is
desired.

- Arnaldo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/